feat(web): expose chat messages as headings - #8631
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Adds narrowly scoped screen-reader headings and accessibility-level metadata to the existing chat transcript, with no visual, data, configuration, or deployment changes. The focused regression test covers the new heading structure. You can add or adjust custom eligibility rules. Learn more. |
What Changed
h3sender heading to every user and assistant messageWhy
The chat transcript had no semantic boundary between messages, forcing screen reader users to navigate long conversations line by line. Sender headings make each message directly reachable through standard heading navigation while preserving the current visual design.
Closes #8535.
Testing
vp test run apps/web/src/components/chat/MessagesTimeline.test.tsx(39 tests)vp lint apps/web/src/components/ChatMarkdown.tsx apps/web/src/components/chat/MessagesTimeline.tsx apps/web/src/components/chat/MessagesTimeline.test.tsxvp run --filter @t3tools/web typecheckChecklist
mainModel: GPT-5.6 Sol
Harness: Codex in T3 Code
Note
Low Risk
Accessibility-only markup (
sr-onlyheadings andaria-level); no visual or behavioral change for sighted users, with a focused regression test.Overview
Improves chat transcript navigation for assistive technology by giving each user and assistant message a semantic heading without changing how messages look on screen.
Messages timeline: Every message row now includes a screen-reader-only
h3labeled "You" or "T3 Code", so heading navigation can jump between messages instead of walking line by line.Markdown in messages:
ChatMarkdownaccepts an optionalheadingLevelOffsetthat setsaria-levelon renderedh1–h6(capped at 6) while leaving visual heading styles unchanged. User and assistant message bodies passheadingLevelOffset={3}, so a#in message text is announced as level 4—nested under the per-message level-3 sender heading.A MessagesTimeline regression test asserts the sr-only sender headings and shifted
aria-levelon markdown headings in static markup.Reviewed by Cursor Bugbot for commit 11b57d5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Expose chat messages as headings for screen readers
headingLevelOffsetprop toChatMarkdownthat setsaria-levelon rendered h1–h6 elements usingshiftedHeadingLevel, capped at 6.MessagesTimelinenow renders a visually hidden<h3>labeling each message author ('You' or 'T3 Code') and passesheadingLevelOffset={3}to allChatMarkdownrender sites so markdown headings sit below the author heading in the accessibility tree.aria-levelon message headings.aria-leveland a screen-reader-only heading are added.Macroscope summarized 11b57d5.