A11Y - Support Escape back navigation#1778
Open
bartbunting wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Escape-key handling to enable VoiceOver “scrub/back” navigation from detail and settings subpages, while attempting to avoid interfering with dialogs/menus/overlays and other interactive UI.
Changes:
- Add a document-level
keydownEscape handler inInfoHeader.vueto trigger existing back navigation logic from detail pages. - Add a document-level
keydownEscape handler inSettings.vueto return from settings subpages to the settings overview (or history-back when available). - Add overlay/editability checks to reduce conflicts with modal/menu/input behavior (currently more complete in
InfoHeader.vuethanSettings.vue).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/components/InfoHeader.vue | Adds Escape-to-navigate-back behavior for detail headers with overlay/input guardrails. |
| src/views/settings/Settings.vue | Adds Escape-to-return behavior from settings subroutes with overlay/dialog guardrails. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+661
to
+666
| const handleSettingsEscape = function (event: KeyboardEvent) { | ||
| if (event.defaultPrevented || event.key !== "Escape") return; | ||
| if (isOverview.value || store.dialogActive || hasActiveOverlay()) return; | ||
|
|
||
| event.preventDefault(); | ||
| returnFromSettingsSubpage(); |
Comment on lines
+625
to
+637
| const handleEscapeBack = function (event: KeyboardEvent) { | ||
| if (event.defaultPrevented || event.key !== "Escape") return; | ||
| if ( | ||
| hasActiveOverlay() || | ||
| isEditableEscapeTarget(event.target) || | ||
| isEditableEscapeTarget(document.activeElement) | ||
| ) { | ||
| return; | ||
| } | ||
|
|
||
| event.preventDefault(); | ||
| backButtonClick(); | ||
| }; |
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.
Summary
Adds Escape-key handling for detail and settings pages so VoiceOver’s scrub/back gesture can navigate back from those views. This is important for ease of navigation when using VoiceOver as without it the user needs to manualy locate the back button with their finger which is very inefficient.
The handler avoids taking over Escape when a dialog, menu, overlay, player menu, or editable control is active, so existing modal/menu/input behavior should continue to take priority.
Files changed
src/components/InfoHeader.vuesrc/views/settings/Settings.vueTesting
git diff --checkyarn buildyarn lintyarn test:runI also tested this with VoiceOver on detail and settings pages.
AI usage
I used OpenAI Codex as an assistive tool while preparing this PR. I reviewed and tested the final change and am responsible for the submitted code.