Public: anyone can read this; the crew can change it.
The toolbar's panel closes on Escape and returns focus to the button that opened it #13596
Check · Review · Land · Live done — Landed and live in production.
The behaviour in #13586 already holds, so this pull changes only test/toolbar-keyboard.test.ts and nothing under src/. I couldn't run the browser test here (no Chromium that starts in this sandbox), so the new test has not run anywhere yet. bun x tsc --noEmit and bun scripts/gate.ts --fix came back clean.
shipped production is serving it deploy 8e1361f
The behaviour in #13586 already holds, so this pull changes only test/toolbar-keyboard.test.ts and nothing under src/. I couldn't run the browser test here (no Chromium that starts in this sandbox), so the new test has not run anywhere yet. bun x tsc --noEmit and bun scripts/gate.ts --fix came back clean. bun test on the keyboard and budget files gave 11 pass and 5 skipped (the Chromium tests). I did not run bun scripts/design-lint.ts, since nothing under src/web/ changed. The branch is pushed; the forge's check will run the browser test.
What already held
- Escape and focus: Escape closes the open panel and focus returns to the pill. The existing browser test and a script test cover both.
- Closed panel:
set(open)setspanel.hiddenanddisplay:none, so the controls inside a closed panel are not rendered and cannot take focus.
What I added
- Browser test: after Enter then Escape, none of the closed panel's controls is rendered. Tab then moves focus off the toolbar to the page.
- Script test: the shipped script ties
panel.hiddenanddisplay: nonetogether, so Tab can't reach a closed panel's controls. If someone later swapsdisplayfor something that keeps the panel in the tab order, this test fails.
The script is untouched, so it stays inside the budget test/toolbar-budget.test.ts names.
Not done
- No change to
forge_pill.ts. It doesn't exist; the toolbar script issrc/apps/toolbar.ts. - No both-doors or look work, since there is no
src/web/change. The commit line saysNo look: test-only change.
To try it: bun test test/toolbar-keyboard.test.ts on a machine with Chromium.
🤖 Generated with Claude Code
Test-only pull; src/apps/toolbar.ts already does what the issue asks (Escape closes, focus returns to the pill, closed panel is display:none so its controls leave the tab order). I confirmed set() at toolbar.ts:565-566 matches the new regex. No src/web, no new dependency, README untouched, no new door needed. Two things I would do next: (1) the regex test pins source text, so reformatting set() breaks it while behaviour is fine; the browser test already proves the outcome, so drop or loosen the regex to match the behaviour. (2) The browser test is skipped without Chromium and was never run by the author; confirm in the forge check log that it ran rather than skipped. Not blocking: this is outside the pipeline-first list but is a small single-purpose regression guard.
The behaviour in #13586 already holds, so this pull changes only
test/toolbar-keyboard.test.tsand nothing undersrc/. I couldn't run the browser test here (no Chromium that starts in this sandbox), so the new test has not run anywhere yet.bun x tsc --noEmitandbun scripts/gate.ts --fixcame back clean.bun teston the keyboard and budget files gave 11 pass and 5 skipped (the Chromium tests). I did not runbun scripts/design-lint.ts, since nothing undersrc/web/changed. The branch is pushed; the forge's check will run the browser test.What already held
set(open)setspanel.hiddenanddisplay:none, so the controls inside a closed panel are not rendered and cannot take focus.What I added
panel.hiddenanddisplay: nonetogether, so Tab can't reach a closed panel's controls. If someone later swapsdisplayfor something that keeps the panel in the tab order, this test fails.The script is untouched, so it stays inside the budget
test/toolbar-budget.test.tsnames.Not done
forge_pill.ts. It doesn't exist; the toolbar script issrc/apps/toolbar.ts.src/web/change. The commit line saysNo look: test-only change.To try it:
bun test test/toolbar-keyboard.test.tson a machine with Chromium.🤖 Generated with Claude Code
Closes #13586