Public: anyone can read this; the crew can change it.

One keymap (c): runs, issues, files and the whole terminal answer the map's keys, one meaning per key at both doors #17012

opened this

Merged 47h 27m ago, live in production

keymap-c → main 0 commits

  • Merged. keymap-c was merged into main as 6de23f3.

Review

Sign in to review this change.
54 files changed +387 −199
docs/features/keymap.md +3 −2
@@ -11,12 +11,13 @@ The owner, after the bridge: "tying together all the keybinds is really what im
1111 - **Verbs, one meaning per kind of thing:** a pull: `m` merge (asks for a second `m`), `x` close, `b` send back, `u` update, `a` approve. An issue: `a` assign, `e` sharpen, `p` park, `x` close. A run: `s` stop, `r` queue it again, `w` watch, `i` take the wheel. A figure: `-` / `+` turn it, Enter sets it. `z` undoes, `x` dismisses a card.
1212 - **Never while typing:** in a box every key is the box's; Escape leaves it.
1313 - **One source:** pages take a key with `keyOf(id)`, the bridge's script is handed the verbs from the map, `?` and Cmd/Ctrl K list what a page carries, and the shell's own keys are held to the map's moves. `test/keymap.test.ts` refuses a key literal outside the map, one key with two meanings on one kind of thing, and a key that fires while typing; the files not yet moved are listed there with the pull that moves them.
14 - **In the terminal** (`src/tui`) the same acts are meant to answer the same keys. Where the terminal still answers another key, the map says which and why (the run list's `x` stop, `a` queue again and `S` steer, which move with the runs pull).
14 - **In the terminal** (`src/tui`) the same keys mean the same things, read from the same map: the run list stops on `s`, queues again on `r` and takes the wheel on `i`, and so do the run cards on the issue and pull screens; `R` reads every terminal screen again (the map's `reread`; a page on the web is live and needs none) and `/` filters or searches a list, the state filter included. Screens that had `R` for something else moved it: a pull's review is `b`, the dashboard's redirect `G`, a workspace's decisions-by `A`, a Talk build's restore `U`. For two weeks `r` on a screen that reads again on `R` says "R is refresh now", and the run list's old `x`, `S` and `a` say theirs. Where `r` is a screen's own verb on a different kind of thing (rename a branch or a chat, raise a limb, restore a forge, run a schedule now, and the rest), the screen is listed with what `r` does in `test/keymap-terminal.test.ts`, which also fails if any terminal screen binds `r` to a refresh again.
15 - **Runs, issues and files on the web:** a run's Stop (or Cancel run) is `s` and `i` puts the caret in its steer box; on an issue `a` puts it on Assign to (a pull's `a` is approve, on its Files page); a repository's Go to file is `f`, and `t` there says so for two weeks, since `t` is Tell the crew everywhere.
1516
1617 - **Keys that moved** say where they went for two weeks, until 2026-12-15 (`OLD_KEYS` in the map), then the hints are gone: /review's `c` and `r` are now `x` (close) and `b` (send back), and a pull's verdicts `v a`, `v r`, `v c` are now `a` (approve), `b` (send back) and `c` (comment, the page's write key). Pressing the old key shows one line at the top of the page, "x is close now".
1718 - **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`.
1819 - **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).
1920
20 Coming, one pull each: issues and runs (and the terminal's run list, where `x`, `a` and `S` become `s`, `r` and `i`); /boards, /flow and Talk.
21 Coming: /boards, /flow and Talk, and the pages that still bind their own keys (/next's `t` `u` `d` `l`, the space's `n`, /system's `c` and `m`), listed in the test with that pull.
2122
2223 Proof: `test/keymap.test.ts`, `test/bridge.test.ts`.
docs/features/talk.md +2 −2
@@ -61,7 +61,7 @@ A person has any number. `/talk` is their latest, with the list above it (newest
6161 - **Cap:** a person holds at most 100 conversations, archived ones counted; past it New is refused (page flash, API 409 `too_many`, MCP `too_many`). Stop ends every reply the person has running, in any conversation.
6262 - **API:** `GET /api/v1/conversations[?archived=1]`, `POST /api/v1/conversations {title?}`, `PATCH /api/v1/conversations/:id {title?, archived?}`; `conversation` on `POST …/messages` and `GET …/turns?conversation=` picks one.
6363 - **MCP:** `say` with `action` list | new | rename | archive | restore, and `conversation` to speak in one.
64 - **Terminal:** Palette → Conversations: `n` new, `r` rename, `x` archive or restore, `a` the archived list, Enter opens one (its last 50 turns; `s` says something in it, `r` reloads); the same calls, so the web list and stream read what it writes.
64 - **Terminal:** Palette → Conversations: `n` new, `r` rename, `x` archive or restore, `a` the archived list, Enter opens one (its last 50 turns; `s` says something in it, `R` reloads); the same calls, so the web list and stream read what it writes.
6565 - **Pin (#14564):** Pin and Unpin on the open conversation (`POST /talk/:id/pin`, owner only, same-origin) keep it at the top of the list under a quiet *Pinned* heading, newest activity first among the pinned. Archiving clears the pin and an archived conversation cannot be pinned. Terminal: `p` in Conversations.
6666 - Sending to an archived conversation keeps it archived; the page says so above the composer.
6767
@@ -184,7 +184,7 @@ An empty conversation offers Build an app among its starters (#15734); it opens
184184 - **Publish** merges the pull to the default branch, which deploys production; the production URL then shows as a link. Only a person publishes.
185185 - **API:** `POST /api/v1/builds {prompt, template?}`, `GET /api/v1/conversations/:id/build`, `GET …/build/versions/:n/diff`, `POST …/build/restore {version}`, `POST …/build/publish`. Web forms: `POST /talk/build`, `/talk/:id/build/restore`, `/talk/:id/build/publish`.
186186 - **Limits:** five builds an hour and ten unpublished at once, per person (`BUILDS_PER_HOUR`, `UNPUBLISHED_MAX`); a template must be one on offer to that person, on the API as on the page; a start that fails takes back the repository and conversation it made.
187 - **Terminal:** `:` then **Build an app**. `n` says what to build (`t` chooses the template), Enter opens a build and lists its versions newest first, Enter again shows the files that version changed, `R` restores the chosen version, `P` publishes, `r` reloads. The screen calls the same `actions/build.ts` functions as the page, so it is gated the same way (your own conversation, a writer of the repository) and what it does is what the page shows on its next read.
187 - **Terminal:** `:` then **Build an app**. `n` says what to build (`t` chooses the template), Enter opens a build and lists its versions newest first, Enter again shows the files that version changed, `U` restores the chosen version, `P` publishes, `R` reloads. The screen calls the same `actions/build.ts` functions as the page, so it is gated the same way (your own conversation, a writer of the repository) and what it does is what the page shows on its next read.
188188 - Proof: `test/talk-build.test.ts` runs prompt, repository, v1, v2, restore v1 and publish against a scratch forge; `test/tui-talk-build.test.ts` does the same from the terminal.
189189
190190 ## Your accounts elsewhere (`origins`)
src/tui/app/app.ts +8
@@ -11,6 +11,7 @@
1111 */
1212
1313 import { defect } from "../../kernel/error.ts";
14 import { oldKeys } from "../../web/keymap.ts";
1415 import { MOUSE_OFF, MOUSE_ON } from "../term/ansi.ts";
1516 import type { InputEvent, KeyEvent, MouseEvent } from "../term/input.ts";
1617 import { InputDecoder } from "../term/input.ts";
@@ -847,6 +848,13 @@ export class App {
847848 // meant an editor with no undo key.
848849 if (e.ctrl && e.key === "z") return;
849850
851 // A key that moved in the forge's one keymap (web/keymap.ts) says where it went, for two weeks,
852 // on a screen where the new key works: r on a screen that refreshes on R.
853 if (!e.ctrl && !e.alt) {
854 const moved = oldKeys("terminal").find((o) => o.was === e.key);
855 if (moved !== undefined && this.top().screen.keys.some((b) => b.keys.includes(moved.key))) return this.toast(moved.says);
856 }
857
850858 const hit = find(this.globals, e);
851859 switch (hit?.help) {
852860 case "help":
src/tui/local/repos.ts +3 −2
@@ -10,6 +10,7 @@
1010 */
1111
1212 import { err, ok } from "../../kernel/result.ts";
13 import { keyOf } from "../../web/keymap.ts";
1314 import * as git from "../../git/local.ts";
1415 import type { Ctx, Screen } from "../app/app.ts";
1516 import { binding, type Binding } from "../app/keys.ts";
@@ -91,7 +92,7 @@ export function reposScreen(local: Local, ctx: Ctx): Screen {
9192 binding(["p"], local.api === null ? "pin (sign in)" : "pin / unpin", {
9293 disabled: !has || local.api === null,
9394 }),
94 binding(["r"], "refresh"),
95 binding([keyOf("reread")], "refresh"),
9596 binding(["/"], "filter"),
9697 binding(["j", "k"], "move"),
9798 ];
@@ -147,7 +148,7 @@ export function reposScreen(local: Local, ctx: Ctx): Screen {
147148 ctx.push(workScreen(local, ctx, entry.repo));
148149 return true;
149150 }
150 if (e.key === "r") {
151 if (e.key === keyOf("reread")) {
151152 task.run("refresh", async () => ok(), reload);
152153 return true;
153154 }
src/tui/screens/answers.ts +3 −2
@@ -8,6 +8,7 @@
88 */
99
1010 import { answersFor, canSeeAnswers } from "../../web/studio/answers.ts";
11 import { keyOf } from "../../web/keymap.ts";
1112 import { CREW_WORKING } from "../../actions/ask_state_words.ts";
1213 import { tell } from "../../actions/tell.ts";
1314 import { SAY_SOMETHING_WORDS } from "../../actions/tell_words.ts";
@@ -81,7 +82,7 @@ export function answersScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
8182 };
8283 const screen: Screen = {
8384 title: "Your tells",
84 keys: [binding(["j", "k"], "move"), binding(["enter"], "open"), binding(["t"], "tell"), binding(["r"], "refresh")],
85 keys: [binding(["j", "k"], "move"), binding(["enter"], "open"), binding(["t"], "tell"), binding([keyOf("reread")], "refresh")],
8586 load: async () => read(),
8687 render(area, s) {
8788 const c = ctx.theme.c;
@@ -113,7 +114,7 @@ export function answersScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
113114 more();
114115 return true;
115116 }
116 if (e.key === "r") {
117 if (e.key === keyOf("reread")) {
117118 read();
118119 ctx.invalidate();
119120 return true;
src/tui/screens/app_changes.ts +3 −2
@@ -7,6 +7,7 @@
77 */
88
99 import { appendChange, readChanges, type ChangesRead } from "../../actions/app_changes.ts";
10 import { keyOf } from "../../web/keymap.ts";
1011 import { isRoom } from "../../apps/changes.ts";
1112 import { getAppByRepo } from "../../core/apps.ts";
1213 import type { Repo } from "../../core/repos.ts";
@@ -69,7 +70,7 @@ export function changesScreen(f: Session, ctx: Ctx, repo: Repo, firstRoom: strin
6970 return [
7071 binding(["a"], "append"),
7172 binding(["o"], "other room"),
72 binding(["r"], "read again"),
73 binding([keyOf("reread")], "read again"),
7374 binding(["j", "k"], "move cursor"),
7475 ];
7576 },
@@ -83,7 +84,7 @@ export function changesScreen(f: Session, ctx: Ctx, repo: Repo, firstRoom: strin
8384 key(e) {
8485 if (state.key(e, got?.changes.length ?? 0)) return true;
8586 if (e.ctrl || e.alt) return false;
86 if (e.key === "r") {
87 if (e.key === keyOf("reread")) {
8788 load();
8889 return true;
8990 }
src/tui/screens/boards.ts +3 −2
@@ -15,6 +15,7 @@
1515 */
1616
1717 import { formatValue } from "../../boards/chart.ts";
18 import { keyOf } from "../../web/keymap.ts";
1819 import { watchBoard, type Frame } from "../../boards/live_hub.ts";
1920 import { panelData, type PanelData } from "../../boards/panel_data.ts";
2021 import { RANGES, type Board } from "../../boards/store.ts";
@@ -345,7 +346,7 @@ export function boardsScreen(f: Session, ctx: Ctx): Screen {
345346 return [
346347 binding(["j", "k"], "move"), binding(["enter"], "open"), binding(["n"], "new"), binding(["c"], "copy"),
347348 ...(mayEdit ? [binding(["e"], "rename"), binding(["g"], "range")] : []),
348 binding(["D"], "delete"), binding(["r"], "refresh"),
349 binding(["D"], "delete"), binding([keyOf("reread")], "refresh"),
349350 ];
350351 },
351352 load: read,
@@ -393,7 +394,7 @@ export function boardsScreen(f: Session, ctx: Ctx): Screen {
393394 else asking = row;
394395 return true;
395396 }
396 if (e.key === "r") {
397 if (e.key === keyOf("reread")) {
397398 runAsync(ctx, async () => {
398399 await read();
399400 ctx.invalidate();
src/tui/screens/captain.ts +3 −2
@@ -10,6 +10,7 @@
1010 */
1111
1212 import { runRoutine } from "../../crew/routines.ts";
13 import { keyOf } from "../../web/keymap.ts";
1314 import { costLine, dayCost } from "../../crew/captain_cost.ts";
1415 import { addMemory, editMemory, MEMORY_TEXT_MAX, MEMORY_WORDS, removeMemory, rulesOf, type Memory } from "../../core/talk_memory.ts";
1516 import { EVERY_MAX, EVERY_MIN, listRoutines, ROUTINE_NAMES, setRoutine, type Routine } from "../../core/talk_routines.ts";
@@ -78,7 +79,7 @@ export function captainScreen(f: Session, ctx: Ctx): Screen {
7879 };
7980 const screen: Screen = {
8081 title: "Captain",
81 keys: [binding(["j", "k"], "move"), binding(["a"], "add a rule"), binding(["enter"], "edit"), binding(["d"], "delete"), binding(["space"], "on/off"), binding(["p"], "post now / pause a watch"), binding(["w"], "add a watch"), binding(["e"], "end a watch now"), binding(["esc", "q"], "close")],
82 keys: [binding(["j", "k"], "move"), binding(["a"], "add a rule"), binding(["enter"], "edit"), binding(["d"], "delete"), binding(["space"], "on/off"), binding(["p"], "post now / pause a watch"), binding(["w"], "add a watch"), binding(["e"], "end a watch now"), binding([keyOf("reread")], "refresh"), binding(["esc", "q"], "close")],
8283 load: read,
8384 render(area, s) {
8485 drawList(s, area, ctx.theme.c, state, captainRows(lines));
@@ -147,7 +148,7 @@ export function captainScreen(f: Session, ctx: Ctx): Screen {
147148 ctx.toast(posted.posted ? `${ROUTINE_NAMES[kind]} posted to your Captain thread in Talk.` : `${ROUTINE_NAMES[kind]}: nothing new since the last post.`, "success");
148149 await read();
149150 });
150 } else if (e.key === "r") refresh();
151 } else if (e.key === keyOf("reread")) refresh();
151152 else state.key(e, lines.length);
152153 return true;
153154 },
src/tui/screens/cockpit.ts +3 −2
@@ -8,6 +8,7 @@
88 */
99
1010 import { actOnProposal } from "../../actions/proposals.ts";
11 import { keyOf } from "../../web/keymap.ts";
1112 import { decideAsk } from "../../actions/asks_decide.ts";
1213 import { cockpitFor, type Cockpit, type CockpitAction } from "../../web/studio/cockpit.ts";
1314 import type { Ctx, Screen } from "../app/app.ts";
@@ -70,7 +71,7 @@ export function cockpitScreen(f: Session, ctx: Ctx): Screen {
7071 };
7172 return {
7273 title: "Cockpit",
73 keys: [binding(["j", "k"], "move"), binding(["enter"], "do"), binding(["l"], "later"), binding(["o"], "web"), binding(["r"], "refresh")],
74 keys: [binding(["j", "k"], "move"), binding(["enter"], "do"), binding(["l"], "later"), binding(["o"], "web"), binding([keyOf("reread")], "refresh")],
7475 load: async () => read(),
7576 render(area, s) {
7677 const c = ctx.theme.c;
@@ -96,7 +97,7 @@ export function cockpitScreen(f: Session, ctx: Ctx): Screen {
9697 }
9798 return true;
9899 }
99 if (e.key === "r") {
100 if (e.key === keyOf("reread")) {
100101 read();
101102 ctx.invalidate();
102103 return true;
src/tui/screens/commits.ts +3 −2
@@ -7,6 +7,7 @@
77 */
88
99 import { OFFER_COMMIT_WORDS, offerCommit } from "../../actions/offer_commit.ts";
10 import { keyOf } from "../../web/keymap.ts";
1011 import { checkOfCommit, verdictsOfCommits } from "../../actions/runs.ts";
1112 import type { CommitCheck } from "../../checks/commit_check.ts";
1213 import type { FileDiff } from "../../git/diff.ts";
@@ -116,7 +117,7 @@ export function commitsScreen(
116117 binding(["j", "k"], "move"),
117118 binding(["enter"], "open"),
118119 binding(["b"], "ref"),
119 binding(["r"], "refresh"),
120 binding([keyOf("reread")], "refresh"),
120121 ],
121122 load: page,
122123 render(area, s) {
@@ -167,7 +168,7 @@ export function commitsScreen(
167168 );
168169 return true;
169170 }
170 if (e.key === "r") {
171 if (e.key === keyOf("reread")) {
171172 commits = [];
172173 marks.clear();
173174 cursor = undefined;
src/tui/screens/crewhandover.ts +3 −2
@@ -7,6 +7,7 @@
77 */
88
99 import { tryAgain } from "../../actions/try_again.ts";
10 import { keyOf } from "../../web/keymap.ts";
1011 import { getRepo } from "../../core/repos.ts";
1112 import { crewHandover } from "../../crew/handed.ts";
1213 import type { Ctx, Screen } from "../app/app.ts";
@@ -70,7 +71,7 @@ export function crewHandoverScreen(f: Session, ctx: Ctx): Screen {
7071 binding(["j", "k"], "move cursor"),
7172 binding(["enter"], "open"),
7273 binding(["t"], "try the issue again"),
73 binding(["r"], "refresh"),
74 binding([keyOf("reread")], "refresh"),
7475 ],
7576 render(area, s) {
7677 const c = ctx.theme.c;
@@ -93,7 +94,7 @@ export function crewHandoverScreen(f: Session, ctx: Ctx): Screen {
9394 retry();
9495 return true;
9596 }
96 if (e.key === "r") {
97 if (e.key === keyOf("reread")) {
9798 read();
9899 rows = build();
99100 state.clamp(rows.length);
src/tui/screens/dashboard.ts +5 −4
@@ -15,6 +15,7 @@
1515 */
1616
1717 import { readyAsk } from "../../spawn/template_record.ts";
18 import { keyOf } from "../../web/keymap.ts";
1819 import { DEFAULT_WEIGHTS, frontWeights, type FrontWeights } from "../../core/front.ts";
1920 import { quietSince, exploreCount, exploreFiltered, exploreLine, isExploreLine, exploreNote, exploreSuggestion, explorePage, groupForks, parseExploreQuery, readExploreLine, whyOf, figuresOf, peopleWords, PEOPLE_ORDER_WORDS, type ExploreRow } from "../../actions/explore.ts";
2021 import { protectionNotice } from "../../kernel/protection.ts";
@@ -1253,7 +1254,7 @@ export function dashboardScreen(f: Session, ctx: Ctx): Screen {
12531254 ? [binding(["b"], "give back to the crew")]
12541255 : []),
12551256 ...(focus === "onyou" && waveHere() !== undefined
1256 ? [binding(["y"], "approve wave"), binding(["R"], "redirect"), binding(["l"], "later")]
1257 ? [binding(["y"], "approve wave"), binding(["G"], "redirect"), binding(["l"], "later")]
12571258 : []),
12581259 ...(asideWaves.length > 0 ? [binding(["B"], "bring waves back")] : []),
12591260 ...(lastHand !== undefined ? [binding(["U"], "undo decider")] : []),
@@ -1297,7 +1298,7 @@ export function dashboardScreen(f: Session, ctx: Ctx): Screen {
12971298 ...(focus === "repos" && f.user !== undefined && shown().some(mayArchive)
12981299 ? [binding(["space"], "mark"), ...(markedRepos.size > 0 ? [binding(["a"], "archive marked")] : [])]
12991300 : []),
1300 binding(["r"], "refresh"),
1301 binding([keyOf("reread")], "refresh"),
13011302 ];
13021303 },
13031304 load(signal) {
@@ -1510,7 +1511,7 @@ export function dashboardScreen(f: Session, ctx: Ctx): Screen {
15101511 if (e.key === "h") return hideAuthor(), true;
15111512 if (e.key === "H" && item !== undefined) return hideAppForADay(), true;
15121513 if (e.key === "y") return actOnWave("approve"), true;
1513 if (e.key === "R") return redirectWave(), true;
1514 if (e.key === "G") return redirectWave(), true;
15141515 if (e.key === "l") return actOnWave("later"), true;
15151516 }
15161517 if (e.key === "B" && f.user && asideWaves.length > 0) return bringBackWaves(), true;
@@ -1641,7 +1642,7 @@ export function dashboardScreen(f: Session, ctx: Ctx): Screen {
16411642 ctx.push(signInScreen(f, ctx, reload));
16421643 return true;
16431644 }
1644 if (e.key === "r") {
1645 if (e.key === keyOf("reread")) {
16451646 runAsync(ctx, async () => reload());
16461647 return true;
16471648 }
src/tui/screens/decider.ts +3 −2
@@ -6,6 +6,7 @@
66 */
77
88 import type { Database } from "bun:sqlite";
9 import { keyOf } from "../../web/keymap.ts";
910 import { returnsRepos } from "../../actions/returns.ts";
1011 import { startOfTodayUtc } from "../../crew/autonomy_spend.ts";
1112 import {
@@ -116,7 +117,7 @@ export function deciderScreen(f: Session, ctx: Ctx, first: DeciderPile = "closed
116117 binding(["1", "2", "3"], "closed · deferred · asked"),
117118 binding(["j", "k"], "move"),
118119 binding(["enter"], "open"),
119 binding(["r"], "refresh"),
120 binding([keyOf("reread")], "refresh"),
120121 ],
121122 load: async () => read(),
122123 render(area, s) {
@@ -137,7 +138,7 @@ export function deciderScreen(f: Session, ctx: Ctx, first: DeciderPile = "closed
137138 if (Number.isInteger(i) && i >= 0 && i < DECIDER_PILES.length) return pick(DECIDER_PILES[i]!), true;
138139 if (state.key(e, rows.length)) return true;
139140 if (e.key === "enter") return open(state.index), true;
140 if (e.key === "r") return read(), ctx.invalidate(), true;
141 if (e.key === keyOf("reread")) return read(), ctx.invalidate(), true;
141142 return false;
142143 },
143144 };
src/tui/screens/deploys.ts +7 −6
@@ -65,6 +65,7 @@
6565 */
6666
6767 import { appOnboardingLine } from "../../apps/onboarding.ts";
68 import { keyOf } from "../../web/keymap.ts";
6869 import {
6970 appPace,
7071 appPreviews,
@@ -417,7 +418,7 @@ export function deploysScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
417418 return [
418419 binding(["j", "k"], "move"),
419420 binding(["enter"], inPreviews ? "open the pull" : "open the log"),
420 binding(["r"], "refresh (the open pulls below the deploys: check, preview)"),
421 binding([keyOf("reread")], "refresh (the open pulls below the deploys: check, preview)"),
421422 ...(inPreviews
422423 ? [
423424 ...(preview !== undefined ? [binding(["D"], "redeploy preview")] : []),
@@ -565,7 +566,7 @@ export function deploysScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
565566 if (run !== undefined) open(run);
566567 return true;
567568 }
568 if (e.key === "r") {
569 if (e.key === keyOf("reread")) {
569570 read();
570571 return true;
571572 }
@@ -704,7 +705,7 @@ function probeScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
704705 };
705706 return {
706707 title: "Probe",
707 keys: [binding(["j", "k"], "move"), binding(["r"], "knock again"), binding(["esc"], "back")],
708 keys: [binding(["j", "k"], "move"), binding([keyOf("reread")], "knock again"), binding(["esc"], "back")],
708709 load: async () => run(),
709710 render(area, s) {
710711 const c = ctx.theme.c;
@@ -736,7 +737,7 @@ function probeScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
736737 hitList(ctx, body!, state, list.length, {});
737738 },
738739 key(e) {
739 if (e.key === "r") {
740 if (e.key === keyOf("reread")) {
740741 if (probing.kind !== "reading") void ctx.track(run());
741742 return true;
742743 }
@@ -954,7 +955,7 @@ export function domainsScreen(f: Session, ctx: Ctx, repo: Repo, changed: () => v
954955 binding(["v"], "put old records back"),
955956 ]
956957 : []),
957 binding(["r"], "refresh"),
958 binding([keyOf("reread")], "refresh"),
958959 binding(["esc"], "back"),
959960 ];
960961 },
@@ -1021,7 +1022,7 @@ export function domainsScreen(f: Session, ctx: Ctx, repo: Repo, changed: () => v
10211022 revert(selected);
10221023 return true;
10231024 }
1024 if (e.key === "r") {
1025 if (e.key === keyOf("reread")) {
10251026 read();
10261027 return true;
10271028 }
src/tui/screens/drift.ts +3 −2
@@ -8,6 +8,7 @@
88 */
99
1010 import { bringUpToDate } from "../../crew/conflict_release.ts";
11 import { keyOf } from "../../web/keymap.ts";
1112 import { driftingPulls, readDrifts, type DriftingPull } from "../../flow/alarm_drift.ts";
1213 import { getPull } from "../../core/pulls.ts";
1314 import { mayView } from "../../core/sealed.ts";
@@ -56,7 +57,7 @@ export function driftScreen(f: Session, ctx: Ctx): Screen {
5657 };
5758 return {
5859 title: "Drifting from main",
59 keys: [binding(["j", "k"], "move"), binding(["b", "enter"], "bring up to date"), binding(["r"], "read again"), binding(["esc", "q"], "close")],
60 keys: [binding(["j", "k"], "move"), binding(["b", "enter"], "bring up to date"), binding([keyOf("reread")], "read again"), binding(["esc", "q"], "close")],
6061 load: read,
6162 render(area, s) {
6263 if (loaded && pulls.length === 0) {
@@ -68,7 +69,7 @@ export function driftScreen(f: Session, ctx: Ctx): Screen {
6869 key(e) {
6970 if (e.key === "esc" || e.key === "q") ctx.pop();
7071 else if (e.key === "b" || e.key === "enter") ask();
71 else if (e.key === "r") runAsync(ctx, read);
72 else if (e.key === keyOf("reread")) runAsync(ctx, read);
7273 else state.key(e, pulls.length);
7374 return true;
7475 },
src/tui/screens/issue.ts +5 −4
@@ -15,6 +15,7 @@
1515 */
1616
1717 import { outsideClause } from "../../web/outside.ts";
18 import { keyOf } from "../../web/keymap.ts";
1819 import { putFlowFirst } from "../../actions/flow_first.ts";
1920 import { FLOW_LABEL } from "../../core/flow_label.ts";
2021 import {
@@ -622,7 +623,7 @@ export function issueScreen(
622623 ? binding(["enter"], "open the run")
623624 : binding(["j", "k"], "scroll"),
624625 ...(focus === "crew" && repo !== undefined && maySteer(f, repo, crew.selected)
625 ? [binding(["s"], "steer")]
626 ? [binding([keyOf("wheel")], "take the wheel")]
626627 : []),
627628 ...(mayWrite()
628629 ? [
@@ -651,7 +652,7 @@ export function issueScreen(
651652 ...(mayEdit() ? [binding(["e"], "edit")] : []),
652653 ...liveBindings(src),
653654 ]),
654 binding(["r"], "refresh"),
655 binding([keyOf("reread")], "refresh"),
655656 ];
656657 },
657658 load(signal) {
@@ -845,7 +846,7 @@ export function issueScreen(
845846 openRun();
846847 return true;
847848 }
848 if (e.key === "s") {
849 if (e.key === keyOf("wheel")) {
849850 const run = crew.selected;
850851 if (run !== undefined && repo !== undefined && maySteer(f, repo, run))
851852 steerPrompt(f, ctx, screen, repo, run, () => runAsync(ctx, reload));
@@ -959,7 +960,7 @@ export function issueScreen(
959960 privateRepo();
960961 return true;
961962 }
962 if (e.key === "r") {
963 if (e.key === keyOf("reread")) {
963964 runAsync(ctx, reload);
964965 return true;
965966 }
src/tui/screens/issues.ts +3 −2
@@ -10,6 +10,7 @@
1010 */
1111
1212 import { openIssueThrough } from "../../actions/issues.ts";
13 import { keyOf } from "../../web/keymap.ts";
1314 import type { IssueKind, Label } from "../../core/issues.ts";
1415 import { getIssuesByNumbers, numberKey } from "../../core/issues.ts";
1516 import { LATER, pillarsOf, servedBy, type Pillar } from "../../core/pillars.ts";
@@ -276,7 +277,7 @@ export function issuesScreen(
276277 ...(mayWrite() ? [binding(["c"], `new ${noun}`)] : []),
277278 ...(kind === "issue" && repo !== undefined ? [binding(["m"], "plan"), binding(["h"], "held")] : []),
278279 binding(["/"], "search"),
279 binding(["r"], "refresh"),
280 binding([keyOf("reread")], "refresh"),
280281 ];
281282 },
282283 load(signal) {
@@ -444,7 +445,7 @@ export function issuesScreen(
444445 );
445446 return true;
446447 }
447 if (e.key === "r") {
448 if (e.key === keyOf("reread")) {
448449 cursor = undefined;
449450 counted.clear();
450451 runAsync(ctx, reload);
src/tui/screens/plan.ts +3 −2
@@ -7,6 +7,7 @@
77 */
88
99 import { FIRST_FORBIDDEN, putIssueFirst } from "../../actions/first.ts";
10 import { keyOf } from "../../web/keymap.ts";
1011 import { firstMarksInRepo } from "../../core/first.ts";
1112 import { repoGraph, readyNow } from "../../core/dependencies.ts";
1213 import { pillarView } from "../../core/pillars.ts";
@@ -119,7 +120,7 @@ export function planScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
119120 };
120121 return {
121122 title: "Plan",
122 keys: [binding(["j", "k"], "move"), binding(["enter"], "open"), binding(["f"], "first"), binding(["r"], "refresh")],
123 keys: [binding(["j", "k"], "move"), binding(["enter"], "open"), binding(["f"], "first"), binding([keyOf("reread")], "refresh")],
123124 load(signal) {
124125 live(f, signal, { repoId: repo.id }, () => runAsync(ctx, async () => reload()));
125126 reload();
@@ -157,7 +158,7 @@ export function planScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
157158 }
158159 return true;
159160 }
160 if (e.key === "r") {
161 if (e.key === keyOf("reread")) {
161162 reload();
162163 return true;
163164 }
src/tui/screens/pricing.ts +11 −6
@@ -10,6 +10,7 @@
1010 */
1111
1212 import { deliverLink, mayView, NO_PROVIDER, placeOrder, reconcileOrder } from "../../actions/order.ts";
13 import { keyOf } from "../../web/keymap.ts";
1314 import { usdPerMonthWords } from "../../billing/money.ts";
1415 import { AFTER_PAYMENT_STEPS, priceLine } from "../../billing/plan_words.ts";
1516 import { receiptFacts } from "../../billing/receipt.ts";
@@ -85,7 +86,7 @@ export function pricingScreen(f: Session, ctx: Ctx): Screen {
8586 error = `${placed.error.field === "form" ? "" : `${placed.error.field}: `}${placed.error.message}`;
8687 return;
8788 }
88 stage = { kind: "placed", id: placed.value.id, ticket: placed.value.ticket, address: placed.value.redirect, name: name.trim(), says: "Open the address and pay; then press r." };
89 stage = { kind: "placed", id: placed.value.id, ticket: placed.value.ticket, address: placed.value.redirect, name: name.trim(), says: "Open the address and pay; then press R or Enter." };
8990 });
9091 };
9192
@@ -105,9 +106,9 @@ export function pricingScreen(f: Session, ctx: Ctx): Screen {
105106 error = "That order is gone. Place it again.";
106107 return;
107108 }
108 if (o.state === "pending") s.says = "Not paid yet. Open the address, pay, then press r.";
109 else if (o.state === "paid" || o.state === "spawning") s.says = `Paid. Making ${o.name}; press r again in a moment.`;
110 else if (o.state === "making") s.says = `Paid. ${o.name} is starting on its own machine, which takes a few minutes; press r again once it answers.`;
109 if (o.state === "pending") s.says = "Not paid yet. Open the address, pay, then press R or Enter.";
110 else if (o.state === "paid" || o.state === "spawning") s.says = `Paid. Making ${o.name}; press R again in a moment.`;
111 else if (o.state === "making") s.says = `Paid. ${o.name} is starting on its own machine, which takes a few minutes; press R again once it answers.`;
111112 else if (o.state === "failed") stage = { kind: "done", name: o.name, says: `Paid, but the forge could not be made: ${o.reason}. The operator has been told; keep the order id ${o.id}.` };
112113 else {
113114 const r = receiptFacts(o, getPlans(f.app.db).find((p) => p.key === o.plan)?.name);
@@ -128,7 +129,11 @@ export function pricingScreen(f: Session, ctx: Ctx): Screen {
128129
129130 return {
130131 title: "Get a forge",
131 keys: [binding(["enter"], "order"), binding(["tab"], "next field"), binding(["up", "down"], "plan"), binding(["esc"], "back")],
132 get keys() {
133 return stage.kind === "placed"
134 ? [binding(["enter", keyOf("reread")], "check the payment"), binding(["c"], "copy the address"), binding(["esc"], "back")]
135 : [binding(["enter"], "order"), binding(["tab"], "next field"), binding(["up", "down"], "plan"), binding(["esc"], "back")];
136 },
132137 render(area, s) {
133138 const c = ctx.theme.c;
134139 const w = Math.max(20, area.w);
@@ -192,7 +197,7 @@ export function pricingScreen(f: Session, ctx: Ctx): Screen {
192197 return true;
193198 }
194199 if (stage.kind === "placed") {
195 if (e.key === "r" || e.key === "enter") check();
200 if (e.key === keyOf("reread") || e.key === "enter") check();
196201 else if (e.key === "c") {
197202 ctx.copy(stage.address);
198203 ctx.toast("copied through the terminal", "success");
src/tui/screens/prompts.ts +3 −2
@@ -15,6 +15,7 @@ import {
1515 runPromptSource,
1616 type PromptSourceView,
1717 } from "../../actions/prompts.ts";
18 import { keyOf } from "../../web/keymap.ts";
1819 import { REFRESH_AFTER_DAYS } from "../../crew/prompts.ts";
1920 import type { Repo } from "../../core/repos.ts";
2021 import type { Ctx, Screen } from "../app/app.ts";
@@ -155,7 +156,7 @@ export function promptsScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
155156 binding(["j", "k"], "move"),
156157 ...(sources.length === 0 ? [binding(["a"], "connect Instagram")] : []),
157158 ...(sources.length > 0 ? [binding(["f"], "fetch now"), binding(["d"], "remove it")] : []),
158 binding(["r"], "refresh"),
159 binding([keyOf("reread")], "refresh"),
159160 binding(["esc"], "back"),
160161 ];
161162 },
@@ -188,7 +189,7 @@ export function promptsScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
188189 if (e.key === "a" && sources.length === 0) add();
189190 else if (e.key === "f" && selected !== undefined) fetchNow(selected);
190191 else if (e.key === "d" && selected !== undefined) remove(selected);
191 else if (e.key === "r") read();
192 else if (e.key === keyOf("reread")) read();
192193 else return false;
193194 return true;
194195 },
src/tui/screens/pull.ts +8 −7
@@ -27,6 +27,7 @@
2727 */
2828
2929 import { OFFER_PULL_WORDS, offerPull, previewOfferPull } from "../../actions/offer_pull.ts";
30 import { keyOf } from "../../web/keymap.ts";
3031 import { offerStatusLinkFor } from "../../core/outsider_status.ts";
3132 import { outsideClause } from "../../web/outside.ts";
3233 import { mayRetryReview, RETRY_WORDS, reviewFailedToStart } from "../../web/studio/review_start.ts";
@@ -1255,7 +1256,7 @@ export function pullScreen(
12551256 binding(["j", "k"], "move"),
12561257 binding(["enter"], "open the run"),
12571258 ...(repo !== undefined && maySteer(f, repo, crew.selected)
1258 ? [binding(["s"], "steer")]
1259 ? [binding([keyOf("wheel")], "take the wheel")]
12591260 : []),
12601261 ]
12611262 : [binding(["j", "k"], "scroll")]),
@@ -1272,7 +1273,7 @@ export function pullScreen(
12721273 ...(mayWrite()
12731274 ? [
12741275 binding(["c"], tab === 1 ? "review line" : "comment"),
1275 binding(["R"], "review"),
1276 binding(["b"], "review"),
12761277 binding(["C"], "check again"),
12771278 ...(getPull(f.db, repo!.id, number)?.authorIsAgent === false ? [binding(["K"], "ask for review")] : []),
12781279 ...(mayVote() ? [binding(["+", "-"], "like/dislike a variant")] : []),
@@ -1314,10 +1315,10 @@ export function pullScreen(
13141315 : [
13151316 ...liveBindings(src),
13161317 ...(mayJudge()
1317 ? [binding(["R"], "review"), binding(["m"], reviewWords.reviewerLands, { disabled: true })]
1318 ? [binding(["b"], "review"), binding(["m"], reviewWords.reviewerLands, { disabled: true })]
13181319 : []),
13191320 ]),
1320 binding(["r"], "refresh"),
1321 binding([keyOf("reread")], "refresh"),
13211322 ...(isApp ? [binding(["V"], "walk the review steps")] : []),
13221323 ...(isApp && mayWrite() ? [binding(["E"], "set the review steps")] : []),
13231324 ];
@@ -1553,7 +1554,7 @@ export function pullScreen(
15531554 landPast();
15541555 return true;
15551556 }
1556 if (e.key === "R" && (mayWrite() || mayJudge())) {
1557 if (e.key === "b" && (mayWrite() || mayJudge())) {
15571558 review();
15581559 return true;
15591560 }
@@ -1687,7 +1688,7 @@ export function pullScreen(
16871688 openRunLog(f, ctx, repo, run);
16881689 return true;
16891690 }
1690 if (e.key === "s") {
1691 if (e.key === keyOf("wheel")) {
16911692 const run = crew.selected;
16921693 if (run !== undefined && repo !== undefined && maySteer(f, repo, run))
16931694 steerPrompt(f, ctx, screen, repo, run, () => runAsync(ctx, reload));
@@ -1868,7 +1869,7 @@ export function pullScreen(
18681869 });
18691870 return true;
18701871 }
1871 if (e.key === "r") {
1872 if (e.key === keyOf("reread")) {
18721873 runAsync(ctx, reload);
18731874 return true;
18741875 }
src/tui/screens/refs.ts +3 −2
@@ -7,6 +7,7 @@
77 */
88
99 import { createBranchSaying, deleteBranch } from "../../actions/branches.ts";
10 import { keyOf } from "../../web/keymap.ts";
1011 import { NAME_THE_BRANCH } from "../../actions/branch_words.ts";
1112 import { listBranches } from "../../git/branches.ts";
1213 import type { RepoSource } from "../../view/source.ts";
@@ -282,7 +283,7 @@ export function branchesScreen(
282283 binding(["n"], "new branch", { disabled: !writable }),
283284 binding(["D"], "delete", { disabled: !writable }),
284285 binding(["/"], "filter"),
285 binding(["r"], "refresh"),
286 binding([keyOf("reread")], "refresh"),
286287 ];
287288 },
288289 load: reload,
@@ -379,7 +380,7 @@ export function branchesScreen(
379380 remove(row);
380381 return true;
381382 }
382 if (e.key === "r") {
383 if (e.key === keyOf("reread")) {
383384 runAsync(ctx, reload);
384385 return true;
385386 }
src/tui/screens/runlog.ts +3 −2
@@ -8,6 +8,7 @@
88 */
99
1010 import { runLog, type RunLogView } from "../../actions/runs.ts";
11 import { keyOf } from "../../web/keymap.ts";
1112 import type { Repo } from "../../core/repos.ts";
1213 import type { Ctx, Screen } from "../app/app.ts";
1314 import { binding } from "../app/keys.ts";
@@ -77,7 +78,7 @@ export function runLogScreen(
7778 binding(["pgup", "pgdn"], "page"),
7879 binding(["g", "G"], "top, end"),
7980 binding(["o"], "open on the web"),
80 binding(["r"], "refresh"),
81 binding([keyOf("reread")], "refresh"),
8182 ...(offer() ? [binding(["a"], "start now on your own account")] : []),
8283 ];
8384 },
@@ -220,7 +221,7 @@ export function runLogScreen(
220221 web();
221222 return true;
222223 }
223 if (e.key === "r" && !e.ctrl && !e.alt) {
224 if (e.key === keyOf("reread") && !e.ctrl && !e.alt) {
224225 void read();
225226 return true;
226227 }
src/tui/screens/runs.ts +20 −11
@@ -9,6 +9,7 @@
99 */
1010
1111 import { cancelRepoRun, listRepoRuns, requeueRepoRun } from "../../actions/runs.ts";
12 import { keyOf, oldKeys } from "../../web/keymap.ts";
1213 import { lacks } from "../../core/roles.ts";
1314 import { canWrite, type Repo } from "../../core/repos.ts";
1415 import { taskOf } from "../../crew/dispatch.ts";
@@ -131,13 +132,15 @@ export function runsScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
131132 here: () => ({ repo }),
132133 get keys() {
133134 return [
134 binding(["j", "k"], "move"),
135 // The forge's one keymap (web/keymap.ts): s stops, r queues again and i takes the wheel, as
136 // on the web; / filters and R refreshes, as on every terminal screen.
137 binding([keyOf("down"), keyOf("up")], "move"),
135138 binding(["enter"], "open the log"),
136 ...(cancellable() === undefined ? [] : [binding(["x"], "cancel")]),
137 ...(maySteer(f, repo, list.selected) ? [binding(["S"], "steer")] : []),
138 ...(requeueable() === undefined ? [] : [binding(["a"], "run again")]),
139 binding(["s"], "state: All, Failed, Running, Succeeded (cycle)"),
140 binding(["r"], "refresh"),
139 ...(cancellable() === undefined ? [] : [binding([keyOf("stop")], "stop")]),
140 ...(maySteer(f, repo, list.selected) ? [binding([keyOf("wheel")], "take the wheel")] : []),
141 ...(requeueable() === undefined ? [] : [binding([keyOf("requeue")], "queue it again")]),
142 binding([keyOf("search")], "state: All, Failed, Running, Succeeded (cycle)"),
143 binding([keyOf("reread")], "refresh"),
141144 ];
142145 },
143146 load: async () => read(),
@@ -171,26 +174,32 @@ export function runsScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
171174 if (run !== undefined) open(run);
172175 return true;
173176 }
174 if (e.key === "x") {
177 // A key that moved says where it went, for two weeks (keymap.ts OLD_KEYS).
178 const moved = oldKeys("runs").find((o) => o.was === e.key);
179 if (moved !== undefined) {
180 ctx.toast(moved.says);
181 return true;
182 }
183 if (e.key === keyOf("stop")) {
175184 ask();
176185 return true;
177186 }
178 if (e.key === "S") {
187 if (e.key === keyOf("wheel")) {
179188 const run = list.selected;
180189 if (run !== undefined && maySteer(f, repo, run))
181190 steerPrompt(f, ctx, self, repo, run, read);
182191 return true;
183192 }
184 if (e.key === "a") {
193 if (e.key === keyOf("requeue")) {
185194 askRequeue();
186195 return true;
187196 }
188 if (e.key === "s") {
197 if (e.key === keyOf("search")) {
189198 at = (at + 1) % RUN_STATE_CYCLE.length;
190199 read();
191200 return true;
192201 }
193 if (e.key === "r") {
202 if (e.key === keyOf("reread")) {
194203 read();
195204 return true;
196205 }
src/tui/screens/shells.ts +3 −2
@@ -7,6 +7,7 @@
77 */
88
99 import { NO_SUCH_SHELL, STOPPED_ONE, myShells, stopIdleShells, stopShell, stoppedIdleSays, type ShellRow } from "../../machines/shell.ts";
10 import { keyOf } from "../../web/keymap.ts";
1011 import type { Ctx, Screen } from "../app/app.ts";
1112 import { binding } from "../app/keys.ts";
1213 import { style } from "../term/style.ts";
@@ -29,7 +30,7 @@ export function shellsScreen(f: Session, ctx: Ctx): Screen {
2930 let sel = 0;
3031 return {
3132 title: "Your shells",
32 keys: [binding(["j", "k"], "pick"), binding(["s"], "stop"), binding(["i"], "stop all idle"), binding(["r"], "read again"), binding(["esc"], "close")],
33 keys: [binding(["j", "k"], "pick"), binding(["s"], "stop"), binding(["i"], "stop all idle"), binding([keyOf("reread")], "read again"), binding(["esc"], "close")],
3334 render(area, s) {
3435 const c = ctx.theme.c;
3536 if (rows.length === 0) {
@@ -42,7 +43,7 @@ export function shellsScreen(f: Session, ctx: Ctx): Screen {
4243 },
4344 key(e) {
4445 if (e.ctrl || e.alt) return false;
45 if (e.key === "r") {
46 if (e.key === keyOf("reread")) {
4647 rows = read();
4748 sel = Math.min(sel, Math.max(0, rows.length - 1));
4849 return true;
src/tui/screens/talk_build.ts +4 −3
@@ -7,6 +7,7 @@
77 */
88
99 import { buildSaidWords, buildState, BUILD_WORDS, publishBuild, publishedWords, restoreVersion, startBuild, versionDiff, type BuildState } from "../../actions/build.ts";
10 import { keyOf } from "../../web/keymap.ts";
1011 import { offeredTemplates } from "../../core/app_templates.ts";
1112 import { buildsOf } from "../../core/chat_build.ts";
1213 import { getRepoById } from "../../core/repos.ts";
@@ -73,7 +74,7 @@ function buildScreen(f: Session, ctx: Ctx, conversationId: string, title: string
7374 const versions = () => [...(current?.versions ?? [])].reverse();
7475 const screen: Screen = {
7576 title,
76 keys: [binding(["j", "k"], "move"), binding(["enter"], "files changed"), binding(["R"], "restore"), binding(["P"], "publish"), binding(["r"], "reload"), binding(["esc"], "back")],
77 keys: [binding(["j", "k"], "move"), binding(["enter"], "files changed"), binding(["U"], "restore"), binding(["P"], "publish"), binding([keyOf("reread")], "reload"), binding(["esc"], "back")],
7778 render(area, s) {
7879 const c = ctx.theme.c;
7980 const [head, body] = split(area, "v", [len(2), fill(1)]);
@@ -91,7 +92,7 @@ function buildScreen(f: Session, ctx: Ctx, conversationId: string, title: string
9192 ctx.pop();
9293 return true;
9394 }
94 if (e.key === "r") {
95 if (e.key === keyOf("reread")) {
9596 load();
9697 return true;
9798 }
@@ -100,7 +101,7 @@ function buildScreen(f: Session, ctx: Ctx, conversationId: string, title: string
100101 ctx.push(diffScreen(f, ctx, conversationId, at.number, at.subject));
101102 return true;
102103 }
103 if (e.key === "R" && at !== undefined && current?.published === false) {
104 if (e.key === "U" && at !== undefined && current?.published === false) {
104105 ctx.push(
105106 confirmScreen(ctx, screen, {
106107 title: "Restore",
src/tui/screens/talk_chats.ts +3 −2
@@ -10,6 +10,7 @@
1010 */
1111
1212 import { receiptsScreen } from "./receipts.ts";
13 import { keyOf } from "../../web/keymap.ts";
1314 import { conversationPlan, openSteps } from "../../core/conversation_plan.ts";
1415 import { pathRefs, refTarget } from "../../text/talk_links.ts";
1516 import { STARTER_PROMPTS, TALK_WORDS, talk } from "../../actions/talk.ts";
@@ -362,7 +363,7 @@ function chatScreen(f: Session, ctx: Ctx, chat: Conversation, hit?: string): Scr
362363 binding(["s"], "say"),
363364 binding(["m"], "model"),
364365 binding(["1", "2", "3"], "starter"),
365 binding(["r"], "reload"),
366 binding([keyOf("reread")], "reload"),
366367 binding(["p"], "pane"),
367368 binding(["o", "w", "l", "L"], "in the pane: repository, version, path, Live"),
368369 binding(["b"], "a result's buttons"),
@@ -525,7 +526,7 @@ function chatScreen(f: Session, ctx: Ctx, chat: Conversation, hit?: string): Scr
525526 ctx.pop();
526527 return true;
527528 }
528 if (e.key === "r") {
529 if (e.key === keyOf("reread")) {
529530 note = "";
530531 follow = true;
531532 around = undefined;
src/tui/screens/thoughtnotes.ts +3 −2
@@ -9,6 +9,7 @@
99 */
1010
1111 import { overruleNote } from "../../actions/note_overrule.ts";
12 import { keyOf } from "../../web/keymap.ts";
1213 import { keepThought, THOUGHT_MAX } from "../../actions/thought.ts";
1314 import { noteLine, type NotePhase } from "../../core/note_line.ts";
1415 import { thoughtStream } from "../../core/thought_stream.ts";
@@ -91,7 +92,7 @@ export function notesScreen(f: Session, ctx: Ctx): Screen {
9192 get keys() {
9293 return typing
9394 ? [binding(["enter"], "save"), binding(["esc"], "cancel")]
94 : [binding(["j", "k"], "move"), binding(["n"], "write a note"), binding(["b"], "overrule the planner"), binding(["r"], "refresh")];
95 : [binding(["j", "k"], "move"), binding(["n"], "write a note"), binding(["b"], "overrule the planner"), binding([keyOf("reread")], "refresh")];
9596 },
9697 load: async () => read(),
9798 render(area, s) {
@@ -119,7 +120,7 @@ export function notesScreen(f: Session, ctx: Ctx): Screen {
119120 if (state.key(e, rows.length)) return true;
120121 if (e.key === "n") typing = true;
121122 else if (e.key === "b") overrule();
122 else if (e.key === "r") read();
123 else if (e.key === keyOf("reread")) read();
123124 else return false;
124125 ctx.invalidate();
125126 return true;
src/tui/screens/waves.ts +3 −2
@@ -6,6 +6,7 @@
66 */
77
88 import { cutWaveFor, planCutFor } from "../../actions/cut_wave.ts";
9 import { keyOf } from "../../web/keymap.ts";
910 import { canRead, getRepo } from "../../core/repos.ts";
1011 import { mayDirectCrew } from "../../crew/direct.ts";
1112 import { nearMilestones, standingLine } from "../../web/pages/milestones_near.ts";
@@ -353,7 +354,7 @@ export function wavesScreen(f: Session, ctx: Ctx, src: RepoSource): Screen {
353354 binding(["c"], "cut a wave"),
354355 ...(apps.length > 0 ? [binding(["a"], "filter by app")] : []),
355356 ...(askable() ? [binding(["t"], "tell the crew to write the first wave")] : []),
356 binding(["r"], "refresh"),
357 binding([keyOf("reread")], "refresh"),
357358 ];
358359 },
359360 load: reload,
@@ -405,7 +406,7 @@ export function wavesScreen(f: Session, ctx: Ctx, src: RepoSource): Screen {
405406 openAt(state.index);
406407 return true;
407408 }
408 if (e.key === "r") {
409 if (e.key === keyOf("reread")) {
409410 runAsync(ctx, reload);
410411 return true;
411412 }
src/tui/screens/wayback.ts +3 −2
@@ -7,6 +7,7 @@
77 */
88
99 import { mintWayBack, wayBackAccounts, type Stranded } from "../../actions/edge_handover.ts";
10 import { keyOf } from "../../web/keymap.ts";
1011 import type { Ctx, Screen } from "../app/app.ts";
1112 import { binding } from "../app/keys.ts";
1213 import { style } from "../term/style.ts";
@@ -50,7 +51,7 @@ export function wayBackScreen(f: Session, ctx: Ctx): Screen {
5051 };
5152 return {
5253 title: "Way-back links",
53 keys: [binding(["j", "k"], "move cursor"), binding(["enter"], "make the link"), binding(["r"], "refresh")],
54 keys: [binding(["j", "k"], "move cursor"), binding(["enter"], "make the link"), binding([keyOf("reread")], "refresh")],
5455 render(area, s) {
5556 const c = ctx.theme.c;
5657 const [head, list] = split(area, "v", [len(1), fill(1)]);
@@ -71,7 +72,7 @@ export function wayBackScreen(f: Session, ctx: Ctx): Screen {
7172 if (allowed) mint();
7273 return true;
7374 }
74 if (e.key === "r") {
75 if (e.key === keyOf("reread")) {
7576 note = "";
7677 read();
7778 return true;
src/tui/screens/workspace.ts +6 −5
@@ -35,6 +35,7 @@
3535 */
3636
3737 import { cannotChangeWords } from "../../actions/edit_words.ts";
38 import { keyOf } from "../../web/keymap.ts";
3839 import { editFiles, fileAt } from "../../actions/contents.ts";
3940 import { proposeEdit, proposeEditText } from "../../actions/propose_edit.ts";
4041 import { schemaRefusal } from "../../web/render/json-schema.ts";
@@ -2521,7 +2522,7 @@ export function workspaceScreen(
25212522 ? [binding(["a"], "your issues and the crew's answers")]
25222523 : []),
25232524 ...(repo !== undefined && admin()
2524 ? [binding(["R"], `decisions by ${(getRepoById(f.db, repo.id) ?? repo).decisionsBy} (cycle)`)]
2525 ? [binding(["A"], `decisions by ${(getRepoById(f.db, repo.id) ?? repo).decisionsBy} (cycle)`)]
25252526 : []),
25262527 ...liveBindings(src),
25272528 ...(liveSide?.mirroredAs === undefined
@@ -2559,7 +2560,7 @@ export function workspaceScreen(
25592560 getMirrorTarget(f.db, repo.id) !== undefined
25602561 ? [binding(["U"], "stop mirroring to the source")]
25612562 : []),
2562 binding(["r"], "refresh"),
2563 binding([keyOf("reread")], "refresh"),
25632564 binding(
25642565 ["E"],
25652566 hasExternalEditor() ? "open $FORGE_EDITOR" : "external editor",
@@ -2990,7 +2991,7 @@ export function workspaceScreen(
29902991 );
29912992 return true;
29922993 }
2993 if (plain && e.key === "R" && repo !== undefined && admin()) {
2994 if (plain && e.key === "A" && repo !== undefined && admin()) {
29942995 // `repo` was read when the screen opened; the rule is read afresh.
29952996 const target = getRepoById(f.db, repo.id) ?? repo;
29962997 const next =
@@ -3006,7 +3007,7 @@ export function workspaceScreen(
30063007 });
30073008 return true;
30083009 }
3009 if (plain && e.key === "r") {
3010 if (plain && e.key === keyOf("reread")) {
30103011 cache.clear();
30113012 runAsync(ctx, reload);
30123013 return true;
@@ -3221,7 +3222,7 @@ export function workspaceScreen(
32213222 commit();
32223223 return true;
32233224 }
3224 if (e.ctrl && (e.key === "f" || e.key === "r")) {
3225 if (e.ctrl && (e.key === "f" || e.key === keyOf("reread"))) {
32253226 t.find = e.key === "f" ? "find" : "replace";
32263227 t.replaceField = "find";
32273228 t.needle = "";
src/web/keymap.ts +16 −18
@@ -43,7 +43,9 @@ export const MOVES = {
4343 right: { key: "l", label: "Right", what: "Move to the column or tab on the right", kinds: any },
4444 open: { key: "Enter", label: "Open", what: "Open the focused row (o does too)", kinds: any },
4545 back: { key: "Escape", label: "Close", what: "Close what is on top, then clear the selection, then back out to the list", kinds: any },
46 search: { key: "/", label: "Search", what: "Focus search", kinds: any },
46 search: { key: "/", label: "Search", what: "Search, or filter the list (a terminal list's filter too)", kinds: any },
47 // Read again: the terminal's refresh, named for what it does (a page is live and needs none).
48 reread: { key: "R", label: "Refresh", what: "Read the screen again (the terminal; a page is live)", kinds: any },
4749 help: { key: "?", label: "Help", what: "List the keys this page answers", kinds: any },
4850 palette: { key: "Mod+k", label: "Jump", what: "Jump to anywhere, or act on what is focused", kinds: any },
4951 goto: { key: ":", label: "Go to", what: "Go to a page by name", kinds: any },
@@ -64,33 +66,21 @@ export const VERBS = {
6466 assign: { key: "a", label: "Assign", what: "Give it to someone", kinds: ["issue"] },
6567 sharpen: { key: "e", label: "Sharpen", what: "Have the planner plan it again", kinds: ["issue"] },
6668 park: { key: "p", label: "Park", what: "Park it behind the Later gate", kinds: ["issue"] },
67 stop: {
68 key: "s",
69 label: "Stop",
70 what: "Stop the run",
71 kinds: ["run"],
72 terminal: { key: "x", reason: "the terminal's run list cycles its state filter on s; it moves to s with the runs pull" },
73 },
69 stop: { key: "s", label: "Stop", what: "Stop the run", kinds: ["run"] },
7470 requeue: {
7571 key: "r",
7672 label: "Queue it again",
7773 what: "Queue a stopped run again",
7874 kinds: ["run"],
79 terminal: { key: "a", reason: "the terminal's run list refreshes on r; it moves to r with the runs pull" },
8075 },
8176 watch: { key: "w", label: "Watch live", what: "Watch the run live", kinds: ["run"] },
82 wheel: {
83 key: "i",
84 label: "Take the wheel",
85 what: "Take the wheel: steer the running agent",
86 kinds: ["run"],
87 terminal: { key: "S", reason: "the terminal's run list steers on S; it moves to i with the runs pull" },
88 },
77 wheel: { key: "i", label: "Take the wheel", what: "Take the wheel: steer the running agent", kinds: ["run"] },
8978 fewer: { key: "-", label: "Fewer", what: "Turn the figure down", kinds: ["figure"] },
9079 more: { key: "+", label: "More", what: "Turn the figure up", kinds: ["figure"] },
9180 set: { key: "Enter", label: "Set", what: "Set the figure to what it shows", kinds: ["figure"] },
9281 undo: { key: "z", label: "Undo", what: "Put back what was just done", kinds: ["any"] },
9382 edit: { key: "e", label: "Propose a change", what: "Propose a change to the file", kinds: ["file"] },
83 find: { key: "f", label: "Go to file", what: "Find a file by name", kinds: ["file"] },
9484 } as const satisfies Record<string, KeyDef>;
9585
9686 /**
@@ -117,8 +107,11 @@ export const REPO_TABS = {
117107 */
118108 export const OLD_KEYS_UNTIL = "2026-12-15T00:00:00Z";
119109 export interface OldKey {
120 /** Where it was: "pull" for the Files page's verdicts, "review" for /review's rows. */
121 readonly page: "pull" | "review";
110 /**
111 * Where it was: "pull" for the Files page's verdicts, "review" for /review's rows, "files" for a
112 * repository's files, "runs" for the terminal's run list, "terminal" for every terminal screen.
113 */
114 readonly page: "pull" | "review" | "files" | "runs" | "terminal";
122115 readonly was: string;
123116 readonly now: KeyId;
124117 /** The word a person reads for what the key does there, when the map's label is not it. */
@@ -130,6 +123,11 @@ export const OLD_KEYS: readonly OldKey[] = [
130123 { page: "pull", was: "v c", now: "create", word: "comment" },
131124 { page: "review", was: "c", now: "close" },
132125 { page: "review", was: "r", now: "sendBack" },
126 { page: "files", was: "t", now: "find" },
127 { page: "runs", was: "x", now: "stop" },
128 { page: "runs", was: "S", now: "wheel" },
129 { page: "runs", was: "a", now: "requeue" },
130 { page: "terminal", was: "r", now: "reread" },
133131 ];
134132
135133 /**
src/web/pages/explorer.ts +5 −2
@@ -23,6 +23,7 @@
2323 */
2424
2525 import type { TreeEntry } from "../../git/read.ts";
26 import { keyOf, oldKeys } from "../keymap.ts";
2627 import type { RepoSource } from "../../view/source.ts";
2728 import { html, raw, when, type Html } from "../html.ts";
2829 import { icon } from "../icons.ts";
@@ -270,16 +271,18 @@ export function codeMount(
270271
271272 /** The control that opens the finder. It needs a script, so it says so. */
272273 export function finderButton(): Html {
274 const moved = oldKeys("files")[0];
273275 return html`<button
274276 class="btn js-only"
275277 data-size="sm"
276278 data-variant="outline"
277279 type="button"
278280 data-finder
279 data-shortcut="t"
281 data-shortcut="${keyOf("find")}"
282 ${moved === undefined ? null : html`data-was="${moved.was}" data-was-says="${moved.says}"`}
280283 title="Go to file"
281284 >
282 ${icon("search")}<span class="grow">Go to file</span><kbd>t</kbd>
285 ${icon("search")}<span class="grow">Go to file</span><kbd>${keyOf("find")}</kbd>
283286 </button>`;
284287 }
285288
src/web/pages/thread.ts +2 −1
@@ -9,6 +9,7 @@
99 */
1010
1111 import { originError } from "../../actions/merge_words.ts";
12 import { keyOf } from "../keymap.ts";
1213 import { TELL_LIMIT_WORDS, TELL_TEXT_MAX } from "../../actions/tell_from.ts";
1314 import { returnTo, withReturn } from "../return_to.ts";
1415 import { mayView } from "../../core/sealed.ts";
@@ -886,7 +887,7 @@ export function assigneeCard(
886887 return card(
887888 html`${current}
888889 <form method="post" action="${action}" class="edit-row mt" data-now="Assigned" data-now-into="#assignee-now" data-now-from="assignee">
889 <label class="sr-only" for="f-assignee">Assign to</label>
890 <label class="sr-only" for="f-assignee"${issue.kind === "issue" ? html` data-shortcut="${keyOf("assign")}"` : null}>Assign to</label>
890891 <select class="input" id="f-assignee" name="assignee">
891892 <option
892893 value=""
src/web/studio/run.ts +4 −2
@@ -9,6 +9,7 @@
99 */
1010
1111 import { offersOwnToken } from "../../actions/own_token.ts";
12 import { keyOf } from "../keymap.ts";
1213 import { ownTokenBox, ownTokenJs } from "../own_token.ts";
1314 import { time } from "../time_element.ts";
1415 import { wayIn } from "../../actions/blocked_words.ts";
@@ -274,7 +275,7 @@ export async function runView(
274275 () =>
275276 html`<div class="bar mt" id="run-cancel">
276277 <form method="post" action="${base}/runs/${run.id}/cancel">
277 ${btn("Stop", { size: "sm", variant: "outline", icon: "square" })}
278 ${btn("Stop", { size: "sm", variant: "outline", icon: "square", shortcut: keyOf("stop") })}
278279 </form>
279280 </div>`,
280281 )}
@@ -287,6 +288,7 @@ export async function runView(
287288 size: "sm",
288289 variant: "outline",
289290 icon: "square",
291 shortcut: keyOf("stop"),
290292 })}
291293 </form>
292294 </div>`,
@@ -427,7 +429,7 @@ export async function runView(
427429 data-api="/api/v1/repos/${repo.ownerName}/${repo.name}/runs/${run.id}/steer"
428430 data-running="${run.state === "running" ? "1" : "0"}"
429431 >
430 <label class="sr-only" for="steer-text"
432 <label class="sr-only" for="steer-text" data-shortcut="${keyOf("wheel")}"
431433 >Say something to ${who}</label
432434 >
433435 <textarea
test/decisions-by-doors.test.ts +3 −3
@@ -224,10 +224,10 @@ describe("the standing rule in the terminal", () => {
224224 await press("/");
225225 for (const ch of "svc") await press(ch);
226226 await press("enter", "enter");
227 await press("R");
227 await press("A");
228228 expect(rule()).toBe("decider");
229229 expect(tui.screen.toText()).toContain("decisions here go by decider");
230 await press("R");
230 await press("A");
231231 expect(rule()).toBe("decider_tell");
232232 tui.stop();
233233 });
@@ -249,7 +249,7 @@ describe("the standing rule in the terminal", () => {
249249 };
250250 await press("/");
251251 for (const ch of "svc") await press(ch);
252 await press("enter", "enter", "R");
252 await press("enter", "enter", "A");
253253 expect(rule()).toBe("me");
254254 tui.stop();
255255 });
test/keymap-terminal.test.ts added +84
@@ -0,0 +1,84 @@
1 /**
2 * The terminal reads the forge's one keymap (src/web/keymap.ts): R reads any screen again (the
3 * map's `reread`), so no screen may bind a literal r to a refresh. Where r means something of the
4 * screen's own (a different kind of thing from a run, whose r is queue again), the screen is listed
5 * here with what r does, so a new one is a choice, never a slip.
6 */
7 import { expect, test } from "bun:test";
8 import { readFileSync } from "node:fs";
9 import { join } from "node:path";
10 import { keyOf } from "../src/web/keymap.ts";
11
12 const ROOT = join(import.meta.dir, "..");
13
14 /** Words that say a binding reads the screen again. */
15 const REREAD = /refresh|reload|read again|reread|knock again|check the payment/i;
16
17 /** A literal r bound on a terminal screen, and what it is called there. */
18 const R_BINDING = /binding\(\[(?:"[^"]*",\s*)*"r"(?:,\s*"[^"]*")*\],\s*(["`])([^"`]*)\1/g;
19
20 /** Screens where r is the screen's own verb, with what it does. */
21 const OWN_R: Record<string, string> = {
22 "src/tui/local/branches.ts": "rename",
23 "src/tui/screens/about.ts": "make … the reviewer",
24 "src/tui/screens/account_access.ts": "reset access",
25 "src/tui/screens/agents.ts": "roles",
26 "src/tui/screens/autonomy.ts": "reviewer",
27 "src/tui/screens/cloud.ts": "rotate",
28 "src/tui/screens/conflicts.ts": "look at the crew's proposal",
29 "src/tui/screens/dataimport.ts": "import, replace",
30 "src/tui/screens/design.ts": "revert",
31 "src/tui/screens/devices.ts": "revoke an app",
32 "src/tui/screens/estimates.ts": "record an estimate",
33 "src/tui/screens/experiments.ts": "record result",
34 "src/tui/screens/featurefeed.ts": "run scheduled now",
35 "src/tui/screens/feed.ts": "reply",
36 "src/tui/screens/fleet.ts": "reverse",
37 "src/tui/screens/flows.ts": "read upstream now",
38 "src/tui/screens/forges.ts": "restore",
39 "src/tui/screens/games.ts": "restart",
40 "src/tui/screens/hooks.ts": "redeliver",
41 "src/tui/screens/interrupted_out.ts": "try again",
42 "src/tui/screens/limbs.ts": "raise",
43 "src/tui/screens/mirror.ts": "retry",
44 "src/tui/screens/needs.ts": "standing still: re-check its pulls",
45 "src/tui/screens/orgteams.ts": "role",
46 "src/tui/screens/outsideagents.ts": "open or close reports",
47 "src/tui/screens/people.ts": "change a role",
48 "src/tui/screens/pinned.ts": "roll back",
49 "src/tui/screens/quarantine.ts": "run the review",
50 "src/tui/screens/queuegrowth.ts": "resume past the ceiling",
51 "src/tui/screens/resilience.ts": "run a restore drill",
52 "src/tui/screens/schedules.ts": "run now",
53 "src/tui/screens/stalled.ts": "unblock",
54 "src/tui/screens/talk_chats.ts": "rename",
55 "src/tui/screens/variants.ts": "run a branch",
56 };
57
58 function terminalSources(): Record<string, string> {
59 const out: Record<string, string> = {};
60 for (const path of new Bun.Glob("src/tui/**/*.ts").scanSync(ROOT)) out[path] = readFileSync(join(ROOT, path), "utf8");
61 return out;
62 }
63
64 test("no terminal screen reads itself again on r: R does, from the map", () => {
65 expect(keyOf("reread")).toBe("R");
66 const offenders: string[] = [];
67 for (const [path, text] of Object.entries(terminalSources()))
68 for (const m of text.matchAll(R_BINDING)) if (REREAD.test(m[2]!)) offenders.push(`${path}: r "${m[2]}"`);
69 expect(offenders).toEqual([]);
70 });
71
72 test("every screen that binds r for its own verb is listed with what it does, and the list holds only screens that still do", () => {
73 const sources = terminalSources();
74 const binding = Object.keys(sources).filter((p) => [...sources[p]!.matchAll(R_BINDING)].length > 0).sort();
75 expect(binding).toEqual(Object.keys(OWN_R).sort());
76 });
77
78 test("the scan catches the shapes a refresh on r takes", () => {
79 const hits = (text: string) => [...text.matchAll(R_BINDING)].filter((m) => REREAD.test(m[2]!)).map((m) => m[2]);
80 expect(hits(`binding(["r"], "refresh")`)).toEqual(["refresh"]);
81 expect(hits(`binding(["j", "r"], "read again")`)).toEqual(["read again"]);
82 expect(hits(`binding(["r"], "rename")`)).toEqual([]);
83 expect(hits(`binding([keyOf("reread")], "refresh")`)).toEqual([]);
84 });
test/keymap.test.ts +30 −3
@@ -5,11 +5,12 @@
55 * map's moves, no key fires while typing, and the bridge is handed its verbs from the map.
66 */
77 import { expect, test } from "bun:test";
8 import { finderButton } from "../src/web/pages/explorer.ts";
89 import { readdirSync, readFileSync, statSync } from "node:fs";
910 import { join, relative } from "node:path";
1011 import { decideKey } from "../src/web/key_decision.ts";
1112 import { GO_PAGES } from "../src/web/go_pages.ts";
12 import { KEYMAP, MOVES, OLD_KEYS, OLD_KEYS_UNTIL, REPO_TABS, VERBS, keyOf, oldKeys, type KeyDef, type KeyKind } from "../src/web/keymap.ts";
13 import { KEYMAP, MOVES, OLD_KEYS, OLD_KEYS_UNTIL, REPO_TABS, VERBS, keyOf, oldKeys, provideOldKeysClockForTest, type KeyDef, type KeyKind } from "../src/web/keymap.ts";
1314 import { bridgeJs } from "../src/web/bridge_client.ts";
1415 import { DISMISS_KEY, NEW_ISSUE_KEY } from "../src/web/script_keys.ts";
1516
@@ -20,7 +21,9 @@ const ROOT = join(import.meta.dir, "..");
2021 * the map. This list only shrinks; a file here that no longer has a literal must leave it.
2122 */
2223 const PENDING: Record<string, string> = {
23 "src/web/pages/explorer.ts": "(c) issues and runs: t finds a file here, which Tell the crew owns everywhere else",
24 "src/web/pages/next.ts": "(d): Top, Up, Down and Not now are t, u, d and l, which Tell, Update and Right own",
25 "src/web/space_client.ts": "(d): n jumps the space to now",
26 "src/web/system-live.ts": "(d): c and m pick CPU and memory, which Write and Merge own",
2427 };
2528
2629 /**
@@ -34,6 +37,8 @@ const LITERAL = [
3437 /verb\('([^']+)', '/g,
3538 /\bkey: "([a-zA-Z](?: [a-zA-Z])?)",/g,
3639 /\$\{key\("([^"]{1,3})", /g,
40 /\bkey === '([a-zA-Z])'/g,
41 /, "([a-zA-Z])", back\)/g,
3742 ];
3843
3944 function sources(dir: string): string[] {
@@ -71,7 +76,7 @@ test("one key, one meaning: no two verbs share a key on one kind of thing, and n
7176 const moveKeys = new Set<string>(Object.values(MOVES).map((d) => d.key));
7277 // A figure's Enter is its open: setting it to what it shows.
7378 expect(verbs.filter(([id, d]) => moveKeys.has(d.key) && id !== "set").map(([id]) => id)).toEqual([]);
74 for (const [, d] of Object.entries(KEYMAP)) if ("terminal" in d) expect(d.terminal.reason.length).toBeGreaterThan(20);
79 for (const [, d] of Object.entries(KEYMAP) as [string, KeyDef][]) if (d.terminal !== undefined) expect(d.terminal.reason.length).toBeGreaterThan(20);
7580 });
7681
7782 test("a moved key says where it went for two weeks, then nothing: the date is in code, not an alias", () => {
@@ -83,6 +88,8 @@ test("a moved key says where it went for two weeks, then nothing: the date is in
8388 ]);
8489 expect(oldKeys("review", before).map((o) => [o.was, o.key])).toEqual([["c", "x"], ["r", "b"]]);
8590 expect(oldKeys("pull", new Date(OLD_KEYS_UNTIL))).toEqual([]);
91 expect(oldKeys("files", before)).toEqual([{ was: "t", key: "f", says: "f is go to file now" }]);
92 expect(oldKeys("runs", before).map((o) => [o.was, o.key])).toEqual([["x", "s"], ["S", "i"], ["a", "r"]]);
8693 expect(oldKeys("review", new Date(Date.parse(OLD_KEYS_UNTIL) + 86_400_000))).toEqual([]);
8794 // Two weeks from the change, not a standing alias.
8895 expect(Date.parse(OLD_KEYS_UNTIL) - Date.parse("2026-12-01T00:00:00Z")).toBeLessThanOrEqual(15 * 86_400_000);
@@ -91,6 +98,18 @@ test("a moved key says where it went for two weeks, then nothing: the date is in
9198 for (const o of OLD_KEYS.filter((k) => k.page === "pull")) expect(Object.values(KEYMAP).some((d) => d.key === o.was)).toBe(false);
9299 });
93100
101 test("Go to file is the keymap's f on a repository's files, and t, for two weeks, says so: t is Tell the crew everywhere", () => {
102 provideOldKeysClockForTest(new Date(Date.parse(OLD_KEYS_UNTIL) - 86_400_000));
103 const b = finderButton().text;
104 provideOldKeysClockForTest(new Date(OLD_KEYS_UNTIL));
105 const after = finderButton().text;
106 provideOldKeysClockForTest(undefined);
107 expect(b).toContain('data-shortcut="f"');
108 expect(b).toContain("<kbd>f</kbd>");
109 expect(b).toContain('data-was="t" data-was-says="f is go to file now"');
110 expect(after).not.toContain("data-was=");
111 });
112
94113 test("a repository's tabs are g jumps of their own, and shadow a forge-wide one only where the map says", () => {
95114 const tabs = Object.values(REPO_TABS);
96115 expect(new Set(tabs).size).toBe(tabs.length);
@@ -104,6 +123,14 @@ test("the shell says where a moved key went, and a quick second key still finds
104123 expect(client).toContain("seq.length === 2 && seq[0] !== 'g' ? doc.querySelector('[data-shortcut=\"' + esc(e.key) + '\"]')");
105124 });
106125
126 test("both doors share one meaning per key: R refreshes a terminal screen, / filters or searches, r queues a run again", () => {
127 expect([keyOf("reread"), keyOf("search"), keyOf("requeue"), keyOf("stop"), keyOf("wheel")]).toEqual(["R", "/", "r", "s", "i"]);
128 // No terminal key differs from the web's here: the run cards on the issue and pull screens steer
129 // on i, as the run list does.
130 expect((Object.entries(KEYMAP) as [string, KeyDef][]).filter(([, d]) => d.terminal !== undefined).map(([id]) => id)).toEqual([]);
131 expect(oldKeys("terminal", new Date(Date.parse(OLD_KEYS_UNTIL) - 1))).toEqual([{ was: "r", key: "R", says: "R is refresh now" }]);
132 });
133
107134 test("the g jumps the map names are go_pages.ts's", () => {
108135 expect([keyOf("home"), keyOf("talk")]).toEqual(["g h", "g t"]);
109136 });
test/reviewer-lands.test.ts +1 −1
@@ -137,7 +137,7 @@ describe("a team reviewer reviews and a writer lands", () => {
137137 tui.ctx.push(pullScreen(session, tui.ctx, local(session, lib), number));
138138 await settleUntil(tui, "refresh", { timeoutMs: 10_000 });
139139 if (who === "dee") {
140 tui.dispatch({ type: "key", key: "R", ctrl: false, alt: false, shift: true });
140 tui.dispatch({ type: "key", key: "b", ctrl: false, alt: false, shift: false });
141141 await settleApp(tui);
142142 }
143143 return tui.screen.toText();
test/studio-run-page.test.ts +4
@@ -160,6 +160,8 @@ describe("working: a run's own page in the studio", () => {
160160 expect(page).toContain('data-who="scout"');
161161 expect(page).toContain('id="run-steer"');
162162 expect(page).toContain("Steer scout");
163 // Take the wheel is the keymap's i: it puts the caret in the steer box.
164 expect(page).toContain('<label class="sr-only" for="steer-text" data-shortcut="i"');
163165 // Jump, live and steer draw §5's btn, bar and card (#4263).
164166 for (const old of ["run-jump", "run-live", "run-steer"]) {
165167 expect(page).not.toMatch(new RegExp(`class="[^"]*\\b${old}\\b`));
@@ -289,6 +291,8 @@ describe("working: a run's own page in the studio", () => {
289291 `<div class="bar mt" id="run-cancel">\\s*<form method="post" action="/alice/engine/runs/${run.id}/cancel">[\\s\\S]*?${label}[\\s\\S]*?</form>`,
290292 ),
291293 );
294 // Stop is the keymap's s, on either button.
295 expect(page).toMatch(/id="run-cancel">[\s\S]*?data-shortcut="s"[\s\S]*?<\/form>/);
292296 }
293297 });
294298
test/tell-status.test.ts +2
@@ -257,6 +257,8 @@ describe("what became of a tell", () => {
257257 let html = await (await fetch(`${servers.url}/alice/garden/issues/${issue.number}`, { headers: { cookie: cookie() } })).text();
258258 expect(html).toContain('data-tell-state="stalled"');
259259 expect(html).toContain('<a href="#f-assignee">Pick an assignee below</a>');
260 // Assign is the keymap's a on an issue: it puts the caret on Assign to.
261 expect(html).toContain('<label class="sr-only" for="f-assignee" data-shortcut="a">Assign to</label>');
260262 // A run picks it up: the line names who and links the run.
261263 run(issue, "running");
262264 const id = listRuns(app.db, repo.id, { kind: "agent", issueId: issue.id, limit: 1 })[0]!.id;
test/tui-crewhandover-open.test.ts +12 −6
@@ -1,5 +1,6 @@
11 /** The crew hand-overs screen opens a parked-twice issue with Enter and reads again on `r`. */
22 import { afterAll, beforeAll, expect, test } from "bun:test";
3 import { OLD_KEYS_UNTIL, provideOldKeysClockForTest } from "../src/web/keymap.ts";
34 import { createUser, getUserByName } from "../src/core/users.ts";
45 import type { Ctx } from "../src/tui/app/app.ts";
56 import { crewHandoverScreen } from "../src/tui/screens/crewhandover.ts";
@@ -52,7 +53,7 @@ beforeAll(async () => {
5253 });
5354 afterAll(() => e.close());
5455
55 test("Enter opens the parked issue, r reads again, a non-admin gets nothing", async () => {
56 test("Enter opens the parked issue, R reads again, a non-admin gets nothing", async () => {
5657 const t = await crewScreen("alice");
5758 expect(t.text()).toContain("Nothing handed to the planner");
5859 await t.key("enter");
@@ -64,10 +65,15 @@ test("Enter opens the parked issue, r reads again, a non-admin gets nothing", as
6465 expect(e.ended(work, "nothing to propose")).toBe(true);
6566 await tick();
6667 expect(t.text()).not.toContain("Handed to the planner: ");
67 await t.key("r");
68 await t.key("R");
6869 expect(t.text()).toContain("Handed to the planner: alice/engine#" + work.number);
6970 expect(t.text()).toMatch(/enter\s+open/);
70 expect(t.text()).toMatch(/r\s+refresh/);
71 expect(t.text()).toMatch(/R\s+refresh/);
72 // r, for two weeks, says R refreshes now (keymap.ts OLD_KEYS).
73 provideOldKeysClockForTest(new Date(Date.parse(OLD_KEYS_UNTIL) - 86_400_000));
74 await t.key("r");
75 provideOldKeysClockForTest(undefined);
76 expect(t.text()).toContain("R is refresh now");
7177
7278 await t.key("enter");
7379 expect(t.text()).toContain("Scene graph");
@@ -87,7 +93,7 @@ test("Enter opens the parked issue, r reads again, a non-admin gets nothing", as
8793 expect(pushed).toEqual([]);
8894 });
8995
90 test("Enter on the drill row opens nothing, and r clamps the cursor when the list shrinks", async () => {
96 test("Enter on the drill row opens nothing, and R clamps the cursor when the list shrinks", async () => {
9197 const { setIssueState } = await import("../src/actions/issues.ts");
9298 const { recordDrill } = await import("../src/snapshot/drills.ts");
9399 const keep = e.issue("Keeper");
@@ -120,7 +126,7 @@ test("Enter on the drill row opens nothing, and r clamps the cursor when the lis
120126 expect(t.text()).toContain("Handed to the planner: ");
121127 // Close the issue the cursor row stands past, then r: the cursor lands on a row that exists.
122128 setIssueState(e.app, e.alice, e.fresh(), gone, "closed");
123 await t.key("r");
129 await t.key("R");
124130 expect((t.text().match(/Handed to the planner: /g) ?? []).length).toBe(rows - 1);
125131 await t.key("k");
126132 await t.key("enter");
@@ -144,7 +150,7 @@ test("t tries the parked issue again, and a non-admin's t does nothing", async (
144150 expect(parkedCount(e.app, e.fresh(), work.id)).toBe(2);
145151
146152 const t = await crewScreen("alice");
147 await t.key("r");
153 await t.key("R");
148154 expect(t.text()).toContain("Handed to the planner: alice/engine#" + work.number);
149155 expect(t.text()).toMatch(/t\s+try the issue again/);
150156 await t.key("t");
test/tui-deploys-probe.test.ts +2 −2
@@ -189,10 +189,10 @@ test("the knock is the MCP tool's: probeApp keeps the row it showed", async () =
189189 expect(row.said).toContain("note.create as anon: the table says no, the app said 200");
190190 });
191191
192 test("`r` on the probe knocks again and keeps another row", async () => {
192 test("`R` on the probe knocks again and keeps another row", async () => {
193193 running = true;
194194 const before = listProbes(forge.db, record.id).length;
195 const frames = await drive(alice, repo, ["p", "r"]);
195 const frames = await drive(alice, repo, ["p", "R"]);
196196 expect(frames.at(-1)).toContain("GET /api/notes as anon · 200 · ok");
197197 expect(listProbes(forge.db, record.id).length).toBe(before + 2);
198198 });
test/tui-pricing.test.ts +9 −9
@@ -127,10 +127,10 @@ test("an order prints the checkout address, and the same ticket brings the claim
127127 const f = await fixture();
128128 const { h, session } = await ordered(f, "203.0.113.3", "sunny-day");
129129 expect(pendingFrom(f.app.db, bucketOf("203.0.113.3"), Date.now())).toBe(1);
130 await f.press(h, "r");
130 await f.press(h, "R");
131131 expect(flat(h)).toContain("Not paid yet");
132132 f.paid.add(session);
133 await f.press(h, "r"); // the reconcile is awaited by the app: the forge is made before it settles
133 await f.press(h, "R"); // the reconcile is awaited by the app: the forge is made before it settles
134134 expect(joined(h)).toMatch(/https:\/\/sunny-day--forge\.test\/claim#/);
135135 expect(f.placed()).toBe(1);
136136 });
@@ -143,7 +143,7 @@ test("the claim link is shown once: a screen whose order's link was already take
143143 const id = f.orderRow("once-only")!.id;
144144 await reconcileOrder(f.app, id);
145145 expect((await deliverLink(f.app, getOrder(f.app.db, id)!)).kind).toBe("link");
146 await f.press(h, "r");
146 await f.press(h, "R");
147147 expect(flat(h)).toContain("The link was shown already");
148148 expect(joined(h)).not.toContain("/claim#");
149149 });
@@ -152,7 +152,7 @@ test("a paid order whose forge cannot be made says so and keeps the order id", a
152152 const f = await fixture({ placement: "full" });
153153 const { h, session } = await ordered(f, "203.0.113.7", "no-room");
154154 f.paid.add(session);
155 await f.press(h, "r");
155 await f.press(h, "R");
156156 expect(flat(h)).toContain("Paid, but the forge could not be made");
157157 expect(flat(h)).toContain(f.orderRow("no-room")!.id);
158158 expect(joined(h)).not.toContain("/claim#");
@@ -173,7 +173,7 @@ test("a forge already taken over is told so, and no link is shown", async () =>
173173 } finally {
174174 child.close();
175175 }
176 await f.press(h, "r");
176 await f.press(h, "R");
177177 expect(flat(h)).toContain("is taken over");
178178 expect(joined(h)).not.toContain("/claim#");
179179 });
@@ -183,7 +183,7 @@ test("a ticket that does not fit the order shows no link, and the screen says wh
183183 const { h, session } = await ordered(f, "203.0.113.10", "not-yours");
184184 f.paid.add(session);
185185 f.app.db.query("UPDATE forge_order SET ticket_hash = 'someone-elses' WHERE name = 'not-yours'").run();
186 await f.press(h, "r");
186 await f.press(h, "R");
187187 expect(flat(h)).toContain("not yours to see");
188188 expect(joined(h)).not.toContain("/claim#");
189189 expect(f.placed()).toBe(0);
@@ -329,7 +329,7 @@ test("the terminal prints the receipt's four facts on every ready branch, the cl
329329 // The claim link branch.
330330 const a = await ordered(f, "203.0.113.20", "receipt-link");
331331 f.paid.add(a.session);
332 await f.press(a.h, "r");
332 await f.press(a.h, "R");
333333 expect(joined(a.h)).toMatch(/\/claim#/);
334334 for (const t of facts("receipt-link")) expect(flat(a.h)).toContain(t);
335335 // The shown-already branch.
@@ -338,7 +338,7 @@ test("the terminal prints the receipt's four facts on every ready branch, the cl
338338 const id = f.orderRow("receipt-shown")!.id;
339339 await reconcileOrder(f.app, id);
340340 await deliverLink(f.app, getOrder(f.app.db, id)!);
341 await f.press(b.h, "r");
341 await f.press(b.h, "R");
342342 expect(flat(b.h)).toContain("The link was shown already");
343343 for (const t of facts("receipt-shown")) expect(flat(b.h)).toContain(t);
344344 // The claimed branch: the third forge made has an admin.
@@ -353,7 +353,7 @@ test("the terminal prints the receipt's four facts on every ready branch, the cl
353353 } finally {
354354 child.close();
355355 }
356 await f.press(c.h, "r");
356 await f.press(c.h, "R");
357357 expect(flat(c.h)).toContain("is taken over");
358358 for (const t of facts("receipt-claimed")) expect(flat(c.h)).toContain(t);
359359 });
test/tui-run-cancel.test.ts +25 −13
@@ -1,5 +1,6 @@
11 /** The terminal's runs list cancels a queued or running run with `x` and a confirm (#7230). */
22 import { afterAll, beforeAll, expect, test } from "bun:test";
3 import { OLD_KEYS_UNTIL, provideOldKeysClockForTest } from "../src/web/keymap.ts";
34 import { mkdtemp, rm } from "node:fs/promises";
45 import { tmpdir } from "node:os";
56 import { join } from "node:path";
@@ -73,8 +74,8 @@ const state = (id: string) => getRun(forge.db, id)!.state;
7374
7475 test("x asks, yes cancels the run and the row reads cancelled", async () => {
7576 const h = await open(alice, queued());
76 expect(h.hints()).toMatch(/x +cancel/);
77 let text = await h.press("x");
77 expect(h.hints()).toMatch(/s +stop/);
78 let text = await h.press("s");
7879 expect(text).toContain("Cancel run");
7980 expect(text).toContain("deploy production");
8081 expect(state(h.runId)).toBe("queued");
@@ -85,25 +86,36 @@ test("x asks, yes cancels the run and the row reads cancelled", async () => {
8586 h.app.stop();
8687 });
8788
89 test("x, the old key, says s is stop now for two weeks and cancels nothing", async () => {
90 provideOldKeysClockForTest(new Date(Date.parse(OLD_KEYS_UNTIL) - 86_400_000));
91 const h = await open(alice, queued());
92 const text = await h.press("x");
93 provideOldKeysClockForTest(undefined);
94 expect(state(h.runId)).toBe("queued");
95 expect(text).toContain("s is stop now");
96 expect(text).not.toContain("Cancel run");
97 h.app.stop();
98 });
99
88100 test("declining the confirm leaves the run as it was", async () => {
89101 const h = await open(alice, queued());
90 await h.press("x");
102 await h.press("s");
91103 await h.press("enter"); // defaults to Keep
92104 expect(state(h.runId)).toBe("queued");
93 await h.press("x");
105 await h.press("s");
94106 await h.press("esc");
95107 expect(state(h.runId)).toBe("queued");
96108 h.app.stop();
97109 });
98110
99 test("a running run offers x cancel too", async () => {
111 test("a running run offers s stop too", async () => {
100112 const h = await open(alice, (repo) => {
101113 const run = createRun(forge.db, { repoId: repo.id, kind: "deploy", env: "production" });
102114 claimRun(forge.db, run.id);
103115 return run.id;
104116 });
105117 expect(getRun(forge.db, h.runId)!.state).toBe("running");
106 await h.press("x");
118 await h.press("s");
107119 await h.press("left");
108120 await h.press("enter");
109121 expect(state(h.runId)).toBe("cancelled");
@@ -118,7 +130,7 @@ test("a cancelled run still ending its processes reads stopping, and cancelled o
118130 return run.id;
119131 });
120132 try {
121 await h.press("x");
133 await h.press("s");
122134 await h.press("left");
123135 const text = await h.press("enter");
124136 expect(state(h.runId)).toBe("cancelled");
@@ -138,17 +150,17 @@ test("x does nothing on a finished run", async () => {
138150 finishRun(forge.db, run.id, { state: "ok", summary: "GREEN-MARK" });
139151 return run.id;
140152 });
141 expect(h.hints()).not.toMatch(/x +cancel/);
142 const text = await h.press("x");
153 expect(h.hints()).not.toMatch(/s +stop/);
154 const text = await h.press("s");
143155 expect(text).not.toContain("Cancel run");
144156 expect(state(h.runId)).toBe("ok");
145157 h.app.stop();
146158 });
147159
148 test("a reader is not offered x and a press changes nothing", async () => {
160 test("a reader is not offered s and a press changes nothing", async () => {
149161 const h = await open(bob, queued());
150 expect(h.hints()).not.toMatch(/x +cancel/);
151 const text = await h.press("x");
162 expect(h.hints()).not.toMatch(/s +stop/);
163 const text = await h.press("s");
152164 expect(text).not.toContain("Cancel run");
153165 expect(state(h.runId)).toBe("queued");
154166 h.app.stop();
@@ -156,7 +168,7 @@ test("a reader is not offered x and a press changes nothing", async () => {
156168
157169 test("a run that finished meanwhile answers in one line", async () => {
158170 const h = await open(alice, queued());
159 await h.press("x");
171 await h.press("s");
160172 claimRun(forge.db, h.runId);
161173 finishRun(forge.db, h.runId, { state: "ok", summary: "done" });
162174 await h.press("left");
test/tui-runlog.test.ts +2 −2
@@ -208,13 +208,13 @@ test("another run's events do not reread this one", async () => {
208208 expect(app.screen.toText()).not.toContain("SNEAKED");
209209 });
210210
211 test("r rereads the log, and o prints the web address", async () => {
211 test("R rereads the log, and o prints the web address", async () => {
212212 const run = createRun(forge.db, { repoId: repo.id, kind: "agent" });
213213 claimRun(forge.db, run.id);
214214 appendRunLog(dir, run.id, "before");
215215 const app = await open(alice, run.id);
216216 appendFileSync(runLogPath(dir, run.id), "BEHIND-THE-LISTENER\n");
217 await key(app, "r");
217 await key(app, "R");
218218 expect(app.screen.toText()).toContain("BEHIND-THE-LISTENER");
219219 await key(app, "o");
220220 expect(app.screen.toText()).toContain(`/alice/lamp/runs/${run.id}`);
test/tui-runs-requeue.test.ts +16 −16
@@ -88,10 +88,10 @@ async function open(user: User, end: "failed" | "ok" | "cancelled" = "failed") {
8888 return { app, press, hints, runs, repo, issueId: issue.value.id };
8989 }
9090
91 test("a asks, yes queues the task again and the list shows the queued run", async () => {
91 test("r asks, yes queues the task again and the list shows the queued run", async () => {
9292 const h = await open(alice);
93 expect(h.hints()).toMatch(/a +run again/);
94 let text = await h.press("a");
93 expect(h.hints()).toMatch(/r +queue it again/);
94 let text = await h.press("r");
9595 expect(text).toContain("Run again");
9696 expect(text).toContain("again?");
9797 expect(h.runs()).toHaveLength(1);
@@ -105,52 +105,52 @@ test("a asks, yes queues the task again and the list shows the queued run", asyn
105105 h.app.stop();
106106 });
107107
108 test("a cancelled agent run offers a too", async () => {
108 test("a cancelled agent run offers r too", async () => {
109109 const h = await open(alice, "cancelled");
110 expect(h.hints()).toMatch(/a +run again/);
110 expect(h.hints()).toMatch(/r +queue it again/);
111111 h.app.stop();
112112 });
113113
114114 test("esc and Keep change nothing", async () => {
115115 const h = await open(alice);
116 await h.press("a");
116 await h.press("r");
117117 await h.press("esc");
118118 expect(h.runs()).toHaveLength(1);
119 await h.press("a");
119 await h.press("r");
120120 await h.press("enter"); // defaults to Keep
121121 expect(h.runs()).toHaveLength(1);
122122 h.app.stop();
123123 });
124124
125 test("a succeeded run offers no a and a press changes nothing", async () => {
125 test("a succeeded run offers no r and a press changes nothing", async () => {
126126 const h = await open(alice, "ok");
127 expect(h.hints()).not.toMatch(/a +run again/);
128 const text = await h.press("a");
127 expect(h.hints()).not.toMatch(/r +queue it again/);
128 const text = await h.press("r");
129129 expect(text).not.toContain("Run again");
130130 expect(h.runs()).toHaveLength(1);
131131 h.app.stop();
132132 });
133133
134 test("a reader is not offered a and a press changes nothing", async () => {
134 test("a reader is not offered r and a press changes nothing", async () => {
135135 const h = await open(bob);
136 expect(h.hints()).not.toMatch(/a +run again/);
137 const text = await h.press("a");
136 expect(h.hints()).not.toMatch(/r +queue it again/);
137 const text = await h.press("r");
138138 expect(text).not.toContain("Run again");
139139 expect(h.runs()).toHaveLength(1);
140140 h.app.stop();
141141 });
142142
143 test("a closed issue is not offered a", async () => {
143 test("a closed issue is not offered r", async () => {
144144 const h = await open(alice);
145145 setIssueState(forge.db, h.issueId, "closed");
146146 await h.press("r");
147 expect(h.hints()).not.toMatch(/a +run again/);
147 expect(h.hints()).not.toMatch(/r +queue it again/);
148148 h.app.stop();
149149 });
150150
151151 test("a refusal after the confirm shows the action's words", async () => {
152152 const h = await open(alice);
153 await h.press("a");
153 await h.press("r");
154154 setIssueState(forge.db, h.issueId, "closed");
155155 await h.press("left");
156156 const text = await h.press("enter");
test/tui-runs-state.test.ts +4 −4
@@ -63,17 +63,17 @@ test("s cycles All, Failed, Running, Succeeded and the list follows", async () =
6363 let text = app.screen.toText();
6464 expect(text).toContain("GREEN-MARK");
6565 expect(text).toContain("RED-MARK");
66 text = await press("s");
66 text = await press("/");
6767 expect(text).toContain("Failed");
6868 expect(text).toContain("RED-MARK");
6969 expect(text).toContain("AGENT-RED-MARK");
7070 expect(text).not.toContain("GREEN-MARK");
71 text = await press("s");
71 text = await press("/");
7272 expect(text).toContain("No running runs");
73 text = await press("s");
73 text = await press("/");
7474 expect(text).toContain("GREEN-MARK");
7575 expect(text).not.toContain("RED-MARK");
76 text = await press("s");
76 text = await press("/");
7777 expect(text).toContain("GREEN-MARK");
7878 expect(text).toContain("RED-MARK");
7979 app.stop();
test/tui-steer.test.ts +16 −16
@@ -95,7 +95,7 @@ async function open(user: User, push: (session: any, ctx: any) => any) {
9595 return { app, press, type, text: () => app.screen.toText() };
9696 }
9797
98 test("S on the runs list sends the word to the running agent and says so", async () => {
98 test("i on the runs list (take the wheel) sends the word to the running agent and says so", async () => {
9999 const { repo, runId } = await seed();
100100 const heard: string[] = [];
101101 const stop = listenForSteer(runId, (t) => {
@@ -103,8 +103,8 @@ test("S on the runs list sends the word to the running agent and says so", async
103103 return true;
104104 });
105105 const h = await open(alice, (s, ctx) => runsScreen(s, ctx, repo));
106 expect(h.text()).toMatch(/S +steer/);
107 expect(await h.press("S")).toContain("Steer the run");
106 expect(h.text()).toMatch(/i +take the wheel/);
107 expect(await h.press("i")).toContain("Steer the run");
108108 await h.type("also add a test");
109109 const text = await h.press("enter");
110110 expect(heard).toEqual(["also add a test"]);
@@ -116,7 +116,7 @@ test("S on the runs list sends the word to the running agent and says so", async
116116 test("with no session listening the word goes on the conversation", async () => {
117117 const { repo, issue } = await seed();
118118 const h = await open(alice, (s, ctx) => runsScreen(s, ctx, repo));
119 await h.press("S");
119 await h.press("i");
120120 await h.type("try the other door");
121121 const text = await h.press("enter");
122122 expect(text).toContain("Commented.");
@@ -132,7 +132,7 @@ test("empty text is refused in place and nothing is said", async () => {
132132 return true;
133133 });
134134 const h = await open(alice, (s, ctx) => runsScreen(s, ctx, repo));
135 await h.press("S");
135 await h.press("i");
136136 await h.type(" ");
137137 const text = await h.press("enter");
138138 expect(text).toContain("Steer the run");
@@ -145,13 +145,13 @@ test("empty text is refused in place and nothing is said", async () => {
145145 test("a finished run is not offered steering", async () => {
146146 const { repo, issue } = await seed(true);
147147 const h = await open(alice, (s, ctx) => runsScreen(s, ctx, repo));
148 expect(h.text()).not.toMatch(/S +steer/);
149 expect(await h.press("S")).not.toContain("Steer the run");
148 expect(h.text()).not.toMatch(/i +take the wheel/);
149 expect(await h.press("i")).not.toContain("Steer the run");
150150 expect(listComments(forge.db, issue.id)).toHaveLength(0);
151151 h.app.stop();
152152 });
153153
154 test("the issue's crew card steers with s", async () => {
154 test("the issue's crew card takes the wheel with i, as the run list does", async () => {
155155 const { repo, issue, runId } = await seed();
156156 const heard: string[] = [];
157157 const stop = listenForSteer(runId, (t) => {
@@ -160,8 +160,8 @@ test("the issue's crew card steers with s", async () => {
160160 });
161161 const h = await open(alice, (s, ctx) => issueScreen(s, ctx, local(s, repo), issue.number));
162162 await h.press("tab");
163 expect(h.text()).toMatch(/s +steer/);
164 expect(await h.press("s")).toContain("Steer the run");
163 expect(h.text()).toMatch(/i +take the wheel/);
164 expect(await h.press("i")).toContain("Steer the run");
165165 await h.type("smaller steps");
166166 expect(await h.press("enter")).toContain("Sent.");
167167 expect(heard).toEqual(["smaller steps"]);
@@ -169,7 +169,7 @@ test("the issue's crew card steers with s", async () => {
169169 h.app.stop();
170170 });
171171
172 test("the pull's Crew tab steers with s", async () => {
172 test("the pull's Crew tab takes the wheel with i, as the run list does", async () => {
173173 const repo = await makeRepo(forge, alice, { name: `pull${n++}`, visibility: "public" });
174174 if (!repo.ok) throw new Error(String(repo.error));
175175 for (const branch of ["main", "topic"]) {
@@ -199,8 +199,8 @@ test("the pull's Crew tab steers with s", async () => {
199199 }
200200 await h.press("tab");
201201 await h.press("tab");
202 expect(h.text()).toMatch(/s +steer/);
203 expect(await h.press("s")).toContain("Steer the run");
202 expect(h.text()).toMatch(/i +take the wheel/);
203 expect(await h.press("i")).toContain("Steer the run");
204204 await h.type("one file at a time");
205205 expect(await h.press("enter")).toContain("Sent.");
206206 expect(heard).toEqual(["one file at a time"]);
@@ -217,8 +217,8 @@ test("an agent session that may write is not offered steering", async () => {
217217 return true;
218218 });
219219 const h = await open(bot, (s, ctx) => runsScreen(s, ctx, repo));
220 expect(h.text()).not.toMatch(/S +steer/);
221 expect(await h.press("S")).not.toContain("Steer the run");
220 expect(h.text()).not.toMatch(/i +take the wheel/);
221 expect(await h.press("i")).not.toContain("Steer the run");
222222 expect(heard).toEqual([]);
223223 stop();
224224 h.app.stop();
@@ -238,7 +238,7 @@ test("a refusal reads as the run page and MCP read it", async () => {
238238 if (!writers.ok) throw new Error("team failed");
239239 addTeamMember(forge.db, writers.value, c.value.id);
240240 const h = await open(c.value, (s, ctx) => runsScreen(s, ctx, repo));
241 await h.press("S");
241 await h.press("i");
242242 await h.type("hello");
243243 // Her write access goes after the prompt opened: the action refuses.
244244 removeTeamMember(forge.db, writers.value, c.value.id);
test/tui-talk-build.test.ts +2 −2
@@ -54,7 +54,7 @@ afterAll(async () => {
5454 await rm(dir, { recursive: true, force: true });
5555 });
5656
57 test("n starts a build, Enter opens it, Enter shows a version's files, R restores it and P publishes", async () => {
57 test("n starts a build, Enter opens it, Enter shows a version's files, U restores it and P publishes", async () => {
5858 const listed = await drive(alice, [...open, "n", "a recipe box", "\r"]);
5959 const [mine] = buildsOf(app.db, alice.id);
6060 expect(mine?.title).toBe("a recipe box");
@@ -71,7 +71,7 @@ test("n starts a build, Enter opens it, Enter shows a version's files, R restore
7171 expect(await drive(alice, [...open, "\r", "\r"])).toContain("page.txt");
7272
7373 // Restore makes a new version from the chosen one; the branch keeps both.
74 await drive(alice, [...open, "\r", "R", "\r"]);
74 await drive(alice, [...open, "\r", "U", "\r"]);
7575 expect((await versionsIn(app, repo, build)).map((v) => v.subject)).toEqual(["Add recipes", "Restore v1"]);
7676
7777 // Publish merges to main, where the page reads it.
test/tui-talk-chats.test.ts +2 −2
@@ -311,7 +311,7 @@ describe("the terminal's conversations screen", () => {
311311 expect(text).not.toContain("Asks ·");
312312 });
313313
314 test("turns are read when the chat opens and on r, not on every draw", async () => {
314 test("turns are read when the chat opens and on R, not on every draw", async () => {
315315 const made = createConversation(app.db, bob.id);
316316 if (!made.ok) throw new Error(made.error);
317317 appendTurn(app.db, bob.id, made.value.id, { role: "person", text: "first words" });
@@ -323,7 +323,7 @@ describe("the terminal's conversations screen", () => {
323323 terminal.feed("p"); await settleApp(tui);
324324 terminal.feed("p"); await settleApp(tui);
325325 expect(tui.screen.toText()).not.toContain("later words");
326 terminal.feed("r"); await settleApp(tui);
326 terminal.feed("R"); await settleApp(tui);
327327 expect(tui.screen.toText()).toContain("later words");
328328 tui.stop?.();
329329 });
test/tui-workflows.test.ts +3 −3
@@ -263,7 +263,7 @@ describe("reviews, threads and the merge gate", () => {
263263 try {
264264 await h.settle();
265265 await openThePull(h);
266 await h.press("R");
266 await h.press("b");
267267 await h.until("Review #1");
268268 const card = h.text();
269269 expect(card).toContain("request changes");
@@ -281,7 +281,7 @@ describe("reviews, threads and the merge gate", () => {
281281 try {
282282 await h.settle();
283283 await openThePull(h);
284 await h.press("R");
284 await h.press("b");
285285 await h.until("Review #1");
286286 // Bob is not the author, so approving is on offer and is the default.
287287 expect(h.text()).toContain("approve");
@@ -347,7 +347,7 @@ describe("reviews, threads and the merge gate", () => {
347347 try {
348348 await reviewer.settle();
349349 await openThePull(reviewer);
350 await reviewer.press("R");
350 await reviewer.press("b");
351351 await reviewer.until("Review #1");
352352 await reviewer.press("ctrl+d");
353353 await reviewer.settle();
test/tui-yours-asks.test.ts +2 −2
@@ -114,7 +114,7 @@ describe("terminal On you: the week's asks", () => {
114114 expect(await screen(alice)).toContain(asksMeasureWords(m));
115115 });
116116
117 test("drawing reads the ledger on load, not on every frame: a later row waits for r", async () => {
117 test("drawing reads the ledger on load, not on every frame: a later row waits for R", async () => {
118118 const t = await open(alice);
119119 try {
120120 const before = t.text();
@@ -123,7 +123,7 @@ describe("terminal On you: the week's asks", () => {
123123 t.app.frame();
124124 t.app.screen.toText();
125125 expect(t.text()).toContain("4 raised");
126 await t.key("r");
126 await t.key("R");
127127 expect(t.text()).toContain("5 raised");
128128 } finally {
129129 t.app.stop();
test/web-code.test.ts +2 −2
@@ -320,9 +320,9 @@ describe("the code browser on the web", () => {
320320
321321 test("the finder is offered as an enhancement with the explorer behind it", async () => {
322322 const html = await text("/alice/beacon/blob/main/src/lamp.ts");
323 // The button that needs a script says so, and carries its shortcut.
323 // The button that needs a script says so, and carries its shortcut: the keymap's f.
324324 expect(html).toContain('class="btn js-only"');
325 expect(html).toContain('data-shortcut="t"');
325 expect(html).toContain('data-shortcut="f"');
326326 expect(html).toContain('id="finder"');
327327 // The fallback is a real, populated tree of links in the same page.
328328 expect(html).toContain('class="ex-file"');

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs