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

`:` opens the command palette, and a test proves the `?` help lists every key the page answers #6780

Merged opened this

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

Merged

Pressing `:` outside a field now opens the command palette, and a new test fails when the keyboard handler and the `?` help disagree. The new test file passes, the type check is clean, `design-lint` passes and the XSS suite still passes. I didn't run the rest of the suite; the forge runs the full check on push.

shipped production is serving it deploy ef63cd6

opened this

Pressing : outside a field now opens the command palette, and a new test fails when the keyboard handler and the ? help disagree. The new test file passes, the type check is clean, design-lint passes and the XSS suite still passes. I didn't run the rest of the suite; the forge runs the full check on push.

  • Handler: : calls openPalette() in the document keydown handler in src/web/client.ts. Inside a field it still types a colon, because the field early-return comes first. Cmd/Ctrl K is unchanged.
  • Help: STATIC_KEYS has a new row, : → "Command palette".
  • Test: test/help-keys.test.ts reads src/web/client.ts as text and compares the e.key === '…' keys in that handler with the STATIC_KEYS rows, in both directions. It also checks that the : branch and its help row exist.
  • c: c is answered by the handler but its help row is added per page by pageKeys(), not by STATIC_KEYS. The test counts it as listed when pageKeys() still pushes a c row.

The test finds the handler and the help block by text markers (the // ---- help overlay comment and the var STATIC_KEYS line), so renaming either breaks the test loudly instead of passing quietly. I didn't test the keystroke in a browser.

Closes #6748

commented

Pressing : outside a field now opens the command palette, and a new test fails when the keyboard handler and the ? help disagree. The new test file passes, the type check is clean, design-lint passes and the XSS suite still passes. I didn't run the rest of the suite; the forge runs the full check on push.

  • Handler: : calls openPalette() in the document keydown handler in src/web/client.ts. Inside a field it still types a colon, because the field early-return comes first. Cmd/Ctrl K is unchanged.
  • Help: STATIC_KEYS has a new row, : → "Command palette".
  • Test: test/help-keys.test.ts reads src/web/client.ts as text and compares the e.key === '…' keys in that handler with the STATIC_KEYS rows, in both directions. It also checks that the : branch and its help row exist.
  • c: c is answered by the handler but its help row is added per page by pageKeys(), not by STATIC_KEYS. The test counts it as listed when pageKeys() still pushes a c row.

The test finds the handler and the help block by text markers (the // ---- help overlay comment and the var STATIC_KEYS line), so renaming either breaks the test loudly instead of passing quietly. I didn't test the keystroke in a browser.

Approved

Small and single-purpose. : opens the palette only after the field early-return, so typing a colon in a box is untouched. Cmd/Ctrl K is unchanged. The help row is listed and the handler/help drift test runs in both directions. I read the source only: the served preview HTML carries none of the client script inline, so I did not exercise the keystroke. Two things I would do next: (1) fold : into the existing palette row as Cmd/Ctrl K or : so the overlay does not list "Command palette" twice, which the test already tolerates since named splits on or; (2) add one DOM-level check of the keystroke, because the text-matching test cannot tell a dead branch from a live one.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs