Skip to content

feat(viewer): keyboard navigation and accessibility improvements#10

Open
benvinegar wants to merge 1 commit into
mainfrom
claude/pensive-sagan-sbdkbt
Open

feat(viewer): keyboard navigation and accessibility improvements#10
benvinegar wants to merge 1 commit into
mainfrom
claude/pensive-sagan-sbdkbt

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Make the viewer usable by keyboard and assistive technology. Session rows are now focusable interactive elements that activate with Enter/Space, with focus preserved across live re-renders. Hover-only actions (session delete, card open/delete) are now reachable on focus and properly labeled. The editable session title supports Escape to cancel edits, snippet iframes carry descriptive titles, and toast notifications are announced via a polite live region.

Key changes:

  • Session rows: Added role="button", tabIndex, and keyboard handlers (Enter/Space) to make session selection keyboard-accessible. Session rows now store their ID in data-id for focus restoration after re-renders.
  • Focus preservation: renderSidebar() now tracks which session row (or delete button) had focus before re-rendering and restores it afterward, ensuring keyboard navigation survives live updates.
  • Hover-to-focus parity: Changed delete button and action visibility from display: none/block to opacity: 0/1 and added :focus-within selectors alongside :hover for session rows and cards, making all interactive elements reachable via keyboard.
  • Session title editing: Added Escape key handler to cancel edits and restore the original title; added role="textbox" and aria-label for clarity.
  • Labeling: Delete button now has an aria-label with the session name; session title has aria-label; snippet iframes now carry the snippet title in their title attribute.
  • Live regions: Toast container now has role="status" and aria-live="polite" to announce notifications to assistive technology.
  • Focus indicators: Added :focus-visible outline styling to session rows for visual keyboard focus feedback.

CHANGELOG entry added documenting the accessibility improvements.

https://claude.ai/code/session_01CPrjGf4zMKuvx43Vg9cr2o

… accessible

Session rows are focusable role=button elements activated with Enter/Space,
with a visible focus ring and focus preserved across sidebar re-renders.
Hover-only actions (session delete, card open/delete) are now reachable by
keyboard and touch and shown via :focus-within. The contenteditable session
title gets role=textbox, an aria-label, and Escape-to-cancel. Snippet
iframes carry the snippet title; the toast is a polite live region. Visual
design for mouse users is unchanged.

https://claude.ai/code/session_01CPrjGf4zMKuvx43Vg9cr2o
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