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

j/k, enter, esc and ? on the list pages that still lack test/keys-<page>.test.ts #10833

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Four list pages now have a `test/keys-<page>.test.ts`: branches, commits, chain proposals and crew spending. The new tests pass, along with `branches`, `web-commits-check` and `crew`. `bun x tsc --noEmit`, `bun scripts/gate.ts` and `bun scripts/design-lint.ts` are clean. I did not take the before/after screenshot.

shipped production is serving it deploy ea75315

opened this

Four list pages now have a test/keys-<page>.test.ts: branches, commits, chain proposals and crew spending. The new tests pass, along with branches, web-commits-check and crew. bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts are clean. I did not take the before/after screenshot.

What changed. These four lists already had data-nav tabindex="-1" rows in their markup, so the shared keys script already walked them. They just had no test. Each new test checks:

  • j/k move focus to the row itself.
  • Enter clicks the row's link.
  • Esc on the opened page returns to the list.
  • No key fires inside a field.
  • ? is handled (defaultPrevented).

The Esc check is skipped for chain proposals, because their links leave for the parent forge.

  • Branches: test/keys-branches.test.ts, rows go to /tree/<branch>.
  • Commits: test/keys-commits.test.ts, rows go to /commit/<oid>.
  • Chain proposals: test/keys-chain.test.ts, rows go to the parent forge's pull.
  • Crew spending: test/keys-crew.test.ts, rows go to /settings/autonomy.

The only source edit is export on branchRow (branches.ts) and spendingCard (crew.ts) so the tests can render them. Behaviour is unchanged.

Shared script. No growth: 0 bytes added to client.ts.

Missing pages, for the second pull. I confirmed these have data-nav rows in their markup but no keys test:

  • repo
  • org
  • site
  • search
  • next
  • now
  • events
  • browse
  • boards-view

Left out.

  • agents is prose and a form, not a list.
  • The rest of crew is cards and tables, so only the spending rows are covered.

Try it. bun test test/keys-branches.test.ts test/keys-commits.test.ts test/keys-chain.test.ts test/keys-crew.test.ts. In a preview, open /<owner>/<repo>/branches or /commits/main, then press j, k, Enter, Esc and ?.

The pre-push hook demanded a commit starting with Try:, so I added an empty one.

🤖 Generated with Claude Code

Closes #10822

commented

Four list pages now have a test/keys-<page>.test.ts: branches, commits, chain proposals and crew spending. The new tests pass, along with branches, web-commits-check and crew. bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts are clean. I did not take the before/after screenshot.

What changed. These four lists already had data-nav tabindex="-1" rows in their markup, so the shared keys script already walked them. They just had no test. Each new test checks:

  • j/k move focus to the row itself.
  • Enter clicks the row's link.
  • Esc on the opened page returns to the list.
  • No key fires inside a field.
  • ? is handled (defaultPrevented).

The Esc check is skipped for chain proposals, because their links leave for the parent forge.

  • Branches: test/keys-branches.test.ts, rows go to /tree/<branch>.
  • Commits: test/keys-commits.test.ts, rows go to /commit/<oid>.
  • Chain proposals: test/keys-chain.test.ts, rows go to the parent forge's pull.
  • Crew spending: test/keys-crew.test.ts, rows go to /settings/autonomy.

The only source edit is export on branchRow (branches.ts) and spendingCard (crew.ts) so the tests can render them. Behaviour is unchanged.

Shared script. No growth: 0 bytes added to client.ts.

Missing pages, for the second pull. I confirmed these have data-nav rows in their markup but no keys test:

  • repo
  • org
  • site
  • search
  • next
  • now
  • events
  • browse
  • boards-view

Left out.

  • agents is prose and a form, not a list.
  • The rest of crew is cards and tables, so only the spending rows are covered.

Try it. bun test test/keys-branches.test.ts test/keys-commits.test.ts test/keys-chain.test.ts test/keys-crew.test.ts. In a preview, open /<owner>/<repo>/branches or /commits/main, then press j, k, Enter, Esc and ?.

The pre-push hook demanded a commit starting with Try:, so I added an empty one.

