Skip to content

🎨 Palette: notification panel takes focus when opened and after Skip - #377

Open
Randomname653 wants to merge 1 commit into
mainfrom
palette/bell-panel-focus
Open

Randomname653 wants to merge 1 commit into
mainfrom
palette/bell-panel-focus

Conversation

@Randomname653

@Randomname653 Randomname653 commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Problem

Bell panel (#msg-panel, frontend/index.html, notifications.js), WCAG 2.4.3 / 4.1.2, keyboard and screen-reader users.

  • #msg-panel sits before #msg-bell in the DOM and toggleMsgPanel never moved focus, so after Enter on the bell, focus stays on the bell and the panel's Respond/Skip buttons are only reachable by Shift+Tab back through the page.
  • The panel had no role/name.
  • Skip re-renders #msg-list (loadUnreadMessages(true)), destroying the pressed button; focus falls to <body>.
  • Playwright probe on main (static server + mocked /api, earlier run): focus after open = msg-bell; after Enter on Skip = BODY.

Change

  • #msg-panel gets role="region" and the existing top.notifications label (no new strings).
  • Opening the panel focuses its first action once the list has loaded (close button if the list is empty). Escape already returned focus to the bell.
  • skipMessage refocuses the panel when the Skip button was redrawn away.

Measured effect / proof

Verified with the node test below (real functions, DOM stubs); I did not re-run the browser probe after the change. Not changed: the game-question buttons (answerGameQuestion) also redraw the list; left for a follow-up to keep this small.

Tests

tests/test_a11y_nav.py::test_bell_panel_focus: 4 checks fail on main, 53/53 pass with the change. Battery: 357/358, only the known sandbox failure test_enrichment_status_perf.py (SQLite planner; fails on untouched main, passes in CI).

Risk & edge cases

Focus moves only on open; the 60 s badge poll doesn't call it. Clicking the bell with a mouse also moves focus into the panel (as a menu/dialog would). Empty list falls back to the close button; closed panel is a no-op.

Duplicate check

Searched journal, other personas' journals, PRs for "bell", "notification", "msg-panel", and git log -300; no prior change to the panel's focus handling.

🤖 Generated with Claude Code

https://claude.ai/code/session_014GBDVC1k1qRH9wN8eno2UU

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