Skip to content

fix(web): inert the collapsed sidebar so off-screen nav leaves the a11y tree (BUG-2282)#1011

Merged
xarmian merged 1 commit into
mainfrom
fix/bug-2282-sidebar-inert-collapsed
Jul 23, 2026
Merged

fix(web): inert the collapsed sidebar so off-screen nav leaves the a11y tree (BUG-2282)#1011
xarmian merged 1 commit into
mainfrom
fix/bug-2282-sidebar-inert-collapsed

Conversation

@xarmian

@xarmian xarmian commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

BUG-2282

The mobile sidebar drawer collapses via transform: translateX(...) + pointer-events: none, but nothing removed it from the accessibility tree or tab order — so a screen-reader virtual cursor and keyboard Tab still reached its off-screen nav links.

Fix

One attribute on <aside class="sidebar">:

inert={!uiStore.sidebarOpen}

Bound to the same !sidebarOpen condition that already drives class:collapsed and the .sidebar.collapsed { pointer-events: none } rule. A collapsed drawer now leaves both the a11y tree and the focus order — covering the mobile drawer and the latent desktop width:0 collapse (same keyboard-focus gap). Plus an explanatory comment.

Safe: the re-open control lives in TopBar.svelte (toggleSidebar), outside the aside — nothing is trapped. Swipe-to-open is a <svelte:window> handler (not on the aside); the aside's own touch handlers only do swipe-to-close (open-state only).

Verification

  • svelte-check: 0 errors. make install: clean.

  • Playwright runtime verify (real browser, cookie session):

    Case inert link focusable
    Mobile collapsed (the bug) true focus refused ✓
    Mobile opened false focusable ✓
    Desktop default (open) false — no regression ✓ focusable ✓
    Desktop collapsed true refused ✓
  • 6-lens adversarial review (trap / gestures / Svelte-correctness / desktop-regression / a11y+e2e / timing): 6/6 OK, 0 confirmed defects. Confirmed inert is in Svelte 5's DOM_BOOLEAN_ATTRIBUTES (removed when false, never rendered as inert="false"), no e2e test focuses/clicks sidebar nav while collapsed, and the mobile-and-desktop condition is correct (a mobile-only guard would reintroduce the bug on desktop).

Follow-up

UP-2285 (low, keyboard) — optional focus handoff to the TopBar toggle on keyboard-driven collapse (currently focus drops to <body>, standard inert behavior; not a regression).

https://claude.ai/code/session_01EZ6yr6pAUFb1uffan912ra

…1y tree (BUG-2282)

The mobile sidebar drawer collapses via translateX + pointer-events:none but
stayed in the accessibility tree and tab order, so a screen-reader virtual
cursor and keyboard Tab still reached its off-screen nav links. Bind `inert` to
the same !sidebarOpen condition that drives the collapse class + the existing
pointer-events:none rule, so a collapsed drawer leaves both the a11y tree and
the focus order — covering the mobile drawer and the latent desktop width:0
collapse. The re-open control lives in TopBar (outside the aside) so nothing is
trapped; swipe-to-open is a window handler, unaffected.

Claude-Session: https://claude.ai/code/session_01EZ6yr6pAUFb1uffan912ra
@xarmian
xarmian merged commit ccf7daf into main Jul 23, 2026
6 checks passed
@xarmian
xarmian deleted the fix/bug-2282-sidebar-inert-collapsed branch July 23, 2026 03:57
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.

1 participant