feat(a11y): keyboard accessibility & focus management for the answer bubble - #153
Open
zhongnansu wants to merge 1 commit into
Open
feat(a11y): keyboard accessibility & focus management for the answer bubble#153zhongnansu wants to merge 1 commit into
zhongnansu wants to merge 1 commit into
Conversation
The Shadow DOM answer bubble was effectively mouse-only. - Move focus into the relevant input when the bubble opens (preset/custom input, or follow-up input in response mode); delegatesFocus on the root. - Focus trap: Tab/Shift+Tab cycle within the bubble; Escape still closes. - Preset chips are keyboard-operable: role=button, tabindex=0, Enter/Space run the same path as click. - Visible :focus-visible outlines (2px #7c3aed) on chips, pin/close/history/ send buttons and inputs; copy button shows on focus, not only hover. - aria-label on icon-only buttons (screen readers ignore title). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
📦 PR Preview — Ask AI ExtensionVersion: PermissionsNo permission changes detected. ✅ Preview ChecklistBefore merging, manually test with the artifact above:
Updated by PR Preview Bot — workflow run |
Contributor
📊 Code Coverage Report
Threshold: 80% ✅ Coverage meets the minimum threshold. Updated by Code Coverage workflow |
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.
The inline answer bubble (Shadow DOM) was effectively unusable without a mouse — no keyboard navigation, no screen-reader labels, no visible focus rings, and preset chips responded only to clicks.
Changes (
src/content/bubble/core.js,styles.js)delegatesFocus: true(matches the existing trigger toolbar).role="button",tabindex="0", Enter/Space activate via the same path as click.:focus-visibleoutlines (2px#7c3aed) on chips, pin/close/history/send buttons and inputs. Copy button now appears on keyboard focus, not only hover.aria-label, since screen readers ignoretitle.Testing
tests/bubble.test.jspasses, with added tests for chip Enter/Space activation, focus-moves-to-input on open, and the Tab/Shift+Tab focus trap.🤖 Generated with Claude Code