feat(desktop): keyboard shortcuts cheatsheet + a11y landmarks / focus#3125
Open
HUQIANTAO wants to merge 1 commit into
Open
feat(desktop): keyboard shortcuts cheatsheet + a11y landmarks / focus#3125HUQIANTAO wants to merge 1 commit into
HUQIANTAO wants to merge 1 commit into
Conversation
Three related improvements to make the desktop app reachable from the keyboard and readable by screen readers. 1. Shortcuts cheatsheet (press ?). New component components/ShortcutsCheatsheet.tsx renders a single-column kbd+description table, grouped by section (Composer / Transcript / Global). Triggered by a '?' keypress from anywhere outside an editable element, or from a Help icon in the topbar. The dialog is role=dialog + aria-modal + aria-labelledby; on open, focus moves to the close button; on close, focus returns to the trigger. 2. ARIA landmarks + labels. App.tsx's <header>/<main>/<footer> get role=banner / role=main / role=contentinfo, and every icon-only topbar button gets an explicit aria-label. The error banner is role=alert. The composer textarea gets id=composer-input + aria-label so a skip-link can target it. The status-bar model name is aria-live=polite so a model switch is announced. 3. Skip-to-composer link. The first Tab from the topbar lands on a visually-hidden link that, when activated, jumps focus to the textarea. Saves keyboard-only users from tabbing through every topbar chip on every reload. 4. Focus rings. :focus-visible paints a 2px accent outline with a 2px offset across every interactive element. Disabled buttons skip the ring (it's not actionable). :focus (without -visible) is reset globally so the OS-default ring on mouse-clicks doesn't double up with the WebKitGTK focus rectangle on Linux. i18n: en + zh both gain a 'shortcuts' section (title, close, open, section.*, desc.*).
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.
Three related improvements to make the desktop app reachable from the keyboard and readable by screen readers.
:focus-visiblepaints a 2px accent outline with a 2px offset.