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

`g` then a letter jumps between the forge's main pages from any page, as in k9s and lazygit #10963

opened this

Merged 24d 5h ago, live in production

g then a letter now jumps between the main pages from any page: g h home, g e explore, g f flow, g s system. The touched key tests, tsc and design-lint pass. I did not run scripts/gate.ts or the full suite.

Notes

opened this

g then a letter now jumps between the main pages from any page: g h home, g e explore, g f flow, g s system. The touched key tests, tsc and design-lint pass. I did not run scripts/gate.ts or the full suite. I did not exercise the jump in a browser; the key test checks the script's source.

  • One table. Each page in GO_PAGES (src/web/go_pages.ts) can carry a key. That list already drives the : prompt and the Cmd/Ctrl K "Go to" rows, so g is a third reader of it rather than a second list. I also bound g q to Asks and g t to Talk, which the top bar already answered, so the table is complete.
  • Script. The keys script in client.ts handles a pending g plus a letter. The pending g now times out after 1 s instead of 1.2 s. Fields and modifier keys were already ignored by the existing handler.
  • Unreachable targets. Only pages the viewer may open are considered. A stranger gets home and explore; flow needs a sign-in; system needs admin. A page the viewer cannot open does nothing.
  • ? sheet. It lists one g x → Go to … row per reachable jump, read from the same table. #10922 has not landed, so I added the rows to the existing sheet rather than waiting for it.
  • Tests. test/keys-goto.test.ts fails when a letter is bound twice, is not a single lowercase letter, or when home, flow, explore or system lose their binding. It also checks that a viewer is offered only the targets they can open. test/keys-palette.test.ts only had its row type widened.

I left out g i. There is no /inbox page; the viewer's inbox is Asks, already on g q. Say if you want g i as a second alias for Asks.

To try it, open /explore and press g then f, then g then h.

🤖 Generated with Claude Code

Closes #10948

3 earlier comments
commented

g then a letter now jumps between the main pages from any page: g h home, g e explore, g f flow, g s system. The touched key tests, tsc and design-lint pass. I did not run scripts/gate.ts or the full suite. I did not exercise the jump in a browser; the key test checks the script's source.

  • One table. Each page in GO_PAGES (src/web/go_pages.ts) can carry a key. That list already drives the : prompt and the Cmd/Ctrl K "Go to" rows, so g is a third reader of it rather than a second list. I also bound g q to Asks and g t to Talk, which the top bar already answered, so the table is complete.
  • Script. The keys script in client.ts handles a pending g plus a letter. The pending g now times out after 1 s instead of 1.2 s. Fields and modifier keys were already ignored by the existing handler.
  • Unreachable targets. Only pages the viewer may open are considered. A stranger gets home and explore; flow needs a sign-in; system needs admin. A page the viewer cannot open does nothing.
  • ? sheet. It lists one g x → Go to … row per reachable jump, read from the same table. #10922 has not landed, so I added the rows to the existing sheet rather than waiting for it.
  • Tests. test/keys-goto.test.ts fails when a letter is bound twice, is not a single lowercase letter, or when home, flow, explore or system lose their binding. It also checks that a viewer is offered only the targets they can open. test/keys-palette.test.ts only had its row type widened.

I left out g i. There is no /inbox page; the viewer's inbox is Asks, already on g q. Say if you want g i as a second alias for Asks.

To try it, open /explore and press g then f, then g then h.

🤖 Generated with Claude Code

commented

g then a letter now jumps between the main pages from any page: g h home, g e explore, g f flow, g s system. I merged origin/main into the branch. The two failing MCP tests are fixed, and both fixes are in test files. The touched key tests, the two failed tests and tsc pass here. I did not run scripts/gate.ts, and I did not re-run the full 13,667-test suite.

Why the check failed. Neither failure came from the key change; both also failed on main in my sandbox.

  • a token that may only read cannot write through any tool: the new flow tool (#10959) only writes on a drift update, and the test's generic write arguments made it a read. The test now gives flow those arguments.
  • a stall under a named job is read through system: the stall window was 5 s wide, so a request from boot fell inside it and took the blame instead of the job. The test now waits out boot, uses a 300 ms stall, and places the stall after the job.

What changed

  • One table: each page in GO_PAGES (src/web/go_pages.ts) can carry a key, and the keys script in client.ts reads g+letter from that table. This table also drives the : prompt and the Cmd/Ctrl K "Go to" rows. g q (Asks) and g t (Talk) are bound there too.
  • Timing and viewers: a pending g times out after 1 s. Only pages the viewer may open are considered: strangers get home and explore, flow needs a sign-in, system needs admin. Anything else does nothing.
  • ? sheet: it lists one g x row per reachable jump, read from the same table. #10922 has not landed, so I added the rows to the existing sheet.
  • Test: test/keys-goto.test.ts fails when a letter is bound twice or is not a lowercase letter, when home, flow, explore or system lose their binding, or when a viewer is offered a target they cannot open. It also checks the script source for the jump and the 1 s timeout. It does not run the script in a browser.

Left out: g i. There is no /inbox page; the inbox is Asks, already on g q. Say if you want g i as a second alias for Asks.

To try it: open /explore and press g then f to reach /flow, then g then h for home.

🤖 Generated with Claude Code

commented

g then a letter jumps from any page outside a field to Home, Explore, Flow, Asks, Talk or System, from the one GO_PAGES table. The changed tests, tsc, scripts/gate.ts and the design lint pass. I didn't run the full suite; the forge runs it on the push.

Review round

  • Tests: test/keys-goto.test.ts now runs the real keys script (shellJs) against a fake document instead of grepping its source. It checks that:
    • a stranger's g f does nothing;
    • a user's g f goes to /flow;
    • g h and g e work for everyone, and a user's g s does nothing;
    • an admin's g s goes to /system;
    • a pause over 1 s forgets the g;
    • Ctrl or Meta with g, and g typed in an input, jump nowhere.

    I broke the g check on purpose and two of the tests failed.

  • Docs: new docs/features/go-jumps.md lists the sequences and who gets each one. The terminal gets no g chord. Its screens are reached by their own menus, and g there already means "top" in lists or an action on a screen, so a global chord would collide.
  • MCP test edits: I kept the mcp-system-stalls and mcp-write-scope fixes, and they are unrelated to this issue. They are only there to keep the pipeline green, so they can be split into their own pull if you prefer. The stall test no longer sleeps a fixed 400 ms. It waits only what is left of 300 ms after the boot finished, which is usually nothing. I did not wait on the boot request itself, because the test can't tell when it ends.
  • g q and g t: I kept them. They are not extras: the top bar already wears g h, g q and g t as chords (layout.ts shows them in its hover hints), so they now work from anywhere. I stated this in the doc. I did not add it to the ? sheet itself, so the sheet still shows plain "Go to Asks" and "Go to Talk" rows without that reason.
commented

I merged main into the branch and pushed it. The pull now merges cleanly, bun x tsc --noEmit is clean, and the four affected test files pass: keys-goto, mcp-system-stalls, mcp-write-scope and keys-palette. I did not run the full suite; the forge runs it on the push.

Both conflicts were in tests where main had already fixed the same two failures as my earlier edits:

  • test/mcp-system-stalls.test.ts: I took main's version. It waits a fixed 320 ms so other tests' requests fall outside the stall window, in place of my shorter wait.
  • test/mcp-write-scope.test.ts: I took main's version, which has the same flow drift-update arguments as mine (the repo name differs).

The pull no longer touches either file, so the unrelated test fixes are out of this change. It is back to the g jumps, their tests, docs/features/go-jumps.md and the ? sheet rows.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs