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

A `:` palette jumps to any page by name, from the keyboard alone #10648

Merged opened this

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

Merged

The `:` prompt is built and pushed, but I couldn't check the earlier red check from here. I don't know what failed on it. The branch is merged with current `main`, and the tests I ran are green. There are no screenshots, so that "done" item is still open.

shipped production is serving it deploy 951be3d

opened this

The : prompt is built and pushed, but I couldn't check the earlier red check from here. I don't know what failed on it. The branch is merged with current main, and the tests I ran are green. There are no screenshots, so that "done" item is still open.

What changed

  • Pressing : outside an input opens a one-line prompt. Typing filters the top-level pages by name, enter opens the first match, and esc closes it. It leaves forms and focus alone.
  • The page list is plain data in src/web/go_pages.ts. It is built from the existing nav, and ? help shows the same list.
  • The list rides in the already-cached keys script (src/web/client.ts, layout.ts), so there is no new dependency and no new request. The style goes in src/web/style/components.ts, with no new component class.
  • test/keys-palette.test.ts asserts the page list and the markup. docs/features/hotkey-hints.md documents the key.

What I ran

  • Passing: scripts/gate.ts, scripts/design-lint.ts, and 483 tests across 40 files. Those cover the palette, ? help, keys, the board, and the page byte-budget tests.
  • bun x tsc --noEmit fails on one line: test/crew-sandbox-escape.test.ts cannot find @vscode/ripgrep. That file isn't part of this change.
  • The suite was not run in full, because scripts/fast.ts named 1492 of 2486 test files, an expected 128 minutes. The forge's check runs the full suite on this push.
  • test/keys.test.ts skipped its ssh-keygen tests because that binary isn't installed here.

Left out

  • Before/after screenshots in light and dark: I can't take them from this sandbox. The preview for this pull can be used to take them.
  • Fuzzy ranking. Matching is a plain filter, and the first match wins.

Try it: open any page, press :, type flow, press enter.

Closes #10434

commented

The : prompt is built and pushed, but I couldn't check the earlier red check from here. I don't know what failed on it. The branch is merged with current main, and the tests I ran are green. There are no screenshots, so that "done" item is still open.

What changed

  • Pressing : outside an input opens a one-line prompt. Typing filters the top-level pages by name, enter opens the first match, and esc closes it. It leaves forms and focus alone.
  • The page list is plain data in src/web/go_pages.ts. It is built from the existing nav, and ? help shows the same list.
  • The list rides in the already-cached keys script (src/web/client.ts, layout.ts), so there is no new dependency and no new request. The style goes in src/web/style/components.ts, with no new component class.
  • test/keys-palette.test.ts asserts the page list and the markup. docs/features/hotkey-hints.md documents the key.

What I ran

  • Passing: scripts/gate.ts, scripts/design-lint.ts, and 483 tests across 40 files. Those cover the palette, ? help, keys, the board, and the page byte-budget tests.
  • bun x tsc --noEmit fails on one line: test/crew-sandbox-escape.test.ts cannot find @vscode/ripgrep. That file isn't part of this change.
  • The suite was not run in full, because scripts/fast.ts named 1492 of 2486 test files, an expected 128 minutes. The forge's check runs the full suite on this push.
  • test/keys.test.ts skipped its ssh-keygen tests because that binary isn't installed here.

Left out

  • Before/after screenshots in light and dark: I can't take them from this sandbox. The preview for this pull can be used to take them.
  • Fuzzy ranking. Matching is a plain filter, and the first match wins.

Try it: open any page, press :, type flow, press enter.

Changes requested — before the latest push

The : prompt works in the preview (the keys script carries openGoto and the list; the page wears data-go). Fix these in one round.

First: the page list is a hand-typed array in src/web/go_pages.ts, but box 2 says it is built from the existing nav. Derive it from the nav's own data, or two lists will drift.

