Skip to content

fix(ChatSystemMessage): leave notices inside a chat log to the log - #7869

Merged
cixzhang merged 3 commits into
mainfrom
fix/chatsystemmessage-no-live-role
Oct 22, 2026
Merged

cixzhang merged 3 commits into
mainfrom
fix/chatsystemmessage-no-live-role

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

User impact

In a chat transcript, a screen-reader user can hear a new system notice ("Ana joined") twice, or out of order: once from the ChatMessageList log and once from the notice's own status region. Date and divider rows ("Today") are also presented as status messages. After this change the log is the notice's only live owner, and dates are ordinary transcript content.

Fixes #7857

Problem and solution fit

  • Why it happens: ChatSystemMessage forces role="status" on its root in both variants, while ChatMessageList is a polite role="log".
  • Why it hurts: a notice added to the list has two live owners, and a separator is announced as a status change.
  • Why it matters: spec:AST-086 gives every announced message exactly one owner, and makes a mounted live container the owner of content added inside it.

The root no longer forces a role. A role passed to the component now reaches its root like other root props.

Expected behavior and authority

spec:AST-086 (current):

  • FR1: every status message has exactly one announcement owner; no other element showing the same words carries a live role.
  • FR4: content added inside a mounted live container is delivered by that container; the element added with it carries no live role of its own.
  • Current-state impact: "ChatSystemMessage: forces role="status" inside the role="log" list. Under FR4 the log delivers it; dividers and dates are ordinary log content."

Smallest restoration

  • ChatSystemMessage.tsx: no role="status" on the default or divider root.
  • ChatSystemMessage.doc.mjs: the usage text no longer says the component exposes status semantics.
  • The shared status-message contract (StatusMessage.a11y.*) moves ChatSystemMessage from its bound status owners to its exclusions, citing FR4; its harness state and story go with it.
  • The existing Chromium audit (ChatSystemMessage.a11y.chromium.spec.ts) expects no root role, and its manifest notes record no root role inside the polite log.

No prop, type, or style changes.

Evidence

Chrome 156 (headless) accessibility tree, Storybook built from main (cb489ffbcc8, no Chat or Divider change since) and from this head. Live nodes per story (role, live, inside a log):

Story main head
ChatMessageList Conversation (divider "Today" in the list) log polite; status polite inside the log log polite only
ChatSystemMessage Variants (default and divider, standalone) two status polite none
ChatSystemMessage audit States (four rows, one inside a log) five status polite, one inside the log; log polite log polite only
  • Reproduction before the change: every system message is a polite status region, including the one inside the log.
  • Result after the change: the log is the only live node; the rows carry no live role.
  • Representative unchanged path: the divider's labelled separator, root props, and the Chat, Lab Chat and FieldStatus suites pass.
  • Regression test or other mutation-sensitive proof: ChatSystemMessage.test.tsx adds an FR4 case for each variant inside a ChatMessageList (no status, alert, log role or aria-live on the row or its descendants) and checks the roots carry no role. On main those cases and the updated root assertions fail.

These are DOM and accessibility-tree routing checks, the evidence spec:AST-009 takes for announcement claims; no spoken-output recording is claimed.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm vitest run packages/core/src/Chat packages/lab/src/Chat packages/core/src/FieldStatus
  • pnpm check:repo (commit hook).

ChatSystemMessage forced role=status on its root, including date and
divider rows, while ChatMessageList is a polite role=log. A new notice
then had two live owners, and dates were presented as status messages.
Under spec:AST-086 FR4 the log delivers content added inside it, so the
row carries no live role. The status-message contract moves the component
from its bound owners to its exclusions, with the reason.
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 22, 2026 2:34pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 22, 2026
@astracat-bot

astracat-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 22, 2026, 2:56 PM UTC

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

