Skip to content

fix(a11y): disambiguate "Go back" aria-labels across app - #295

Merged
h4yfans merged 1 commit into
mainfrom
interesting-darwin-d0743a
Apr 20, 2026
Merged

fix(a11y): disambiguate "Go back" aria-labels across app#295
h4yfans merged 1 commit into
mainfrom
interesting-darwin-d0743a

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

What

Rename the titlebar history nav and journal breadcrumb back-buttons so they no longer share aria-label="Go back" with the sidebar tag-detail drilldown.

Why

Three unrelated components rendered buttons with identical aria-label="Go back":

Because the titlebar is always mounted, opening the tag drilldown produced two DOM nodes matching button[aria-label="Go back"]. This is a strict-mode trap for Playwright (page.locator(...).click() would throw) and is bad a11y — screen readers announce identical labels for semantically distinct actions.

How

  • window-controls.tsx"Browser back" / "Browser forward" on the titlebar history pair.
  • date-breadcrumb.tsx"Journal back" on its internal BackButton (minimal one-line change; component is dead code today, but renaming defensively prevents the trap if wired up later).
  • Updated the matching unit test (window-controls.test.tsx) and e2e test (sidebar-window-controls.e2e.ts) to the new labels.
  • tag-detail-view.tsx keeps "Go back" — it's now the sole owner of that label, which matches the existing tags-rename-delete.e2e.ts selector cleanly with no filter hacks.

Type

  • fix — bug fix (a11y + test flake)

Test plan

  • Unit tests — window-controls.test.tsx 5/5 pass
  • E2E — tags-rename-delete.e2e.ts 2/2 pass (drilldown selector now uniquely matches)
  • E2E — sidebar-window-controls.e2e.ts 4/4 pass (new titlebar labels resolve)
  • pnpm typecheck:web passes
  • pnpm exec eslint clean on touched source files

Notes for reviewer

  • No changes to tag-detail-view.tsx — it keeps the short "Go back" label, which is now unambiguous.
  • DateBreadcrumb is currently unused (sibling JournalBreadcrumb replaced it); I did the minimal one-line rename rather than deleting the component, since cleanup is out of scope.
  • No :not([disabled]) filter removal was needed in tags-rename-delete.e2e.ts — the current file doesn't carry one.

Checklist

  • Self-reviewed the diff
  • No hardcoded secrets or credentials
  • Files stay under ~500 LOC
  • Follows immutable data patterns

Three components previously shared aria-label="Go back", causing Playwright
strict-mode collisions and poor screen-reader disambiguation:

- window-controls titlebar back/forward (permanently disabled history nav)
- sidebar tag-detail drilldown back button
- journal date-breadcrumb back button (dead component, defensive fix)

Rename the always-rendered titlebar pair to "Browser back"/"Browser forward"
so they no longer collide with the drilldown. Relabel the dead
date-breadcrumb BackButton to "Journal back" defensively.

Tag-detail view keeps "Go back" — it's now the sole owner of that label,
which matches the existing tags-rename-delete.e2e.ts selector cleanly.

Verified:
- pnpm typecheck:web passes
- renderer unit tests (window-controls.test.tsx) 5/5 pass
- tags-rename-delete.e2e.ts 2/2 pass
- sidebar-window-controls.e2e.ts 4/4 pass
@h4yfans
h4yfans merged commit 3b3a133 into main Apr 20, 2026
7 checks passed
@h4yfans
h4yfans deleted the interesting-darwin-d0743a branch April 20, 2026 09:47
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