a11y: listbox semantics + keyboard nav (phase 2 canary intake)#1153
Merged
Conversation
Builds on phase 1 (PR #1103). Behavior-preserving — adds ARIA listbox/option semantics + keyboard navigation to the room and user lists, plus accessible labels on chat message rows so screen readers can navigate transcript message-by-message. ReactiveListWidget — base class additions: - role="listbox" + aria-label (from listTitle) on the default container in `render()`. Subclasses that override render() add role=listbox locally (see RoomList/UserList below). - getRenderFunction sets role="option" + tabindex=0 + aria-label (via new virtual `getItemLabel()`) + aria-selected on every .list-item wrapper. - Enter / Space on a focused item activates it (mirrors click). - New `onListKeydown` handler attached in firstUpdated(): ArrowDown / ArrowUp move focus between siblings, Home / End jump to first/last. Scoped to the container so it doesn't interfere with chat composer or other keyboard handling. RoomListWidget: - role=listbox + aria-label="Rooms and direct messages" on the container in its render() override. - Overrides getItemLabel(): for rooms → "Room {name} — {topic}"; for DMs → "Direct message with {name}" or "Group DM: {name}, {count} members". UserListWidget: - role=listbox + aria-label="Users and personas" on the container. - Overrides getItemLabel(): "{name}, {persona|agent|user}, {status}" so a screen reader hears the kind and presence state. ChatWidget — getRenderFunction: - role="article" + aria-label on each .message-row (sender name + timestamp + " sending" if optimistic). Combined with phase 1's role=log + aria-live=polite on the messages-container, the chat transcript is now navigable per-message via screen reader rotor. Out of scope (phase 3 follow-ups): - Dynamic aria-selected updates when the active room/user changes after initial render (current value is set at item-creation time only — limitation noted in PR description). - Roving tabindex (currently every item is tabindex=0). - Color-contrast audit across themes. - <div onclick> → <button> migration. - axe-core lint gate. `npm run build:ts` is green. Not visually validated locally — keyboard + screen-reader walkthrough is in the PR test plan. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #1127
Refs #1099
Supersedes the canary-intake portion of #1111.
Proof