FieldStatus (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 151 -
Complexity N/A Low (3) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: 2 accessibility violation(s) found — 2 serious.

ChatComposer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/19 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposerInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

46 of 494 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
RichTextEditor Markdown parity: side by side probe dark 94,866
RichTextEditor Markdown parity: side by side probe light 89,762
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

and 26 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the fix itself is right, since ChatSystemMessage no longer carries role="status", so the ChatMessageList log is the only live owner of new notices as spec:AST-086 FR1 and FR4 require, and the new tests fail before the change and pass after it. Two small corrections are needed before approval:

  • The changeset says a screen-reader user "hears a new chat notice once", a spoken-output claim that spec:AST-009 FR4 ties to real assistive-technology evidence, so please either describe the routing outcome (one live owner) or name the NVDA + Chrome and VoiceOver + Safari scenario with a release-block record.
  • The manifest written by ChatSystemMessage.a11y.chromium.spec.ts still says the root keeps role=status and records it inside the log (lines 919–947), so please update that prose to match the new role: null expectation.

[Automated review]

'@astryxdesign/core': patch
---

[fix] `ChatSystemMessage` no longer forces `role="status"` on its root, in either variant, so a screen-reader user hears a new chat notice once, from the chat log, instead of from both the `ChatMessageList` log and the notice (WCAG 2.2 SC 4.1.3 Status Messages; `spec:AST-086` FR1 and FR4). Date and divider rows are no longer presented as status messages. Before, every system message was a status region inside the list's polite log; now the log owns content added inside it, and a `role` passed to the component reaches its root. Tests that found a system message by the `status` role should query it by its text instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence promises a spoken outcome ("hears a new chat notice once"). spec:AST-009 FR4 ties repetition claims to real assistive-technology evidence, and the evidence in this pull request is DOM and accessibility tree only. Suggest stating the routing outcome instead, for example "so a new chat notice has one live owner, the ChatMessageList log, instead of also being its own status region", or naming the NVDA + Chrome and VoiceOver + Safari scenario with a release-block record (FR17).

touchPoints: options.touchPoints ?? false,
role: 'status',
// No live role of its own: the chat log delivers it (spec:AST-086 FR4).
role: null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expectation is now role: null, but the manifest this spec writes still says the default variant "keeps role=status", that "the status root and separator remain", that the nested-log frame "records role=status inside ChatMessageList role=log", and lists status-inside-polite-log-unverified (lines 919–947). Please update that prose so the receipt matches what the audit now measures.

cixzhang added a commit that referenced this pull request Oct 22, 2026
## Exact decision needed

Whether merge or stable release may wait on real assistive-technology (NVDA, VoiceOver) evidence that contributors cannot produce.

## Existing authority searched

- `spec:AST-009` (current): FR4/FR8/FR17–FR19 required an explicit trigger classification, a named real-AT matrix, a scenario, and a durable release-block record, and blocked the first stable release until real-AT receipts passed or an owner exception applied.
- Linked records that restated the block or required screen-reader checks: `spec:AST-001` (browser evidence and FR7 row), `module:Table/useTableRowStatus` AR6, `module:Table/useTableColumnResize` verification, `spec:AST-056` (browser evidence line), `spec:AST-021` (release boundary phrase), `spec:AST-086` (FR6 real-AT row and platform line), `component:FieldStatus` AR5 and its verification row, `spec:AST-020` FR6 ("real-AT contract").
- Open PRs that add release-block sections to AST-009: #7732, #7275, #7272. Under this record those sections are no longer needed.

## Decision

- No requirement gates merge or release on evidence that cannot be produced (Intent, FR17, DEC-4).
- Merge and stable release need only the unit, DOM, accessibility-tree, axe, and real-browser evidence the owning records require (FR17).
- Announcements are proved by their routing: which element or channel carries them, their text, urgency, and update count per occasion (FR4, FR19).
- Real-AT observation is recommended follow-up when an outcome depends on AT behavior, may be tracked in a public issue, and holds no pull request or release (FR1–FR6, FR18).
- A change with an AT-dependent claim says so and names its lower-layer evidence; no matrix, scenario, or release record is needed to merge (FR8).
- Evidence-layer boundaries, the representative matrix, failure handling, and durable receipts stay, scoped to when a real-AT check runs.
- The exception process (old FR23–FR26) is removed because nothing remains to except.

## Rejected alternatives

- Holding stable releases until named real-AT receipts pass: fixes for known accessibility defects stall when no contributor can run the required pairings.

## Claim scope and non-goals

Only the evidence bar for merge and release, and the status of real-AT observation. Component accessibility requirements, evidence-layer boundaries, and focus/announcement behavior stay with their owners.

## Evidence and implementation relationship

Status-announcement conformance PRs (#7869, #7870, #7871, #7892, #7900, #7910) stall on the old real-AT release-block requirement because nobody in the review loop can run NVDA or VoiceOver. No implementation is included.

## Writing rubric results

- R1 narration: none; present-tense rules throughout. The two earlier holds are described as current follow-ups.
- R2 research in the record: none.
- R3 evidence naming a change: none; the earlier hold sections that named pull requests are replaced by the facts (story names and claims).
- R4 rejected alternatives over one line or outside a decision: one per decision, one line each.
- R5 pull request or issue references remaining: none in AST-009 or the edited lines.
- R6 ruled open questions still listing options: none.

## Scope

- [x] This PR contains specification records only.
- [x] It records observable behavior and preserves equivalent internal implementations.
- [x] Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
- [x] Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
- [x] It records one intentional durable decision, not a rescue for a separable tagalong.
- [x] The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
- [x] Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
- [x] Public text and artifacts contain no internal Meta context.

## Validation

- `pnpm check:knowledge`
- Prettier
- `git diff --check`
…ot without a live role

The Chromium audit's empty-content and nested-log notes still described
a role=status root; they now record no root role inside the polite log.
The changeset states the routing outcome (one live owner, the log)
rather than spoken output.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommending approval: ChatSystemMessage no longer forces role="status", so the ChatMessageList log is the only live owner of new chat notices, as spec:AST-086 FR1 and FR4 require, and the new tests fail before the change and pass after it. The changeset and the Chromium audit manifest now describe the routing outcome and the role-less root, which resolves both points raised on the previous revision. As an optional follow-up, the draft ChatSystemMessage.spec.md and internal/a11y-spec/README.md still describe the old status role.

[Automated review]

@cixzhang
cixzhang merged commit 0a4c894 into main Oct 22, 2026
67 checks passed
@github-actions
github-actions Bot deleted the fix/chatsystemmessage-no-live-role branch October 23, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — 62e73adf Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] ChatSystemMessage: a status role inside the chat log duplicates the log's announcement

1 participant