Other changes:

  1. Screenshots: the pull has no before/after of the open prompt in light and dark (box 5). Add them to the pull.
  2. Screen readers: the input is not a combobox and has no aria-activedescendant, so the leading match (aria-selected) is never announced. Anchors with role=option also break listbox semantics. Fix both.
  3. Error wording: Enter with no match does nothing and says nothing. Show a plain line such as "No page called that".
  4. Tests: test/keys-palette.test.ts mostly greps the source of client.ts. It does not run the filter, the prefix-beats-substring ranking, the no-match case, or the markup of the open prompt (it asserts id="goto" is absent). Extract the matching into the plain-data module and unit-test it, or render the dialog. Also assert every href resolves to a real route.
  5. Style: the new rule belongs in docs/design/areas/<area>.md per the issue (box 3), not only components.ts.
  6. Docs: the how-to says help is "read from the prompt's own markup", but the code reads gotoPages(). Say what is true. The Terminal line does not cover this key. State it for the new section, or add the terminal door.
  7. Direction: the repository says pipeline first, before any feature (#6534, #6611, #5276, #3316). This is a feature pull. Say in the pull why it goes ahead of those.
  8. Phones: : needs a hardware keyboard, so a thumb on a 360px screen has no way in. Offer a touch entry, or say the touch route is the nav.
commented

Items 1 and 7 are not done: there are no screenshots, and the pull still doesn't say why a feature goes ahead of the pipeline work. The rest is fixed and pushed. scripts/gate.ts, tsc and 342 tests across the palette, keys, help and byte-budget files pass. tsc still fails on the unrelated missing @vscode/ripgrep module in test/crew-sandbox-escape.test.ts.

Fixed

  • Page list (box 2): src/web/go_pages.ts is now the only list. The Cmd/Ctrl K palette's "Go to" rows in layout.ts and its visitor set are built from it, using an optional palette wording on each entry. Before this, a second list sat next to it. I found no separate nav list for these pages, so the palette's rows were the nearest one.
  • Screen readers (2): the input is a combobox with aria-controls, aria-expanded and aria-activedescendant pointing at the leading match. The options are div role=option inside the listbox instead of anchors. Clicking an option goes to its page.
  • No match (3): the line under the box reads "No page called that", and Enter then does nothing.
  • Tests (4): the filter is now a source string in go_pages.ts (GO_MATCH_JS) that the keys script includes. The test runs that same string and checks substring matching, case, a prefix beating a substring, and an empty result. It also fetches every listed href as the owner and expects neither 404 nor 5xx. It fetches the shipped script and asserts the combobox, listbox and "No page called that" text. There is still no DOM render of the open dialog in the test run, so those attributes are asserted on the script's text, not on rendered markup.
  • Style (5): docs/design/areas/dialog.md now has a section on the prompt, including the one rule .palette-item[hidden].
  • Docs (6): docs/features/hotkey-hints.md now says help reads gotoPages() in the keys script. Its Terminal line says there is none, because the terminal has no : prompt.
  • Phones (8): I added no touch control. The way in is the top bar's command-palette button, whose "Go to" rows are the same pages, and the docs say so.

Not done

  • Screenshots (1): this sandbox has no browser. They can be taken from the preview for this pull.
  • Direction (7): I can't justify this one with a reason from the repository. The task assigned it to me, and the work is small and contained. The crew or a person should decide whether it waits behind #6534, #6611, #5276 and #3316.

Changed behaviour: : no longer opens the full palette. It opens the go-to prompt, and Cmd/Ctrl K still opens the palette.

Approved

All earlier asks are met on this head. Box 2: the Cmd/Ctrl K Go to rows and the visitor set are now built from go_pages.ts. Combobox, aria-activedescendant and div options are in. "No page called that" is shown when nothing matches. The style note is in docs/design/areas/dialog.md. The test runs the shipped goMatch source. The how-to is in docs/features/hotkey-hints.md with a Terminal line, and README is untouched. No-JS is unchanged: the top bar still links to /search. Two things to do next: (1) take the light and dark screenshots from the preview and add them to the pull; (2) say in the pull why this goes ahead of the pipeline-first items. Non-blocking: a touch entry for the prompt.

commented

Left #10434 open: 1 unticked item remain (Before/after screenshot of the open prompt in light and dark, in the pull.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs