Skip to content

fix(a11y): make the UI behind full-window overlays inert - #366

Merged
Hakanbaban53 merged 2 commits into
Zarestia-Dev:masterfrom
repires:fix/a11y-inert-behind-overlays
Nov 19, 2026
Merged

Hakanbaban53 merged 2 commits into
Zarestia-Dev:masterfrom
repires:fix/a11y-inert-behind-overlays

Conversation

@repires

@repires repires commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Follow-up from #354 (the "file browser overlay as a proper modal" item).

Problem

The main UI, Flow and the file browser open as full-window CDK overlays when they aren't the default view, and so does the file picker. The UI underneath stayed live:

  • Focus stayed on the (now hidden) button that opened the overlay.
  • Tab walked into controls you can't see.
  • Screen readers could still read the covered page.

Measured in the headless web UI on master: with the file browser open, focus stayed on the hidden "Local" button, and 14 of 40 Tab presses landed in the covered UI. After closing, focus ended up on an unrelated "Mount" tab.

Fix

CoveringOverlayService keeps a stack of the open full-window overlays:

  • Hides what's behind: everything behind the top one becomes inert. That's the app shell plus any earlier overlays, for example the dialog that opened the file picker.
  • Keeps later overlays live: menus, dialogs and snackbars opened after the top overlay stay interactive. Live regions (aria-live, such as the CDK announcer) are never made inert, so announcements still get through.
  • Moves focus: focus goes into the overlay, unless the overlay already focused something itself. On close it returns to where it was.
  • Workspace switches: a new workspace opens before the old one closes. The content stays covered throughout, and the new one inherits the old one's focus-return target, so focus doesn't return into a closed overlay.
  • Leaves other inert alone: it only clears inert that it set itself.

BaseSlideOverlayService (main UI, Flow) and NautilusService (file browser, picker) call cover() after attaching and uncover() when closing.

I kept it to inert and focus handling rather than role="dialog". These overlays are workspace switches, not dialogs, apart from the picker.

Tests

  • Unit tests (covering-overlay.service.spec.ts): inert and focus on open and close, focus the overlay already placed, stacking (only the top overlay and later ones stay live), a workspace replacing another, live regions, and pre-existing inert. The BaseSlideOverlayService spec mock gained the hostElement every real OverlayRef has.
  • In the browser (headless web UI driven with puppeteer):
    • File browser: opening it moves focus into the overlay and makes the app shell inert, 40 Tabs never reach the covered UI (master: 14), and closing it returns focus to "Local".
    • Flow (Ctrl+Alt+F): the same results.
  • Full suite: 256 files, 3662 tests pass, plus one flake. The lasso test timed out under a load average of 15 on 10 cores and passes on its own; test: lint test code in CI and speed up the lasso tests #365 makes it cheaper. ESLint, Prettier and ng build are clean.

The main UI, Flow and the file browser open as full-window overlays,
and so does the file picker, but the covered UI stayed focusable: focus
stayed on the button that opened the overlay, and Tab reached hidden
controls (14 of 40 presses with the file browser open). A small
service now makes everything behind the top overlay inert, moves focus
into the overlay, and returns it when the overlay closes. Overlays can
stack, so anything opened after the top one, and live regions, stay
reachable.
@Hakanbaban53

Copy link
Copy Markdown
Collaborator

I tested this myself, and can confirm the issue was reproducible. Pressing Tab could navigate to elements behind the overlay. With your changes, this works correctly now, and the background is no longer accessible. Looks good to me!

Thanks for fixing this!

@Hakanbaban53
Hakanbaban53 merged commit 7e38418 into Zarestia-Dev:master Nov 19, 2026
6 checks passed
Hakanbaban53 pushed a commit that referenced this pull request Nov 25, 2026
Findings from re-auditing master with axe (#354):
- Names that did not contain the visible text, which breaks speech
  input: the add-remote menu items (the app menu had this fixed in #355),
  the overview header's backend switch, the remote detail action pills
  and the Rclone Flags reset button. They are now named by their text;
  the longer wording stays as the tooltip. The backend switch's logo
  is decorative, and its unused aria string is removed.
- The remote config sidebar put aria-selected on navigation list items;
  the current step or profile is aria-current instead.
- About listed its pages as tabs, with a second tab list and dividers
  inside the first. They open sub-pages, so they are plain buttons.
- The general and Quick Run overviews added role="main" inside the
  workspace shell's <main>, so the page had two.
- The file browser as an overlay or picker had no main landmark: since
  #366 everything behind it is inert, so it is always the page's main.
- Remote card names were h4 under the h2 overview title; now h3.
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