Public: anyone can read this; the crew can change it.
One keymap: not now is p in the terminal's Next up too, and /system's sort buttons carry S #17153
Merged 34h 54m ago, live in production
keymap-e → main 0 commits
9 files
changed +30
−29
docs/features/keymap.md +1 −1
| @@ -18,7 +18,7 @@ The owner, after the bridge: "tying together all the keybinds is really what im | ||
| 18 | 18 | - **A repository's tabs** are its own `g` jumps (`REPO_TABS`): `g c` code, `g i` issues, `g p` pulls, `g a` map, `g m` commits, `g b` branches, `g f` forks, `g r` runs, `g s` settings. Inside a repository `g f` and `g s` are its own, by design; the forge-wide Front page and Settings are a step away through `:` and Cmd/Ctrl K. A file's Propose a change is `e`. |
| 19 | 19 | - **A quick second key** finds its button: `j` then `m` within a second merges, as `m` alone does (never after `g`, whose letter is a jump). |
| 20 | 20 | |
| 21 | - **Ranked lists, the space and /system:** /next's rows move with `T` top, `K` up, `J` down and `p` not now (the terminal's Next up keeps `l` for not now, since `p` pauses its planner); the space's canvas zooms with `+` and `-`, fits with `0`, jumps to now with `n` and steps bodies with `]` and `[`; /system's process table toggles CPU and memory with `S`. The terminal's cockpit puts a card off with `p` (later, the keymap's park), not `l`. Their old keys (`t` `u` `d` `l`, `c` `m`, the cockpit's `l`) say the new one until 2026-12-15. | |
| 21 | - **Ranked lists, the space and /system:** /next's rows move with `T` top, `K` up, `J` down and `p` not now, on the page and in the terminal's Next up, where `P` pauses the planner; the space's canvas zooms with `+` and `-`, fits with `0`, jumps to now with `n` and steps bodies with `]` and `[`; /system's process table toggles CPU and memory with `S`, which each sort button carries as its hint. The terminal's cockpit puts a card off with `p` (later, the keymap's park), not `l`. Their old keys (`t` `u` `d` `l`, `c` `m`, the cockpit's `l`) say the new one until 2026-12-15. | |
| 22 | 22 | - **/boards, /flow and Talk** bind no keys of their own: they answer the shell's moves and nothing fires while typing in Talk's box. The test now has no page left that chooses a key. |
| 23 | 23 | |
| 24 | 24 | Proof: `test/keymap.test.ts`, `test/bridge.test.ts`. |
docs/features/next-up.md +2 −2
| @@ -15,9 +15,9 @@ row: Next up | ||
| 15 | 15 | - **MCP:** `next_up { app, issue?, to?, all? }` reads the list, or moves one issue with the same words. |
| 16 | 16 | - A rank is cleared when the issue closes. Dependencies order within the list and are shown, never edited here. |
| 17 | 17 | |
| 18 | **Terminal:** the palette's "Next up in a repository" opens the same list; `T`, `K`, `J` and `l` are Top, Up, Down and Not now on the row under the cursor (`l`, not `p`, since `p` pauses the planner there; the keymap says so), through the same action as the page and MCP. A reader sees the order and the keys do nothing; a move made anywhere reorders an open screen live. At most 200 issues are ranked; a move past that is refused and says so. | |
| 18 | **Terminal:** the palette's "Next up in a repository" opens the same list; `T`, `K`, `J` and `p` are Top, Up, Down and Not now on the row under the cursor, as on the page, and `P` pauses the planner (until 2026-12-15 the old `t`, `u`, `d` and `l` say the new key), through the same action as the page and MCP. A reader sees the order and the keys do nothing; a move made anywhere reorders an open screen live. At most 200 issues are ranked; a move past that is refused and says so. | |
| 19 | 19 | |
| 20 | **Filter (#11867):** a plain GET form above the list narrows `/next` to one pillar (`?pillar=P7` or `Later`, typed in a box) and/or a word (`?q=cache`, matched without regard to case, shown as typed, at most 80 characters). A filter only hides rows: each keeps its real place in the whole ranking, the cut line stays where the whole list puts it (drawn only between shown rows), and a move made under a filter moves in the whole order and returns to the same filter. A line says "N of M shown", and that the week's capacity bar is left out while filtered. An unknown or malformed pillar shows an empty list that says so. **Terminal:** `/` asks for a pillar and/or a word (`P7 cache`); an empty answer clears it; ranks, `T` `K` `J` (top, up, down) and `l` (not now; `p` pauses the planner on this screen) and the header count behave as on the page. | |
| 20 | **Filter (#11867):** a plain GET form above the list narrows `/next` to one pillar (`?pillar=P7` or `Later`, typed in a box) and/or a word (`?q=cache`, matched without regard to case, shown as typed, at most 80 characters). A filter only hides rows: each keeps its real place in the whole ranking, the cut line stays where the whole list puts it (drawn only between shown rows), and a move made under a filter moves in the whole order and returns to the same filter. A line says "N of M shown", and that the week's capacity bar is left out while filtered. An unknown or malformed pillar shows an empty list that says so. **Terminal:** `/` asks for a pillar and/or a word (`P7 cache`); an empty answer clears it; ranks, `T` `K` `J` `p` (top, up, down, not now) and the header count behave as on the page. | |
| 21 | 21 | |
| 22 | 22 | **The chapter line (#12681):** under the title, once the repository has chapters, `Ranked for <open chapter>: <progress sentence>` (linked), or "No chapter is open" with a link to draft one; a repository that never drafted a chapter shows no line. **Terminal:** the screen prints the same line under the title, from the same function (`chapterLineParts` in `core/chapters.ts`), wrapped to the width and never cut (#13254, #12991). |
| 23 | 23 |
src/tui/screens/next.ts +8 −9
| @@ -13,7 +13,7 @@ | ||
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | import { rankedWords, rankIssue, stepTo, type Place, placeOf } from "../../actions/next.ts"; |
| 16 | import { keyOf, oldKeys, VERBS } from "../../web/keymap.ts"; | |
| 16 | import { keyOf, oldKeys } from "../../web/keymap.ts"; | |
| 17 | 17 | import { listChapters, itemsOf, chapterLineWords, chapterNames } from "../../core/chapters.ts"; |
| 18 | 18 | import { takeOrder } from "../../crew/take_order.ts"; |
| 19 | 19 | import { nextAll, type NextGroup } from "../../core/next_all.ts"; |
| @@ -215,7 +215,6 @@ export function nextScreen(f: Session, ctx: Ctx, repo: Repo): Screen { | ||
| 215 | 215 | }; |
| 216 | 216 | }); |
| 217 | 217 | |
| 218 | const NOT_NOW = VERBS.park.terminal.key; | |
| 219 | 218 | const screen: Screen = { |
| 220 | 219 | title: "Next up", |
| 221 | 220 | get keys() { |
| @@ -223,17 +222,17 @@ export function nextScreen(f: Session, ctx: Ctx, repo: Repo): Screen { | ||
| 223 | 222 | return [ |
| 224 | 223 | binding(["j", "k"], "move cursor"), |
| 225 | 224 | binding(["enter"], "open"), |
| 226 | // The forge's one keymap (web/keymap.ts): T, K and J as on the page; not now is l here, | |
| 227 | // since p pauses the planner on this screen (the map says so). | |
| 225 | // The forge's one keymap (web/keymap.ts): T, K, J and p as on the page; P pauses the | |
| 226 | // planner. | |
| 228 | 227 | binding([keyOf("top")], "top", { disabled: !on || rows.indexOf(current()!) === 0 }), |
| 229 | 228 | binding([keyOf("raise")], "up", { disabled: !on || rows.indexOf(current()!) === 0 }), |
| 230 | 229 | binding([keyOf("lower")], "down", { disabled: !on || rows.indexOf(current()!) >= rows.length - 1 }), |
| 231 | binding([NOT_NOW], "not now", { disabled: !on }), | |
| 230 | binding([keyOf("park")], "not now", { disabled: !on }), | |
| 232 | 231 | binding(["x"], "tick", { disabled: !on }), |
| 233 | 232 | binding(["s"], "snooze", { disabled: !may() || ticked.size === 0 }), |
| 234 | 233 | binding(["z"], "undo", { disabled: !may() || lastBatch.length === 0 }), |
| 235 | 234 | binding(["/"], "filter"), |
| 236 | ...(owns() && growing !== undefined ? [binding(["p"], growing.until === null ? "pause planner" : "planner on")] : []), | |
| 235 | ...(owns() && growing !== undefined ? [binding([keyOf("pausePlanner")], growing.until === null ? "pause planner" : "planner on")] : []), | |
| 237 | 236 | ]; |
| 238 | 237 | }, |
| 239 | 238 | load(signal) { |
| @@ -264,7 +263,7 @@ export function nextScreen(f: Session, ctx: Ctx, repo: Repo): Screen { | ||
| 264 | 263 | if (e.ctrl || e.alt) return false; |
| 265 | 264 | // The old t, u and d say where they went, for two weeks (keymap.ts OLD_KEYS); l is still not |
| 266 | 265 | // now. |
| 267 | const moved = oldKeys("next").find((o) => o.was === e.key && o.was !== NOT_NOW); | |
| 266 | const moved = oldKeys("next").find((o) => o.was === e.key); | |
| 268 | 267 | if (moved !== undefined) ctx.toast(moved.says); |
| 269 | 268 | else if (e.key === "enter") open(); |
| 270 | 269 | else if (e.key === keyOf("top")) rank({ to: "top" }); |
| @@ -274,8 +273,8 @@ export function nextScreen(f: Session, ctx: Ctx, repo: Repo): Screen { | ||
| 274 | 273 | else if (e.key === "s") batch(false); |
| 275 | 274 | else if (e.key === "z") batch(true); |
| 276 | 275 | else if (e.key === "/") ask(); |
| 277 | else if (e.key === "p") pause(); | |
| 278 | else if (e.key === NOT_NOW) rank({ to: "not_now" }); | |
| 276 | else if (e.key === keyOf("pausePlanner")) pause(); | |
| 277 | else if (e.key === keyOf("park")) rank({ to: "not_now" }); | |
| 279 | 278 | else return false; |
| 280 | 279 | return true; |
| 281 | 280 | }, |
src/web/keymap.ts +2 −7
| @@ -65,13 +65,8 @@ export const VERBS = { | ||
| 65 | 65 | approve: { key: "a", label: "Approve", what: "Approve it", kinds: ["pull"] }, |
| 66 | 66 | assign: { key: "a", label: "Assign", what: "Give it to someone", kinds: ["issue"] }, |
| 67 | 67 | sharpen: { key: "e", label: "Sharpen", what: "Have the planner plan it again", kinds: ["issue"] }, |
| 68 | park: { | |
| 69 | key: "p", | |
| 70 | label: "Park", | |
| 71 | what: "Park it behind the Later gate", | |
| 72 | kinds: ["issue", "rank"], | |
| 73 | terminal: { key: "l", reason: "the terminal's Next up screen pauses the planner on p for the repository's owner, a key that screen has had since before the map" }, | |
| 74 | }, | |
| 68 | park: { key: "p", label: "Park", what: "Park it behind the Later gate", kinds: ["issue", "rank"] }, | |
| 69 | pausePlanner: { key: "P", label: "Pause the planner", what: "Pause the planner, or turn it on again", kinds: ["rank"] }, | |
| 75 | 70 | top: { key: "T", label: "Top", what: "Move it to the top of the list", kinds: ["rank"] }, |
| 76 | 71 | raise: { key: "K", label: "Up", what: "Move it one place up (Alt+↑ too)", kinds: ["rank"] }, |
| 77 | 72 | lower: { key: "J", label: "Down", what: "Move it one place down (Alt+↓ too)", kinds: ["rank"] }, |
src/web/pages/system.ts +3 −3
| @@ -71,7 +71,7 @@ import { streamLag } from "../../snapshot/stream.ts"; | ||
| 71 | 71 | import { streamSentences, type StreamSentence } from "../../snapshot/stream_words.ts"; |
| 72 | 72 | import { stalePullsSection } from "./maintenance.ts"; |
| 73 | 73 | import { shapeWords } from "../../engine/mode.ts"; |
| 74 | import { badge, btn, chartBox, disclosure, meter, pill, row, time } from "../ui.ts"; | |
| 74 | import { badge, btn, chartBox, disclosure, meter, pill, row, time, hintAttr } from "../ui.ts"; | |
| 75 | 75 | import { EMPTY_WORDS, emptyLine, emptyList } from "../empty_words.ts"; |
| 76 | 76 | import { LARGEST_DIRS, largestDirs, type LargestDirs } from "../../system/largest_dirs.ts"; |
| 77 | 77 | import { DB_FILE_CAP, DB_GROWTH_MAX, TOP, dbSize, dbSizeNeed, type DbSize } from "../../system/db_size.ts"; |
| @@ -830,8 +830,8 @@ export async function systemPage(ctx: Ctx, patterns: () => readonly string[]): P | ||
| 830 | 830 | ${largestDirsSection(largestUnder)} |
| 831 | 831 | ${dbSizeSection(dbNow)} |
| 832 | 832 | <section class="settings-block"><h2>Processes</h2> |
| 833 | <div class="js-only small muted">Sort by <button class="btn" data-size="sm" type="button" data-sort="cpu" aria-pressed="true">CPU</button> | |
| 834 | <button class="btn" data-size="sm" type="button" data-sort="mem" aria-pressed="false">memory</button> <kbd>${keyOf("sort")}</kbd> toggles</div> | |
| 833 | <div class="js-only small muted">Sort by <button class="btn" data-size="sm" type="button" data-sort="cpu" aria-pressed="true" ${hintAttr(keyOf("sort"), "Sort by CPU")}>CPU</button> | |
| 834 | <button class="btn" data-size="sm" type="button" data-sort="mem" aria-pressed="false" ${hintAttr(keyOf("sort"), "Sort by memory")}>memory</button> <kbd>${keyOf("sort")}</kbd> toggles</div> | |
| 835 | 835 | <div id="sys-procs" data-live-hold>${at("sys-procs")}</div></section> |
| 836 | 836 | ${routeUseSection(timePhase(ctx.request, "routes", () => { |
| 837 | 837 | return leastUsed(routeUsage(ctx.app.db, patterns(), new Date())); |
test/keymap.test.ts +3 −2
| @@ -140,8 +140,9 @@ test("the shell says where a moved key went, and a quick second key still finds | ||
| 140 | 140 | |
| 141 | 141 | test("both doors share one meaning per key: R refreshes a terminal screen, / filters or searches, r queues a run again", () => { |
| 142 | 142 | expect([keyOf("reread"), keyOf("search"), keyOf("requeue"), keyOf("stop"), keyOf("wheel")]).toEqual(["R", "/", "r", "s", "i"]); |
| 143 | // The only terminal key that differs is listed with why: not now on the Next up screen. | |
| 144 | expect((Object.entries(KEYMAP) as [string, KeyDef][]).filter(([, d]) => d.terminal !== undefined).map(([id]) => id)).toEqual(["park"]); | |
| 143 | // No terminal key differs from the web's: Next up's not now is p too, and its planner pause is P. | |
| 144 | expect((Object.entries(KEYMAP) as [string, KeyDef][]).filter(([, d]) => d.terminal !== undefined).map(([id]) => id)).toEqual([]); | |
| 145 | expect([keyOf("park"), keyOf("pausePlanner")]).toEqual(["p", "P"]); | |
| 145 | 146 | expect(oldKeys("terminal", new Date(Date.parse(OLD_KEYS_UNTIL) - 1))).toEqual([{ was: "r", key: "R", says: "R is refresh now" }]); |
| 146 | 147 | }); |
| 147 | 148 |
test/system-btop.test.ts +6
| @@ -4,6 +4,8 @@ | ||
| 4 | 4 | * crew / app, all from one seeded sample. |
| 5 | 5 | */ |
| 6 | 6 | import { describe, expect, test } from "bun:test"; |
| 7 | import { keyOf } from "../src/web/keymap.ts"; | |
| 8 | import { hintAttr } from "../src/web/ui.ts"; | |
| 7 | 9 | import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs"; |
| 8 | 10 | import { tmpdir } from "node:os"; |
| 9 | 11 | import { join } from "node:path"; |
| @@ -134,6 +136,10 @@ describe("/system as btop", () => { | ||
| 134 | 136 | expect(r["mem"]).toContain('aria-label="swap 512 MiB / 1.0 GiB"'); |
| 135 | 137 | const page = await Bun.file("src/web/pages/system.ts").text(); |
| 136 | 138 | expect(page).toMatch(/class="js-only[^"]*">Sort by[\s\S]*data-sort="mem"/); |
| 139 | // Each sort button carries its key, so S is found without reading the text beside it. | |
| 140 | expect(page).toContain('data-sort="cpu" aria-pressed="true" ${hintAttr(keyOf("sort"), "Sort by CPU")}'); | |
| 141 | expect(page).toContain('data-sort="mem" aria-pressed="false" ${hintAttr(keyOf("sort"), "Sort by memory")}'); | |
| 142 | expect(hintAttr(keyOf("sort"), "Sort by CPU").text).toBe('data-hint="Sort by CPU · S" aria-keyshortcuts="S"'); | |
| 137 | 143 | }); |
| 138 | 144 | |
| 139 | 145 | test("the sort puts kinds in order and the biggest first by CPU or memory, ties staying put", () => { |
test/tui-next-growth.test.ts +3 −3
| @@ -73,10 +73,10 @@ test("the owner sees the line, pauses with p, and switches on with p again", asy | ||
| 73 | 73 | await h.toNext(); |
| 74 | 74 | expect(h.text()).toContain("This week: 2 issues opened (2 by owner), 0 closed. 2 open (2 issues, 0 pulls). The planner is on."); |
| 75 | 75 | expect(h.text()).toContain("pause planner"); |
| 76 | await h.press("p"); | |
| 76 | await h.press("P"); | |
| 77 | 77 | expect(pausedUntil(forge.db, repo.id, new Date())).not.toBeNull(); |
| 78 | 78 | expect(h.text()).toContain("The planner is paused until you switch it on."); |
| 79 | await h.press("p"); | |
| 79 | await h.press("P"); | |
| 80 | 80 | expect(pausedUntil(forge.db, repo.id, new Date())).toBeNull(); |
| 81 | 81 | expect(h.text()).toContain("The planner is on."); |
| 82 | 82 | h.stop(); |
| @@ -87,7 +87,7 @@ test("a reader sees the line and p does nothing", async () => { | ||
| 87 | 87 | await h.toNext(); |
| 88 | 88 | expect(h.text()).toContain("This week: 2 issues opened"); |
| 89 | 89 | expect(h.text()).not.toContain("pause planner"); |
| 90 | await h.press("p"); | |
| 90 | await h.press("P"); | |
| 91 | 91 | expect(pausedUntil(forge.db, repo.id, new Date())).toBeNull(); |
| 92 | 92 | h.stop(); |
| 93 | 93 | }); |
test/tui-next-up.test.ts +2 −2
| @@ -127,7 +127,7 @@ describe("next up in the terminal", () => { | ||
| 127 | 127 | |
| 128 | 128 | // Not now puts the row behind the Later gate. |
| 129 | 129 | const first = order()[0]!; |
| 130 | await h.press("l"); | |
| 130 | await h.press("p"); | |
| 131 | 131 | expect(order()).not.toContain(first); |
| 132 | 132 | expect(nextUp(forge.db, repo).notNow.map((r) => r.issue.number)).toContain(first); |
| 133 | 133 | |
| @@ -189,7 +189,7 @@ describe("next up in the terminal", () => { | ||
| 189 | 189 | await h.toNext("alice/plan"); |
| 190 | 190 | expect(h.text()).toContain("you can read this order, not change it"); |
| 191 | 191 | const before = order(); |
| 192 | await h.press("j", "T", "l", "J"); | |
| 192 | await h.press("j", "T", "p", "J"); | |
| 193 | 193 | expect(order()).toEqual(before); |
| 194 | 194 | h.stop(); |
| 195 | 195 | }); |
new above
offline