Repository navigation
fix(Toast): a body that mixes text and a component is announced with the words it shows - #11966
Conversation
…the words it shows addToast announced getNodeText(body) whenever it was non-empty, and the toast read its rendered body only when that text was empty. getNodeText reads strings and children, not what a component renders, so a body such as <>Payment received: <Amount /></> was announced as "Payment received:". Now only a plain-text body (a string, a number, or a list of them) is announced at dispatch. Any other body is read from its rendered text after the toast's first commit, through the same once-per-showing path and visible-text reading a component-only body already uses, so a later change inside the component does not announce again. Toast.spec: the gap bullet for this case is removed; the dispatch-timing gap now names plain-text bodies, the only ones still announced at dispatch.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 44d9728 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/CommentThread | 381.3 kB (+46 B) · 2.4 kB CSS (0) | — | — · — · — |
| Typeahead | 94.8 kB (+43 B) · 14.4 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 87.8 kB (+42 B) · 12.5 kB CSS (0) | — | — · — · — |
121 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| ChatComposerTokenElement | 87.8 kB (+42 B) · 12.5 kB CSS (0) | — | — · — · — |
| Lightbox | 151.2 kB (+41 B) · 12.3 kB CSS (0) | — | — · — · — |
| PowerSearch | 318.1 kB (+40 B) · 27.3 kB CSS (0) | — | — · — · — |
| RadioListItem | 78.1 kB (+39 B) · 11.1 kB CSS (0) | — | — · — · — |
| lab/TabBarMoreList | 104.1 kB (+38 B) · 1.8 kB CSS (0) | — | — · — · — |
| Toast · Storybook | 107.3 kB (+37 B) · 11.5 kB CSS (0) | 1,863 (+9) | ✓ · ✓ · ✓ |
| ChatLayout | 91.2 kB (+36 B) · 11.7 kB CSS (0) | — | — · — · — |
| SideNavItem | 82.3 kB (+36 B) · 12.3 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 83.9 kB (+35 B) · 12.1 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 34.0 kB (+35 B) · 7.9 kB CSS (0) | — | — · — · — |
| StatusDot | 34.7 kB (+35 B) · 5.7 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 287.5 kB (+35 B) · 2.4 kB CSS (0) | — | — · — · — |
| ChatComposer | 90.7 kB (+34 B) · 13.5 kB CSS (0) | — | — · — · — |
| CommandPalette | 82.7 kB (+34 B) · 13.5 kB CSS (0) | — | — · — · — |
| ToggleButton | 94.8 kB (+34 B) · 11.3 kB CSS (0) | — | — · — · — |
| lab/Comments | 388.3 kB (+34 B) · 2.5 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 310.8 kB (+34 B) · 2.7 kB CSS (0) | — | — · — · — |
| AppShell | 100.8 kB (+33 B) · 14.9 kB CSS (0) | — | — · — · — |
| Banner | 69.7 kB (+33 B) · 11.6 kB CSS (0) | — | — · — · — |
| CheckboxListItem | 82.0 kB (+33 B) · 12.5 kB CSS (0) | — | — · — · — |
| ListItem | 81.1 kB (+33 B) · 12.5 kB CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 128.9 kB (+33 B) · 1.1 kB CSS (0) | — | — · — · — |
| lab/TourStep | 96.7 kB (+33 B) · 691 B CSS (0) | — | — · — · — |
| DrawerHeader | 71.0 kB (+32 B) · 14.3 kB CSS (0) | — | — · — · — |
| InputGroup | 63.2 kB (+32 B) · 8.8 kB CSS (0) | — | — · — · — |
| SideNavHeading | 88.0 kB (+32 B) · 12.5 kB CSS (0) | — | — · — · — |
| TopNav | 81.0 kB (+32 B) · 12.1 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 127.7 kB (+32 B) · 773 B CSS (0) | — | — · — · — |
| ChatMessageList | 30.2 kB (+31 B) · 7.4 kB CSS (0) | — | — · — · — |
| DialogHeader | 70.9 kB (+31 B) · 12.8 kB CSS (0) | — | — · — · — |
| InfoTip | 51.9 kB (+31 B) · 5.7 kB CSS (0) | — | — · — · — |
| Spinner | 26.8 kB (+31 B) · 6.6 kB CSS (0) | — | — · — · — |
| Table | 124.1 kB (+31 B) · 21.1 kB CSS (0) | — | — · — · — |
| TimeInput | 180.2 kB (+31 B) · 17.8 kB CSS (0) | — | — · — · — |
| Tokenizer | 112.8 kB (+31 B) · 21.9 kB CSS (0) | — | — · — · — |
| TopNavHeading | 87.7 kB (+31 B) · 12.4 kB CSS (0) | — | — · — · — |
| lab/CommentPin | 61.6 kB (+31 B) · 1.2 kB CSS (0) | — | — · — · — |
| Avatar | 46.8 kB (+30 B) · 6.0 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 34.5 kB (+30 B) · 8.8 kB CSS (0) | — | — · — · — |
| EmptyState | 7.1 kB (+30 B) · 510 B CSS (0) | — | — · — · — |
| MobileNavToggle | 67.9 kB (+30 B) · 11.1 kB CSS (0) | — | — · — · — |
| RadioList | 62.5 kB (+30 B) · 7.6 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 95.8 kB (+30 B) · 2.1 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 68.2 kB (+29 B) · 11.2 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 68.2 kB (+29 B) · 11.3 kB CSS (0) | — | — · — · — |
| ChatSendButton | 68.0 kB (+29 B) · 11.1 kB CSS (0) | — | — · — · — |
| DateRangeInput | 106.1 kB (+29 B) · 14.2 kB CSS (0) | — | — · — · — |
| DropdownMenu | 113.2 kB (+29 B) · 19.8 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 80.3 kB (+29 B) · 11.0 kB CSS (0) | — | — · — · — |
| MultiSelector | 109.0 kB (+29 B) · 18.9 kB CSS (0) | — | — · — · — |
| Selector | 120.1 kB (+29 B) · 19.7 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 186.5 kB (+29 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/DialogHeroHeader | 92.1 kB (+29 B) · 372 B CSS (0) | — | — · — · — |
| AlertDialog | 133.1 kB (+28 B) · 16.2 kB CSS (0) | — | — · — · — |
| Button | 67.6 kB (+28 B) · 11.1 kB CSS (0) | — | — · — · — |
| CheckboxInput | 71.0 kB (+28 B) · 10.6 kB CSS (0) | — | — · — · — |
| IconButton | 67.6 kB (+28 B) · 11.1 kB CSS (0) | — | — · — · — |
| MobileNav | 79.1 kB (+28 B) · 11.8 kB CSS (0) | — | — · — · — |
| MoreMenu | 113.5 kB (+28 B) · 19.8 kB CSS (0) | — | — · — · — |
| NumberInput | 106.1 kB (+28 B) · 13.0 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 68.5 kB (+28 B) · 11.2 kB CSS (0) | — | — · — · — |
| lab/SelectableCardGroup | 71.4 kB (+28 B) · 162 B CSS (0) | — | — · — · — |
| AvatarGroup | 49.7 kB (+27 B) · 6.1 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 102.4 kB (+27 B) · 14.0 kB CSS (0) | — | — · — · — |
| Calendar | 78.7 kB (+27 B) · 11.8 kB CSS (0) | — | — · — · — |
| CodeBlock | 83.7 kB (+27 B) · 12.9 kB CSS (0) | — | — · — · — |
| FileInput | 77.4 kB (+27 B) · 12.8 kB CSS (0) | — | — · — · — |
| Stepper | 69.3 kB (+27 B) · 11.3 kB CSS (0) | — | — · — · — |
| TextInput | 101.2 kB (+27 B) · 12.8 kB CSS (0) | — | — · — · — |
| Pagination | 153.2 kB (+26 B) · 20.0 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 78.1 kB (+26 B) · 14.5 kB CSS (0) | — | — · — · — |
| charts/Chart | 247.6 kB (+25 B) · 516 B CSS (0) | — | — · — · — |
| Carousel | 77.7 kB (+25 B) · 12.1 kB CSS (0) | — | — · — · — |
| Field | 61.0 kB (+25 B) · 7.6 kB CSS (0) | — | — · — · — |
| Thumbnail | 72.0 kB (+25 B) · 12.7 kB CSS (0) | — | — · — · — |
| Tooltip | 33.0 kB (+25 B) · 4.8 kB CSS (0) | — | — · — · — |
| ComplexSelector | 83.6 kB (+24 B) · 13.2 kB CSS (0) | — | — · — · — |
| SegmentedControl | 103.5 kB (+24 B) · 7.2 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 81.7 kB (+24 B) · 13.0 kB CSS (0) | — | — · — · — |
| lab/VideoPlayer | 230.9 kB (+24 B) · 2.1 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 315.1 kB (+24 B) · 454 B CSS (0) | — | — · — · — |
| charts/ChartTooltip | 224.1 kB (+23 B) · 451 B CSS (0) | — | — · — · — |
| SideNav | 124.0 kB (+23 B) · 12.5 kB CSS (0) | — | — · — · — |
| Slider | 116.2 kB (+23 B) · 9.2 kB CSS (0) | — | — · — · — |
| TabMenu | 84.2 kB (+23 B) · 12.3 kB CSS (0) | — | — · — · — |
| lab/MediaFullscreenButton | 223.2 kB (+23 B) · 1.5 kB CSS (0) | — | — · — · — |
| Markdown | 208.4 kB (+22 B) · 23.4 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 106.1 kB (+22 B) · 20.0 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 120.9 kB (+22 B) · 751 B CSS (0) | — | — · — · — |
| lab/MediaPlaybackRate | 223.2 kB (+22 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaPlayButton | 223.2 kB (+22 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaVolume | 223.2 kB (+22 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/Schedule | 117.6 kB (+22 B) · 3.9 kB CSS (0) | — | — · — · — |
| Popover | 104.3 kB (+21 B) · 15.5 kB CSS (0) | — | — · — · — |
| lab/MediaCaptionsButton | 223.2 kB (+21 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaSeekButton | 223.2 kB (+21 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaTime | 223.2 kB (+21 B) · 1.5 kB CSS (0) | — | — · — · — |
| ContextMenu | 105.1 kB (+20 B) · 19.6 kB CSS (0) | — | — · — · — |
| lab/ListInput | 97.2 kB (+20 B) · 922 B CSS (0) | — | — · — · — |
| lab/MediaTimeSlider | 223.2 kB (+20 B) · 1.5 kB CSS (0) | — | — · — · — |
| Switch | 111.1 kB (+19 B) · 10.4 kB CSS (0) | — | — · — · — |
| TableCell | 106.3 kB (+19 B) · 20.1 kB CSS (0) | — | — · — · — |
| Link | 57.8 kB (+18 B) · 7.4 kB CSS (0) | — | — · — · — |
| TextArea | 94.6 kB (+18 B) · 10.0 kB CSS (0) | — | — · — · — |
| CheckboxList | 74.7 kB (+17 B) · 8.1 kB CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 52.8 kB (+16 B) · 6.0 kB CSS (0) | — | — · — · — |
| FieldLabel | 56.9 kB (+16 B) · 6.1 kB CSS (0) | — | — · — · — |
| DateTimeInput | 232.0 kB (+15 B) · 20.6 kB CSS (0) | — | — · — · — |
| TopNavMenu | 87.1 kB (+15 B) · 12.4 kB CSS (0) | — | — · — · — |
| lab/AudioPlayer | 233.3 kB (+15 B) · 1.8 kB CSS (0) | — | — · — · — |
| lab/TransferList | 139.1 kB (+11 B) · 1.2 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 151.0 kB (+11 B) · 1.4 kB CSS (0) | — | — · — · — |
| DateInput | 208.0 kB (+10 B) · 18.9 kB CSS (0) | — | — · — · — |
| ProgressBar | 12.3 kB (+1 B) · 6.7 kB CSS (0) | — | — · — · — |
| Timestamp | 31.2 kB (+1 B) · 11.4 kB CSS (0) | — | — · — · — |
| lab/LineClamp | 15.7 kB (+1 B) · 168 B CSS (0) | — | — · — · — |
| Heading | 14.0 kB (0) · 5.8 kB CSS (0) | — | — · — · — |
| NavHeadingMenuItem | 18.6 kB (0) · 6.7 kB CSS (0) | — | — · — · — |
| Text | 13.2 kB (0) · 5.8 kB CSS (0) | — | — · — · — |
| charts/ChartLegend | 49.3 kB (−1 B) · 224 B CSS (0) | — | — · — · — |
| Timer | 15.7 kB (−1 B) · 6.4 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 7.92 MB packed (+634 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: one blocking issue in how a changing mixed body is announced.
- A mixed body whose words change after the toast shows (the description's resolving amount) is announced a second time on the toast's next render, at the latest when it is dismissed, so the "read once" claim in the description and changeset does not hold and the Toast record's once-per-show rule (FR9) is not met; make the toast's rendered read once per showing (for example an option on the shared
useAnnounceRenderedTextthat dedupes on the occasion) and make the new test re-render the row after the amount resolves.
The core fix works: the mixed body is announced as "Payment received: $120.00", and both new tests fail on main and pass here. In the same push, the Toast record's "Sixteen implementation gaps" should become fifteen, and its hidden-overwrite (FR8) gap now applies only to plain-text bodies.
Claims and files checked
Review mode: same-head; reason: none
- Changed rules (0): none since the earlier review.
- Claim: a body that mixes text and a component is announced with every word it shows: verified (the new test fails on main and passes here).
- Claim: a component with text children that renders other words is read from what it renders: verified (any element body now takes the rendered read).
- Claim: plain-text toasts are announced at dispatch as before: verified (the dispatch path keeps strings, numbers and lists of them; existing tests pass).
- Claim: hidden parts are left out and stacked blocks are read apart: verified (the shared rendered-text reader does both).
- Claim: a mixed body is read once per showing, and a later change inside the component does not announce again: false (after the change, the toast's next render, such as dismissal or the end of its entry transition, announces the new words).
- Claim: no API change: verified (no export, prop, attribute or default changes).
- Claim: the cause and the record edits are as described: verified; the record's gap count was not updated.
- Claim: Toast and adopter tests pass 172 of 172, and tsc, eslint and the knowledge check are clean: verified (eslint reports two warnings on lines this change does not touch).
- File
.changeset/toast-mixed-body-announcement.md: the "read once" sentence is false for changing words. - File
docs/specs/components/Toast/Toast.spec.md: stale gap count and FR8 gap text (non-blocking). - File
packages/core/src/Toast/ToastViewport.test.tsx: the once test never re-renders the row. - File
packages/core/src/Toast/ToastViewport.tsx: the toast is announced again on the next row render (blocking).
The shared own-content announcement module speaks again whenever the rendered text changes. A component body whose words changed after the toast showed (an amount that resolves) was announced a second time on the toast's next render, at the latest on dismiss. The module gains an internal isOncePerOccasion option, and the toast turns it on: later changes under the same showing stay silent; a uniqueID overwrite is a new showing. The mixed-body test now renders the card again by dismissing it, and fails without the option (2 calls). A module test covers the option. Toast.spec counts fifteen gaps, and the hidden-overwrite gap names plain-text bodies.
|
/approve-spec fb7f6d6 |
There was a problem hiding this comment.
Changes requested: one missing piece of evidence; the announcement fix itself checks out.
- This pull request grows the shared
useAnnounceRenderedTexthook, which ten component folders import, but the description does not report the first-load gzip delta on the four reference pages that the component import-boundaries rule (INV10) requires for a grown shared module; please add that table, base against head (pnpm size:pagesfrom the merge base to this head gives docs +32 B, form +28 B, menu +31 B and table +13 B gzip, well under the limit).
The mixed body is now announced as "Payment received: $120.00", once per showing, and the new once test fails without the option. Three small follow-ups would fit the same push: FR8's implementation gap in the Toast record still covers every toast, the hook's JSDoc still says a hide re-arms it, and the changeset could say that a renderContent card whose words change is no longer announced again.
Claims and files checked
Review mode: same-head; reason: none
- Claim: a body that mixes text and a component is announced with every word it shows: verified (the new test fails on main and passes here).
- Claim: a component with text children that renders other words is read from what it renders: verified (every element body now takes the rendered read).
- Claim: plain-text toasts are announced at dispatch, as before: verified (the dispatch path keeps strings, numbers and lists of them; existing tests pass).
- Claim: a mixed body is read once per showing, and a later change inside it does not announce again: verified (one announcement after dismissal or the entry transition; the once test fails without the option).
- Claim: an overwrite through the unique id is a new showing and is announced: verified.
- Claim: before this change, a component body whose words changed was announced again on the next render: verified (two announcements on main).
- Claim: hidden parts are left out and stacked blocks are read apart: verified (the shared rendered-text reader does both).
- Claim: no API change: verified (the built public surface of Core and the themes is unchanged).
- Claim: the cause is as described: verified against main's dispatch and row code.
- Claim: the record edits remove one gap, narrow two and count fifteen: verified; FR8's own gap text is not narrowed (non-blocking).
- Claim: the cited records say what the description quotes: verified.
- Claim: the two new viewport tests fail on main and pass here, and the once test fails without the option: verified.
- Claim: the module test keeps one occasion silent on a text change and speaks for a new one: verified (fails on main, passes here).
- Claim: Toast and module tests pass, and tsc, eslint and the knowledge check are clean: verified (179 tests pass in that file set; eslint reports two warnings on unchanged lines).
- Claim: the overlapping pull requests touch the swipe, motion and a standalone toast's live role: verified.
- Changeset: a mixed body is announced with all its words, an element body is read once when shown, and plain text is announced as before: verified.
- File
.changeset/toast-mixed-body-announcement.md: clear (could mention custom-content toasts, non-blocking). - File
docs/specs/components/Toast/Toast.spec.md: FR8's gap text still covers every toast (non-blocking). - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.ts: grows a shared module without the per-page size report (blocking evidence); the JSDoc's re-arm sentence (non-blocking). - File
packages/core/src/hooks/useAnnounceRenderedText.test.tsx: clear.
…option's re-arm is documented The FR8 row's implementation gap now applies to plain-text bodies, as the Current-state bullet does. The announcement module's JSDoc says that with isOncePerOccasion only a new occasion re-arms it. The changeset notes that a component body or renderContent card whose words change is no longer announced twice.
|
/approve-spec fcbd81d |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The CI, Lint and CLI Smoke Test workflows skip a draft, so they run once the pull request is marked ready for review.
A body that mixes text and a component is now announced with every word it shows, once per showing, and the per-page size table in the description matches an independent measurement. The record's gaps, the hook's JSDoc and the changeset now describe what the code does.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: a body that mixes text and a component is announced with every word it shows: verified (the new test fails on main and passes here).
- Claim: a component with text children that renders other words is read from what it renders: verified (every element body now takes the rendered read).
- Claim: plain-text toasts are announced at dispatch, as before: verified (the dispatch path keeps strings, numbers and lists of them; the string and error tests pass).
- Claim: a mixed body is read once per showing, and a later change inside it does not announce again: verified (one announcement after dismissal or the entry transition; the once test fails without the option, with two calls).
- Claim: before this change, a component body whose words changed was announced again on the next render: verified (two announcements on main).
- Claim: an overwrite through the unique id is a new showing and is announced: verified.
- Claim: hidden parts are left out and stacked blocks are read apart: verified (the shared rendered-text reader does both).
- Claim: no API change for builders: verified (the built public surface of Core and the themes is unchanged).
- Claim: the cause is as described: verified against main's dispatch and row code.
- Claim: the record removes one gap, narrows the dispatch-timing and hidden-overwrite gaps and their two requirement rows to plain-text bodies, and counts fifteen: verified.
- Claim: the cited records say what the description quotes: verified.
- Claim: the two new viewport tests and the module test fail on main and pass here: verified.
- Claim: existing component-body, string, error, overwrite, StrictMode and adopter tests pass: verified (179 tests pass in the Toast folder and the hook's two test files; the description counts 178).
- Claim: first-load size per reference page, base against head, every page under the limit: verified (identical minified deltas; gzip within a few bytes, 15 to 32 B on the four reference pages).
- Claim: types, lint and the knowledge check are clean: verified (no errors; two lint warnings sit on unchanged lines).
- Claim: the overlapping pull requests touch the swipe, motion and a standalone toast's live role: verified.
- Changeset: a mixed body is announced with all its words, an element body is read once when shown, plain text is announced as before, and a component body or custom card whose words change is not announced again: verified.
- File
.changeset/toast-mixed-body-announcement.md: clear. - File
docs/specs/components/Toast/Toast.spec.md: clear. - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.ts: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.test.tsx: clear.
|
Thanks for this! With the issue's repro on the head, the polite region reads One observation about once-per-showing, not a blocker: the text is read from the first commit, From the reporter's side this resolves #11948 as reported. |
|
/approve-spec 4170d41 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The CI, Lint and CLI Smoke Test workflows skip a draft, so they run once the pull request is marked ready for review.
A toast body that mixes text and an element is now announced with the words it renders, once per showing, and plain-text bodies are announced as before. The record edit carries an owner approval for this head, and the per-page size report holds at the current base (28 to 38 B gzip on the four reference pages).
- Optional: the changeset's first sentence could say that words a component fills in after the toast appears, such as an amount set in an effect, are not read; that case is still announced without them, as it was before.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: a body that mixes text and a component is announced with every word it renders: verified (the new test fails on the base and passes here).
- Claim: a component with text children that renders other words, such as a translated message, is read from what it renders: verified (every element body now takes the rendered read).
- Claim: plain-text bodies (strings, numbers and lists of them) are announced at dispatch, as before: verified.
- Claim: a mixed body is read once per showing, and a later change inside it does not announce again: verified (one announcement, also after the card renders again on dismiss).
- Claim: before this change, a component body whose words changed was announced again on a later render: verified (two announcements on the base, and on this head without the new option).
- Claim: an overwrite through the unique id is a new showing and is announced: verified (each overwrite is a new occasion).
- Claim: hidden parts are left out and stacked blocks are read apart: verified (the shared rendered-text reader does both).
- Claim: no API change for builders: verified (the built public surface of Core and the themes is unchanged).
- Claim: the cause is as described: verified against the base's dispatch and row code.
- Claim: the record removes one gap, narrows the dispatch-timing and hidden-overwrite gaps and their two requirement rows to plain-text bodies, and counts fifteen: verified.
- Claim: the cited records say what the description quotes: verified.
- Claim: the two new viewport tests and the module test fail on the base and pass here, and the once test fails without the option: verified.
- Claim: the existing component-body, string, error, overwrite, StrictMode and adopter tests pass: verified (258 tests in the Toast folder and the announcement hooks pass).
- Claim: first-load size per reference page, every page under the limit: verified (measured against an earlier base; at the current base docs +29 B, form +31 B, menu +38 B and table +28 B gzip).
- Claim: types, lint and the knowledge check are clean: verified (no errors; two lint warnings sit on unchanged lines).
- Claim: the overlapping pull requests touch the swipe, motion and a standalone toast's live role: verified.
- Changeset: a mixed body is announced with all its words: verified for words present when the toast appears (see the optional note).
- Changeset: an element body is read once, from its rendered text, when the toast is shown: verified.
- Changeset: a plain-text body is announced as before: verified.
- Changeset: a component body or custom card whose words change after the toast shows is not announced a second time: verified.
- File
.changeset/toast-mixed-body-announcement.md: clear (optional wording note). - File
docs/specs/components/Toast/Toast.spec.md: clear. - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.ts: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.test.tsx: clear.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] A toast whose `body` mixes text and a component, such as `<>Payment received: <Amount /></>`, is now announced with all the words it shows ("Payment received: $120.00"), not only the text written beside the component. A body that holds any element is read once, from its rendered text, when the toast is shown; a plain-text body is announced as before. A component body or `renderContent` card whose words change after the toast shows is no longer announced a second time. |
There was a problem hiding this comment.
Optional: words a component renders after the toast appears, such as an amount set in an effect (<>Payment received: <Late /></>), are still announced without them, as before. A short clause here, for example "words a component renders after the toast appears are not read", would keep the release note from implying otherwise.
|
/approve-spec 906db7c |
There was a problem hiding this comment.
Changes requested: one blocking issue, a formatting fix in the Toast record; the announcement fix itself checks out.
docs/specs/components/Toast/Toast.spec.md:62is two characters narrower than the other rows of its table, so Prettier lists the file and the requiredlintcheck's "Check formatting of changed files" step will fail once the pull request leaves draft; runpnpm exec prettier --write docs/specs/components/Toast/Toast.spec.md.
Optional, as noted before: the changeset could say that words a component fills in after the toast appears, such as an amount set in an effect, are not read.
Claims and files checked
Review mode: same-head; reason: none
- Claim: a body that mixes text and a component is announced with every word it shows: verified (the new viewport test fails on the base and passes here).
- Claim: a component with text children that renders other words, such as a translated message, is read from what it renders: verified (every element body now takes the rendered read).
- Claim: plain-text bodies are announced at dispatch, as before: verified (strings, numbers and lists of them keep the dispatch path; the string and error tests pass).
- Claim: a mixed body is read once per showing, and a later change inside it does not announce again: verified (one announcement, also after the card renders again on dismiss).
- Claim: no API change for builders: verified (no export, prop or option changes; the new option is on an internal hook).
- Claim: the cause is as described: verified against the base's dispatch and row code and the text helper it used.
- Claim: any element body, a fragment included, is read after the first commit, leaving hidden parts out and reading stacked blocks apart: verified (the shared rendered-text reader does both).
- Claim: the shared announcement module gains an internal once option that the toast turns on, and before this change a component body whose words changed was announced again on a later render: verified (the once test fails on the base, and fails here with the option removed, 2 calls).
- Claim: an overwrite through the unique id is a new showing and is announced: verified (an overwrite takes a new entry id, the hook's occasion; the overwrite tests pass).
- Claim: the record removes the mixed-body gap, narrows the dispatch-timing and hidden-overwrite gaps and their two requirement rows to plain-text bodies, and the gap count goes from sixteen to fifteen: verified (the base lists sixteen gaps, this head fifteen; the count row's padding is the blocking finding).
- Claim: the cited records say what the description quotes: verified.
- Claim: the two new viewport tests fail on main and pass here, and the once test fails without the option: verified.
- Claim: the module test keeps a text change under one occasion silent and lets a new occasion speak: verified (fails on the base, passes here).
- Claim: the existing component-body, string, error, overwrite, StrictMode and adopter tests pass, 178 of 178: verified that they pass (181 tests in the Toast folder and the module test at this head).
- Claim: the shared announcement module is reached by ten component folders: verified.
- Claim: first-load size per reference page, every page under the limit: verified (measured against this base: docs +25 B, form +27 B, menu +12 B and table +51 B gzip).
- Claim: types and lint are clean: verified (no type errors; no lint errors, one warning on an unchanged test line); the record's formatting is not clean (the blocking finding).
- Claim: the knowledge check passes: verified.
- Claim: the writing rubric finds no narration, research, change references, long rejected alternatives, ruled open questions or project status in the record edits: verified.
- Claim: the overlapping pull requests touch the swipe, motion and a standalone toast's live role: verified.
- Changeset: a mixed body is announced with all the words it shows: verified for words present when the toast appears (see the optional note).
- Changeset: an element body is read once, from its rendered text, when the toast is shown: verified.
- Changeset: a plain-text body is announced as before: verified.
- Changeset: a component body or custom card whose words change after the toast shows is no longer announced a second time: verified (both share the one read with the once option).
- File
.changeset/toast-mixed-body-announcement.md: clear (optional wording note). - File
docs/specs/components/Toast/Toast.spec.md: finding (line 62 formatting). - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.ts: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.test.tsx: clear.
|
/approve-spec 01ac5ce |
There was a problem hiding this comment.
Approval waits on one owner decision; the announcement fix itself checks out.
- Miss: Toast now reads a rendered body once per showing (
isOncePerOccasionatpackages/core/src/Toast/Toast.tsx:432), which follows the Toast record's FR9 but departs fromspec:AST-086FR12, where every component that announces its own rendered content speaks each later text change and re-arms when hidden, and no record names Toast as an exception; an engineering owner (the author is one) needs to decide whether Toast keeps once per showing, recorded as an exception that AST-086 FR11/FR12 links to, or follows FR12 and drops the option.
The /approve-spec at this head covers the Toast record edit, not this question between two records. Optional, as noted before: the changeset could say that words a component fills in after the toast appears, such as an amount set in an effect, are not read.
Claims and files checked
Review mode: same-head; reason: none
- Claim: a body that mixes text and a component is announced with every word it shows: verified (the new viewport test fails on the base and passes here).
- Claim: a component with text children that renders other words, such as a translated message, is read from what it renders: verified (every element body now takes the rendered read).
- Claim: plain-text bodies are announced at dispatch, as before: verified (strings, numbers and lists of them keep the dispatch path; the string and error tests pass).
- Claim: a mixed body is read once per showing, and a later change inside it does not announce again: verified (one announcement, also after the card renders again on dismiss); whether Toast should do this is the decision above.
- Claim: no API change for builders: verified (the repository's API generator lists no added, changed or removed rows for Core or the themes).
- Claim: the cause is as described: verified against the base's dispatch and row code and the text helper it used.
- Claim: any element body, a fragment included, is read after the first commit, leaving hidden parts out and reading stacked blocks apart: verified (the shared rendered-text reader does both).
- Claim: the shared announcement module gains an internal once option that the toast turns on, and before this change a component body whose words changed was announced again on a later render: verified (the once test fails with the option removed, 2 calls; a custom-content card behaves the same).
- Claim: an overwrite through the unique id is a new showing and is announced: verified (an overwrite takes a new entry id, the hook's occasion; the overwrite tests pass).
- Claim: the record removes the mixed-body gap, narrows the dispatch-timing and hidden-overwrite gaps and their two requirement rows to plain-text bodies, and the gap count goes from sixteen to fifteen: verified (the base lists sixteen gaps, this head fifteen).
- Claim: the cited records say what the description quotes: verified; the status-announcement record's text-change rule (FR12) is not cited and is the decision above.
- Claim: the two new viewport tests fail on main and pass here, and the once test fails without the option: verified.
- Claim: the module test keeps a text change under one occasion silent and lets a new occasion speak: verified (fails on the base, passes here).
- Claim: the existing component-body, string, error, overwrite, StrictMode and adopter tests pass, 178 of 178: verified that they pass (181 tests in the Toast folder and the module test at this head, after merges of main).
- Claim: the shared announcement module is reached by ten component folders: verified that ten import it directly.
- Claim: first-load size per reference page, every page under the limit: verified (measured against this base: docs +25 B, form +27 B, menu +13 B and table +51 B gzip).
- Claim: types and lint are clean: verified (no type errors; no lint errors, one warning on an unchanged test line; Prettier lists no changed file).
- Claim: the knowledge check passes: verified.
- Claim: the writing rubric finds no narration, research, change references, long rejected alternatives, ruled open questions or project status in the record edits: verified.
- Claim: the overlapping pull requests touch the swipe, motion and a standalone toast's live role: verified.
- Changeset: a mixed body is announced with all the words it shows: verified for words present when the toast appears (see the optional note).
- Changeset: a body that holds any element is read once, from its rendered text, when the toast is shown: verified.
- Changeset: a plain-text body is announced as before: verified.
- Changeset: a component body or custom card whose words change after the toast shows is no longer announced a second time: verified (both share the one read with the once option); whether it should be is the decision above.
- File
.changeset/toast-mixed-body-announcement.md: clear (optional wording note). - File
docs/specs/components/Toast/Toast.spec.md: clear. - File
packages/core/src/Toast/Toast.tsx: held (the once option, the decision above). - File
packages/core/src/Toast/ToastViewport.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.ts: held withToast.tsx(the option it adds); otherwise clear. - File
packages/core/src/hooks/useAnnounceRenderedText.test.tsx: clear.
|
/approve-spec 482d252 |
There was a problem hiding this comment.
Changes requested: one records fix; the announcement fix itself checks out.
- Miss: the approval at this head keeps Toast's once-per-showing announcement (
isOncePerOccasionatpackages/core/src/Toast/Toast.tsx:432), butspec:AST-086FR11 still covers Toast and its FR12 still has every component that announces its own content speak each later text change, so record the exception in this pull request: namecomponent:Toastin FR11's list of components that keep their own announcement rules and say in Toast FR9 (docs/specs/components/Toast/Toast.spec.md:196) that a text change during one showing is not announced again, or drop the option if FR12 should hold.
Nothing in the code or the conversation has changed since the last review of this head, so the finding stands as before. Optional, as noted before: the changeset could say that words a component fills in after the toast appears, such as an amount set in an effect, are not read.
Claims and files checked
Review mode: same-head; reason: none
- Claim: a body that mixes text and a component is announced with every word it shows: verified (the new viewport test fails on the base and passes here).
- Claim: a component with text children that renders other words, such as a translated message, is read from what it renders: verified (every element body now takes the rendered read).
- Claim: plain-text bodies are announced at dispatch, as before: verified (strings, numbers and lists of them keep the dispatch path; the string and error tests pass).
- Claim: a mixed body is read once per showing, and a later change inside it does not announce again: verified (one announcement, also after the card renders again on dismiss); approved at this head, and the records still need the exception (above).
- Claim: no API change for builders: verified (the repository's API generator lists no added, changed or removed rows for Core or the themes).
- Claim: the cause is as described: verified against the base's dispatch and row code and the text helper it used.
- Claim: any element body, a fragment included, is read after the first commit, leaving hidden parts out and reading stacked blocks apart: verified (the shared rendered-text reader does both).
- Claim: the shared announcement module gains an internal once option that the toast turns on, and before this change a component body whose words changed was announced again on a later render: verified (the once test fails with the option removed, 2 calls; a custom-content card behaves the same).
- Claim: an overwrite through the unique id is a new showing and is announced: verified (an overwrite takes a new entry id, the hook's occasion; the overwrite tests pass).
- Claim: the record removes the mixed-body gap, narrows the dispatch-timing and hidden-overwrite gaps and their two requirement rows to plain-text bodies, and the gap count goes from sixteen to fifteen: verified (the base lists sixteen gaps, this head fifteen).
- Claim: the cited records say what the description quotes: verified; the status-announcement record's text-change rule (FR12) is not cited and is what the record fix above must reconcile.
- Claim: the two new viewport tests fail on main and pass here, and the once test fails without the option: verified.
- Claim: the module test keeps a text change under one occasion silent and lets a new occasion speak: verified (fails on the base, passes here).
- Claim: the existing component-body, string, error, overwrite, StrictMode and adopter tests pass, 178 of 178: verified that they pass (183 tests in the Toast folder and the module test pass at this head).
- Claim: the shared announcement module is reached by ten component folders: verified that ten import it directly.
- Claim: first-load size per reference page, every page under the limit: verified (docs +25 B, form +27 B, menu +13 B and table +51 B gzip, base against head).
- Claim: types and lint are clean: verified (no type errors; no lint errors, one warning on an unchanged test line; Prettier lists no changed file).
- Claim: the knowledge check passes: verified.
- Claim: the writing rubric finds no narration, research, change references, long rejected alternatives, ruled open questions or project status in the record edits: verified.
- Claim: the overlapping pull requests touch the swipe, motion and a standalone toast's live role: verified.
- Changeset: a mixed body is announced with all the words it shows: verified for words present when the toast appears (see the optional note).
- Changeset: a body that holds any element is read once, from its rendered text, when the toast is shown: verified.
- Changeset: a plain-text body is announced as before: verified.
- Changeset: a component body or custom card whose words change after the toast shows is no longer announced a second time: verified; the records still need the exception (above).
- File
.changeset/toast-mixed-body-announcement.md: clear (optional wording note). - File
docs/specs/components/Toast/Toast.spec.md: FR9 needs the once-per-showing exception (above); otherwise clear. - File
packages/core/src/Toast/Toast.tsx: the once option the record fix above must name; otherwise clear. - File
packages/core/src/Toast/ToastViewport.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.ts: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.test.tsx: clear.
|
/approve-spec 7d8538c |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The CI, Lint and CLI Smoke Test workflows skip a draft, so they run once the pull request is marked ready for review.
A toast body that mixes text and a component is now announced with every word it shows, once per showing, and the status-announcement and Toast records now state the once-per-showing rule, which resolves the one item from the last review. No blocking findings.
Optional, as noted before: the changeset could say that words a component fills in after the toast appears, such as an amount set in an effect, are not read.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: a body that mixes text and a component is announced with every word it shows: verified (the new viewport test fails on the base and passes here).
- Claim: a component with text children that renders other words, such as a translated message, is read from what it renders: verified (every element body now takes the rendered read).
- Claim: plain-text bodies are announced at dispatch, as before: verified (strings, numbers and lists of them keep the dispatch path; the string and error tests pass).
- Claim: a mixed body is read once per showing, and a later change inside it does not announce again: verified (one announcement, also after the card renders again on dismiss).
- Claim: no API change for builders: verified (the repository's API generator lists no added, changed or removed rows for Core, the build package or the themes).
- Claim: the cause is as described: verified against the base's dispatch and row code and the text helper it used.
- Claim: any element body, a fragment included, is read after the first commit, leaving hidden parts out and reading stacked blocks apart: verified (the shared rendered-text reader does both).
- Claim: the shared announcement module gains an internal once option that the toast turns on, and before this change a component body whose words changed was announced again on a later render: verified (the once test fails with the option removed, 2 calls; a custom-content card behaves the same).
- Claim: an overwrite through the unique id is a new showing and is announced: verified (an overwrite takes a new entry id, the hook's occasion; the overwrite tests pass).
- Claim: the Toast record removes the mixed-body gap, narrows the dispatch-timing and hidden-overwrite gaps and their two requirement rows to plain-text bodies, and the gap count goes from sixteen to fifteen: verified (the base lists sixteen gaps, this head fifteen).
- Claim: the status-announcement record's list of components with their own announcement rules now names Toast with its once-per-showing rule, and the Toast record says a text change while a toast shows is not announced again: verified, and approved by an engineering owner at this head.
- Claim: the cited records say what the description quotes: verified.
- Claim: the two new viewport tests fail on main and pass here, and the once test fails without the option: verified.
- Claim: the module test keeps a text change under one occasion silent and lets a new occasion speak: verified (fails on the base, passes here).
- Claim: the existing component-body, string, error, overwrite, StrictMode and adopter tests pass, 178 of 178: verified (the seven Toast and module test files hold 178 tests; with the remaining Toast files and the adopter test, 195 pass here).
- Claim: the shared announcement module is reached by ten component folders: verified (ten import it).
- Claim: first-load size per reference page, every page under the limit: verified (base against head here: docs +23 B, form +41 B, menu +2 B and table +21 B gzip; +66 B minified on each page).
- Claim: types and lint are clean: verified (no type errors; no lint errors, one warning on an unchanged test line; Prettier lists no changed file).
- Claim: the knowledge check passes: verified.
- Claim: the writing rubric finds no narration, research, change references, long rejected alternatives, ruled open questions or project status in the record edits: verified.
- Claim: the overlapping pull requests touch the swipe, motion and a standalone toast's live role: verified.
- Changeset: a mixed body is announced with all the words it shows: verified for words present when the toast appears (see the optional note).
- Changeset: a body that holds any element is read once, from its rendered text, when the toast is shown: verified.
- Changeset: a plain-text body is announced as before: verified.
- Changeset: a component body or custom card whose words change after the toast shows is no longer announced a second time: verified (2 announcements on the base behaviour, 1 here).
- File
.changeset/toast-mixed-body-announcement.md: clear (optional wording note). - File
docs/specs/AST-086-status-announcements/spec.md: clear. - File
docs/specs/components/Toast/Toast.spec.md: clear. - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.ts: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.test.tsx: clear.
|
/approve-spec b9470b2 |
There was a problem hiding this comment.
Approved pending CI: CI started when the pull request was marked ready for review and is still running on this head, with no failure so far.
A toast body that mixes text and a component is announced with every word it shows, once per showing, and the once-per-showing rule is recorded in the status-announcement and Toast records with an engineering owner's approval at this head. No blocking findings remain.
Optional, as noted before: the changeset could say that words a component fills in after the toast appears, such as an amount set in an effect, are not read.
Claims and files checked
Review mode: same-head; reason: none
- Changed rules since the last review (0).
- Claim: a body that mixes text and a component is announced with every word it shows: verified (the new viewport test fails on the base and passes on this head).
- Claim: a component with text children that renders other words, such as a translated message, is read from what it renders: verified (every element body now takes the rendered read).
- Claim: plain-text bodies are announced at dispatch, as before: verified (strings, numbers and lists of them keep the dispatch path; the string and error tests pass).
- Claim: a mixed body is read once per showing, and a later change inside it does not announce again: verified (one announcement, also after the card renders again on dismiss).
- Claim: no API change for builders: verified (the announcement hook and its new option are not exported; the toast options are unchanged).
- Claim: the cause is as described: verified against the base's dispatch and row code and the text helper it used.
- Claim: any element body, a fragment included, is read after the first commit, leaving hidden parts out and reading stacked blocks apart: verified (the shared rendered-text reader does both).
- Claim: the shared announcement module gains an internal once option that the toast turns on, and before this change a component body whose words changed was announced again on a later render: verified (the once test fails with the option removed, 2 calls).
- Claim: an overwrite through the unique id is a new showing and is announced: verified (an overwrite takes a new entry id, the hook's occasion; the overwrite tests pass).
- Claim: the Toast record removes the mixed-body gap, narrows the dispatch-timing and hidden-overwrite gaps and their two requirement rows to plain-text bodies, and the gap count goes from sixteen to fifteen: verified (the base lists sixteen gaps, this head fifteen).
- Claim: the status-announcement record's list of components with their own announcement rules now names Toast with its once-per-showing rule, and the Toast record says a text change while a toast shows is not announced again: verified, and approved by an engineering owner at this head.
- Claim: the cited records say what the description quotes: verified.
- Claim: the two new viewport tests fail on main and pass here, and the once test fails without the option: verified (both fail on the base with this head's tests copied in).
- Claim: the module test keeps a text change under one occasion silent and lets a new occasion speak: verified (fails on the base, passes on this head).
- Claim: the existing component-body, string, error, overwrite, StrictMode and adopter tests pass, 178 of 178: verified (the seven Toast and module test files hold 178 tests; all 183 tests in the eleven Toast and hook test files pass at this head).
- Claim: the shared announcement module is reached by ten component folders: verified (ten import it).
- Claim: first-load size per reference page, every page under the limit: verified (base against head on the same patch: docs +23 B, form +41 B, menu +2 B and table +21 B gzip).
- Claim: types and lint are clean: verified (the typecheck and lint checks pass at this head).
- Claim: the knowledge check passes: verified on the same patch.
- Claim: the writing rubric finds no narration, research, change references, long rejected alternatives, ruled open questions or project status in the record edits: verified.
- Claim: the overlapping pull requests touch the swipe, motion and a standalone toast's live role: verified.
- Changeset: a mixed body is announced with all the words it shows: verified for words present when the toast appears (see the optional note).
- Changeset: a body that holds any element is read once, from its rendered text, when the toast is shown: verified.
- Changeset: a plain-text body is announced as before: verified.
- Changeset: a component body or custom card whose words change after the toast shows is no longer announced a second time: verified.
- File
.changeset/toast-mixed-body-announcement.md: clear (optional wording note). - File
docs/specs/AST-086-status-announcements/spec.md: clear. - File
docs/specs/components/Toast/Toast.spec.md: clear. - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.ts: clear. - File
packages/core/src/hooks/useAnnounceRenderedText.test.tsx: clear.
Primary intent
Accessibility fix: a toast whose body mixes text and a component is announced with all the words it shows. Fixes #11948.
User impact
toast({body: <>Payment received: <Amount /></>})was announced as "Payment received:", without the amount. It's now announced as "Payment received: $120.00", the words a sighted user reads. The same applies to a body written as a component with text children that renders other words, such as a translated message.body: 'Upload failed') are announced as before, at dispatch.Cause
addToastannouncedgetNodeText(body)whenever it was non-empty. The toast read its rendered body only when that text was empty.getNodeTextreads strings andchildren, not what a component renders. So a mixed body took the dispatch path and lost the component's words.Change
A plain-text body (a string, a number, or a list of them) is announced at dispatch, as before.
Any other body, any element, a fragment included, is read from its rendered text after the toast's first commit. It uses the same visible-text reading that a component-only body already uses: hidden parts are left out, and stacked blocks are read apart.
Once per showing: the shared announcement module gains an internal
isOncePerOccasionoption, and the toast turns it on. Later text changes under the same showing stay silent. Before this change, a component body whose words changed was announced again on the toast's next render, at the latest when it was dismissed. An overwrite throughuniqueIDis a new showing and is announced.Toast.spec.md:spec:AST-086FR11 and Toast FR9: Toast keeps its own once-per-showing announcement: FR11 namescomponent:Toastamong the components that keep their own announcement rules, and FR9 says a text change while the toast shows is not announced again.Authority
component:ToastFR9 announces "using the toast's text content", andspec:AST-086FR7 has the announced words match the shown words. Toast's Current-state section named this exact case as a gap.spec:AST-086FR6 has one announcement per occasion; the toast's occasion is its showing.architecture:react-component-runtimeINV10 keeps that logic in the shared module, not in Toast.Evidence
Red first: two new cases in
ToastViewport.test.tsxfail on main and pass here:Module test:
useAnnounceRenderedText.test.tsxchecks that a text change under the same occasion stays silent and that a new occasion speaks.Existing cases: component-only body, string body, error body, overwrite, StrictMode and the shared rendered-text adopter test all pass. Toast and the module's tests pass 178 of 178.
First-load size (INV10; the shared announcement module is reached by ten component folders):
pnpm size:pages, base main 843181c vs head, minified / gzip:Every page is under the 307 B limit.
Types and lint:
tscandeslintclean.Records:
pnpm check:knowledgepasses.Writing rubric results
Run over the Toast FR8, FR9 and count lines and the
spec:AST-086FR11 sentence.Owner and land path
Overlap checked: #11517, #11463, #8121 (swipe gesture and motion work in the same Toast files; this changes only which bodies are announced at dispatch versus from rendered text)
Also separate: #11960 (a standalone Toast holds no live role; it touches the viewport only where it passes the live-region flag).