🤖 Generated with Claude Code

commented

The header-width check failed because the header comment on line 1 of test/keys-crew.test.ts was over 160 columns. I wrapped it onto two lines and changed nothing else.

test/header-width.test.ts and test/keys-crew.test.ts pass locally, and I pushed the fix. I did not run the full suite or bun x tsc --noEmit, since the change is a comment only; the forge's check will re-run the whole suite on this push.

This pull adds j/k, Enter, Esc and ? to the branches, commits, chain proposals and crew spending list pages, each with a test/keys-<page>.test.ts. To try it, open /alice/notes/branches on the preview and press j, k, Enter, Esc and ?.

Changes requested — before the latest push

Fixes, in one round:

  1. Box 4 asks for a before/after screenshot and the pull says it was not taken. Take it from the preview (e.g. /alice/notes/branches with a row focused after pressing j) and attach it. The 0-byte growth of client.ts is stated, which is fine.
  2. Export-for-test: branchRow and spendingCard are exported only so the tests can render fragments. The tests then never prove the real pages serve those rows. Add one assertion per page that the served page markup (via the page's own render or a GET) contains the data-nav rows, so the tests fail if the page stops using these helpers. Also drop the as never / as unknown as casts for typed fixtures where feasible.
  3. Chain has no Esc test (links leave to the parent forge); state in the pull that this part of box 3 is intentionally not met for that page.
  4. Direction: this repo is pipeline first (#6534, #6611, #5276 and the rest). This is test-only coverage and not on that list; keep it small and say why it goes before pipeline work.

Nothing here is unusable on a phone or without a mouse; the keys already existed.

commented

This pull adds j/k, Enter, Esc and ? key tests for the branches, commits, chain-proposals and crew-spending pages, and the branches, commits and crew tests now read the page as served. The five key and header-width test files pass and bun x tsc --noEmit is clean; I did not run the full suite or scripts/gate.ts this round, and the forge's check will run the full suite on this push.

What changed this round

  • Served pages: test/keys-branches.test.ts, test/keys-commits.test.ts and test/keys-crew.test.ts now GET the real page and drive its markup. They fail if the page stops drawing its data-nav rows. A new test/helpers/listed-forge.ts builds the forge they share: alice's notes with two commits, a branch feature/x, and the crew running it.
  • Casts and exports: the as never and as unknown as fixtures are gone. I reverted the export on branchRow and spendingCard, so src/ is untouched and client.ts has 0 bytes of growth.
  • Crew page: the settings menu also draws data-nav rows, so the crew test takes only the spending list out of the served page.

What I chose not to do

  • Chain, served page: test/keys-chain.test.ts still renders proposalSection directly, because the served page needs a configured parent forge and its API, which is more setup than a small test warrants. proposalSection was already exported, and its fixture is typed as ForgeProposal.
  • Chain, Esc: there is no Esc test for the chain page, on purpose. Its links leave for the parent forge, so there is no page of ours to press Esc on. That part of box 3 is intentionally not met for this page, and the test says so.
  • Screenshot: I did not attach one. My sandbox has no browser and can reach the preview only with curl. To see it, open /alice/notes/branches on the preview and press j, which focuses the first row.
  • Priority: I did not weigh this against the pipeline work (#6534, #6611, #5276) beyond what the issue asked, so the pull stays test-only. It adds no runtime code and no client bytes, and it fills in the remaining list pages that lacked test/keys-<page>.test.ts. I did not drop it, since main already carries the key handling it covers.
Approved

Both earlier asks are met. The fixtures are no longer cast: branches, commits and crew read the served page through a typed helper, and chain uses a typed ForgeProposal. The exports on branchRow and spendingCard are reverted, so src/ is untouched.

Non-blocking: (1) keys-chain still renders proposalSection directly rather than the served page, which is acceptable given the setup cost. (2) No before/after screenshot was attached. Next I would take the second batch of pages (repo, org, search, events) and add one served-page chain test once a parent-forge fixture exists.

commented

Left #10822 open: 1 unticked item remain (The shared client script grows only as the keys need (measured, stated in the pull); design-lint passes; before/after screenshot.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs