Skip to content

A11Y - Support Escape back navigation#1778

Open
bartbunting wants to merge 1 commit into
music-assistant:mainfrom
bartbunting:bart/a11y-escape-back-navigation
Open

A11Y - Support Escape back navigation#1778
bartbunting wants to merge 1 commit into
music-assistant:mainfrom
bartbunting:bart/a11y-escape-back-navigation

Conversation

@bartbunting

Copy link
Copy Markdown
Contributor

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.vue
  • src/views/settings/Settings.vue

Testing

  • git diff --check
  • yarn build
  • yarn lint
  • yarn test:run

I 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 keydown Escape handler in InfoHeader.vue to trigger existing back navigation logic from detail pages.
  • Add a document-level keydown Escape handler in Settings.vue to 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.vue than Settings.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();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants