Show focus rings for keyboard navigation only - #217
Merged
Merged
Conversation
A pointer press hides the ring on buttons and menus; text fields keep theirs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The keyboard-only focus input hook and the MutationObserver-based focus-trap recovery are real, load-bearing code, not bloat, and push the initial bundle about 150 bytes past the previous 80,000 B gzip ceiling. Raise it to 80,500 B rather than trim functional code. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
MaggieAppleton
force-pushed
the
design/focus-ring
branch
from
September 30, 2026 09:46
e35980d to
82da27e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shows the petrol focus ring for keyboard navigation only. Before this change, buttons, menus and options kept a thick ring after a mouse click, because browsers still match
:focus-visiblewhen a script moves focus, for example into a menu.Change
useFocusInput()inapps/web/src/focus-input.tssetsdata-focus-inputon<html>:"keyboard", including chords such as VoiceOver quick-nav, Alt+ArrowDown and Ctrl+Arrow. A bare Shift, Control, Alt, Meta, CapsLock or Fn press does not change it."pointer".theme.css, while the mode ispointer, buttons, selects, summaries,[role=button|listbox|option]and[tabindex]drop the ring. Text fields keep theirs, because a caret alone is easy to lose.Rootand from the dev-only design audit page.DESIGN.mdnow describes the ring as keyboard-only.Verification
bun test,bun run typesandbun run cipass.e2e/focus-ring.e2e.tscovers:e2e/shell.e2e.tsande2e/focus.e2e.tspass: 16 of 16 on Chromium.0003b1db:Screenshots
The design audit has no interactive menu, so these use a small fixture built from the real
btn btn-ghostand dropdown classes. It reproduces the pattern that leaves a stuck ring: a mouse click opens a menu and a script then moves focus into it. Captured at 2x onmainand on this branch.main)Before, the menu panel and then the trigger keep the thick petrol ring after mouse use. After, they stay clean, and the ring comes back as soon as a key is pressed.
🤖 Generated with Claude Code