Skip to content

fix(Comments): announce error banners and progress labels through the shared channel - #7902

Merged
cixzhang merged 12 commits into
meta:mainfrom
HelloOjasMutreja:fix/comments-live-regions
Oct 31, 2026
Merged

cixzhang merged 12 commits into
meta:mainfrom
HelloOjasMutreja:fix/comments-live-regions

Conversation

@HelloOjasMutreja

@HelloOjasMutreja HelloOjasMutreja commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7863

Follows the plan posted on the issue.

User impact

A screen reader user of a Comments panel can miss a load failure, a failed post or reaction, an "earlier comments could not load" error, or a comment's progress label ("Checking the rollout…"). Each is inserted as a new role="alert" or role="status" element that already holds its text, and screen readers commonly skip a live region that is born with its content.

Problem and solution fit

  • Why does it happen? The error Banners and the progress label set their own live role and mount only when needed, already holding their text.
  • Why does it matter? spec:AST-086 FR2 says a transient message announces through the shared channel; FR4 says a live container owns content added inside it; FR5 says errors are assertive; FR6 says once per occasion.

Fix, all inside packages/lab/src/Comments:

  • The visible Banners and the progress label lose their live roles.
  • A small internal hook, useStatusAnnouncement, announces a message once per occasion through useAnnounce (errors assertive, progress polite). A changed message is a new occasion; a rerender or a StrictMode replay is not. It stays silent when the element sits inside a live container, so inside the chat log the log delivers it as before. Same shape as fix(ChatTypingIndicator): announce through the shared channel, not a live region born with its text #7867's ChatTypingIndicator, kept local rather than adding a core export.
  • The load-failure Banner, ErrorBanner (older comments, post and reaction failures, composer) and the progress label use it.
  • The edit-history failure lives in a native modal, where the shared channel is not exposed (spec Platform support). It is delivered by an alert region that mounts empty with the dialog content and receives the Banner (FR3).

Testing

  • Comments.test.tsx and CommentComposer.test.tsx: existing getByRole('alert') / getByRole('status') lookups now find the Banners by their data attributes and assert they have no live role. New tests cover the load failure announced once and not repeated on rerender, an in-timeline failure left to the log, the same failure announced when layout="embedded" has no log, the progress label announced politely outside a log, and the history alert slot. Without the source change eight of the tests fail.
  • Comments suite: 70 passed. eslint and prettier clean. tsc for lab shows the same 33 errors with and without this change (stale core build output in this checkout), none in files I touched.
  • No changeset: @astryxdesign/lab is private, so check:changesets rejects one.
  • Not a visual change, so no screenshot. Spoken output was not checked with a real screen reader (AST-009); the announcement calls are covered by the tests.

Assistive technology (spec:AST-009)

  • Classification: FR4 (announcement content and timing) for failures and the progress label that were live regions born with their content.
  • Scenario: render Comments with loadError, or fail a post, reaction or "load earlier" action, or show a comment with progress. Expected: the failure is spoken once, assertively; the progress label once, politely; inside the chat layout the log reads them and nothing is read twice; the edit-history dialog speaks its failure from the alert region inside the dialog.
Row State
NVDA + Chrome (Windows) pending
VoiceOver + Safari (macOS) pending

Per FR17 the real-AT rows and the release-block record are needed before a stable release; I do not have these assistive technologies available, so a maintainer or another contributor with access would need to record them.

@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 27, 2026 4:52am 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 27, 2026, 5:40 AM UTC

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

⚠️ Approximate analysis - the diff could not be resolved to a merge base, so a two-dot fallback was used. The component list may include base-only changes or miss a component whose change also landed on base.

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

AlertDialog (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 191B N/A
Lines of Code N/A 182 -
Complexity N/A Medium (12) -
AppShell (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 785B N/A
Lines of Code N/A 608 -
Complexity N/A Very High (109) -
AspectRatio (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 358B N/A
Lines of Code N/A 109 -
Complexity N/A Medium (7) -
Badge (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 664B N/A
Lines of Code N/A 189 -
Complexity N/A Low (4) -
Banner (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 1.2KB N/A
Lines of Code N/A 419 -
Complexity N/A Very High (43) -
Blockquote (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 351B N/A
Lines of Code N/A 62 -
Complexity N/A Low (2) -
Button (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 712B N/A
Lines of Code N/A 562 -
Complexity N/A Very High (78) -
ButtonGroup (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 401B N/A
Lines of Code N/A 128 -
Complexity N/A Low (3) -
Calendar (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 717B N/A
Lines of Code N/A 1641 -
Complexity N/A Very High (171) -
Card (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 940B N/A
Lines of Code N/A 189 -
Complexity N/A Medium (10) -
Carousel (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 272B N/A
Lines of Code N/A 486 -
Complexity N/A Very High (63) -
Center (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 341B N/A
Lines of Code N/A 118 -
Complexity N/A High (22) -
CheckboxInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 478B N/A
Lines of Code N/A 355 -
Complexity N/A Very High (39) -
ClickableCard (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 427B N/A
Lines of Code N/A 229 -
Complexity N/A High (19) -
Code (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 258B N/A
Lines of Code N/A 81 -
Complexity N/A Low (2) -
CodeBlock (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 860B N/A
Lines of Code N/A 1818 -
Complexity N/A Very High (122) -
ComplexSelector (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 258B N/A
Lines of Code N/A 635 -
Complexity N/A Very High (70) -
ContextMenu (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 1.1KB N/A
Lines of Code N/A 639 -
Complexity N/A Very High (84) -
DateInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 266B N/A
Lines of Code N/A 3525 -
Complexity N/A Very High (386) -
DateTimeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 286B N/A
Lines of Code N/A 3609 -
Complexity N/A Very High (559) -
Divider (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 618B N/A
Lines of Code N/A 153 -
Complexity N/A Medium (12) -
EmptyState (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 153B N/A
Lines of Code N/A 143 -
Complexity N/A Medium (11) -
FieldStatus (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 592B N/A
Lines of Code N/A 151 -
Complexity N/A Low (3) -
FileInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 465B N/A
Lines of Code N/A 724 -
Complexity N/A Very High (108) -
FormLayout (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 404B N/A
Lines of Code N/A 94 -
Complexity N/A Low (3) -
HoverCard (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 432B N/A
Lines of Code N/A 683 -
Complexity N/A Very High (95) -
Icon (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 683B N/A
Lines of Code N/A 618 -
Complexity N/A High (30) -
IconButton (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 435B N/A
Lines of Code N/A 17 -
Complexity N/A Low (1) -
Item (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 284B N/A
Lines of Code N/A 1366 -
Complexity N/A Very High (121) -
Kbd (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 291B N/A
Lines of Code N/A 140 -
Complexity N/A Medium (13) -
Lightbox (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 394B N/A
Lines of Code N/A 751 -
Complexity N/A Very High (86) -
Markdown (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 616B N/A
Lines of Code N/A 8674 -
Complexity N/A Very High (285) -
MoreMenu (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 219B N/A
Lines of Code N/A 87 -
Complexity N/A Low (4) -
MultiSelector (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 273B N/A
Lines of Code N/A 2626 -
Complexity N/A Very High (338) -
NavIcon (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 324B N/A
Lines of Code N/A 48 -
Complexity N/A Low (1) -
NumberInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 502B N/A
Lines of Code N/A 1139 -
Complexity N/A Very High (171) -
Overlay (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 216B N/A
Lines of Code N/A 451 -
Complexity N/A Very High (41) -
Popover (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 412B N/A
Lines of Code N/A 686 -
Complexity N/A Very High (79) -
PowerSearch (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 640B N/A
Lines of Code N/A 3948 -
Complexity N/A Very High (348) -
ProgressBar (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 455B N/A
Lines of Code N/A 373 -
Complexity N/A High (29) -
Section (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 620B N/A
Lines of Code N/A 230 -
Complexity N/A Very High (42) -
SelectableCard (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 108B N/A
Lines of Code N/A 305 -
Complexity N/A Very High (32) -
Skeleton (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 387B N/A
Lines of Code N/A 130 -
Complexity N/A Low (3) -
Slider (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 389B N/A
Lines of Code N/A 979 -
Complexity N/A Very High (150) -
Spinner (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 405B N/A
Lines of Code N/A 296 -
Complexity N/A High (25) -
StatusDot (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 604B N/A
Lines of Code N/A 130 -
Complexity N/A Medium (7) -
Switch (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 398B N/A
Lines of Code N/A 569 -
Complexity N/A Very High (50) -
Text (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 1.1KB N/A
Lines of Code N/A 530 -
Complexity N/A High (25) -
TextArea (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 455B N/A
Lines of Code N/A 462 -
Complexity N/A Very High (72) -
TextInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 480B N/A
Lines of Code N/A 376 -
Complexity N/A Very High (68) -
Thumbnail (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 164B N/A
Lines of Code N/A 339 -
Complexity N/A Very High (38) -
TimeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 411B N/A
Lines of Code N/A 1236 -
Complexity N/A Very High (191) -
Timestamp (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 331B N/A
Lines of Code N/A 674 -
Complexity N/A Very High (55) -
Toast (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 304B N/A
Lines of Code N/A 1361 -
Complexity N/A Very High (139) -
Token (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 566B N/A
Lines of Code N/A 459 -
Complexity N/A High (26) -
Tokenizer (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 331B N/A
Lines of Code N/A 872 -
Complexity N/A Very High (120) -
Toolbar (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 340B N/A
Lines of Code N/A 269 -
Complexity N/A High (17) -
Tooltip (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 412B N/A
Lines of Code N/A 576 -
Complexity N/A Very High (65) -
TreeList (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 648B N/A
Lines of Code N/A 872 -
Complexity N/A Very High (100) -
VisuallyHidden (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 379B N/A
Lines of Code N/A 58 -
Complexity N/A Low (2) -
CircularProgress (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 185B N/A
Lines of Code N/A 328 -
Complexity N/A High (23) -
DiffViewer (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 587B N/A
Lines of Code N/A 2173 -
Complexity N/A Very High (182) -
EmojiPicker (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 399B N/A
Lines of Code N/A 3581 -
Complexity N/A Very High (50) -
InfoTip (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 158B N/A
Lines of Code N/A 68 -
Complexity N/A Low (1) -
ListInput (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 415B N/A
Lines of Code N/A 1760 -
Complexity N/A Very High (274) -
LogStream (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 113B N/A
Lines of Code N/A 468 -
Complexity N/A Very High (45) -
MobilePowerSearch (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 336B N/A
Lines of Code N/A 2492 -
Complexity N/A Very High (317) -
MobileTokenizer (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 328B N/A
Lines of Code N/A 598 -
Complexity N/A Very High (64) -
SVGIcon (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 904B N/A
Lines of Code N/A 1337 -
Complexity N/A Very High (38) -
Stat (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A 296B N/A
Lines of Code N/A 203 -
Complexity N/A Medium (7) -
RichTextEditor (@astryxdesign/richtext) · View in Storybook
Metric Before After Delta
Entry File (ESM) N/A N/A N/A
Lines of Code N/A 659 -
Complexity N/A Very High (65) -
RichTextView (@astryxdesign/richtext)
Metric Before After Delta
Entry File (ESM) N/A N/A N/A
Lines of Code N/A 178 -
Complexity N/A Medium (15) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/AlertDialog N/A 51.3KB N/A N/A 12.2KB N/A
core/AppShell N/A 52.5KB N/A N/A 11.4KB N/A
core/AspectRatio N/A 3.6KB N/A N/A 3.3KB N/A
core/Avatar N/A 34.6KB N/A N/A 6.2KB N/A
core/AvatarGroup N/A 36.9KB N/A N/A 6.3KB N/A
core/AvatarGroupOverflow N/A 37.0KB N/A N/A 6.2KB N/A
core/AvatarStatusDot N/A 6.9KB N/A N/A 3.3KB N/A
core/Badge N/A 3.7KB N/A N/A 3.6KB N/A
core/Banner N/A 44.6KB N/A N/A 9.5KB N/A
core/BaseTypeahead N/A 50.7KB N/A N/A 9.7KB N/A
core/Blockquote N/A 3.4KB N/A N/A 3.3KB N/A
core/BottomSheet N/A 25.9KB N/A N/A 7.5KB N/A
core/BottomSheetSwitcher N/A 9.1KB N/A N/A 3.2KB N/A
core/BreadcrumbItem N/A 62.7KB N/A N/A 10.8KB N/A
core/Breadcrumbs N/A 22.3KB N/A N/A 3.1KB N/A
core/Button N/A 40.1KB N/A N/A 9.0KB N/A
core/ButtonGroup N/A 8.3KB N/A N/A 3.2KB N/A
core/Calendar N/A 51.8KB N/A N/A 9.8KB N/A
core/Card N/A 6.3KB N/A N/A 6.2KB N/A
core/Carousel N/A 45.8KB N/A N/A 10.0KB N/A
core/Center N/A 4.0KB N/A N/A 4.4KB N/A
core/ChatComposer N/A 57.2KB N/A N/A 10.5KB N/A
core/ChatComposerDrawer N/A 23.7KB N/A N/A 4.3KB N/A
core/ChatComposerInput N/A 52.4KB N/A N/A 9.8KB N/A
core/ChatComposerTokenElement N/A 52.4KB N/A N/A 9.8KB N/A
core/ChatDictationButton N/A 43.4KB N/A N/A 9.2KB N/A
core/ChatLayout N/A 45.8KB N/A N/A 9.7KB N/A
core/ChatLayoutScrollButton N/A 43.3KB N/A N/A 9.3KB N/A
core/ChatMessage N/A 23.0KB N/A N/A 3.4KB N/A
core/ChatMessageBubble N/A 6.9KB N/A N/A 3.5KB N/A
core/ChatMessageList N/A 28.3KB N/A N/A 7.6KB N/A
core/ChatMessageMetadata N/A 25.7KB N/A N/A 3.7KB N/A
core/ChatSendButton N/A 42.8KB N/A N/A 9.0KB N/A
core/ChatSystemMessage N/A 6.6KB N/A N/A 3.5KB N/A
core/ChatTokenizedText N/A 6.8KB N/A N/A 3.7KB N/A
core/ChatToolCalls N/A 31.7KB N/A N/A 8.7KB N/A
core/CheckIndicator N/A 8.9KB N/A N/A 3.4KB N/A
core/CheckboxIndicator N/A 4.0KB N/A N/A 3.7KB N/A
core/CheckboxInput N/A 46.5KB N/A N/A 9.2KB N/A
core/CheckboxList N/A 43.0KB N/A N/A 7.9KB N/A
core/CheckboxListItem N/A 50.6KB N/A N/A 10.3KB N/A
core/Citation N/A 25.8KB N/A N/A 4.0KB N/A
core/ClickableCard N/A 12.7KB N/A N/A 6.8KB N/A
core/Code N/A 3.4KB N/A N/A 3.2KB N/A
core/CodeBlock N/A 55.6KB N/A N/A 10.4KB N/A
core/Collapsible N/A 11.6KB N/A N/A 4.1KB N/A
core/CollapsibleGroup N/A 6.3KB N/A N/A 3.1KB N/A
core/CommandPalette N/A 49.0KB N/A N/A 11.6KB N/A
core/CommandPaletteEmpty N/A 6.0KB N/A N/A 3.2KB N/A
core/CommandPaletteFooter N/A 23.2KB N/A N/A 3.4KB N/A
core/CommandPaletteGroup N/A 3.3KB N/A N/A 3.2KB N/A
core/CommandPaletteInput N/A 31.7KB N/A N/A 8.0KB N/A
core/CommandPaletteItem N/A 8.3KB N/A N/A 3.3KB N/A
core/CommandPaletteList N/A 22.3KB N/A N/A 3.1KB N/A
core/ComplexSelector N/A 52.1KB N/A N/A 10.3KB N/A
core/ContextMenu N/A 74.0KB N/A N/A 14.2KB N/A
core/ContextMenuItem N/A 16.4KB N/A N/A 5.0KB N/A
core/DateInput N/A 89.7KB N/A N/A 14.3KB N/A
core/DateRangeInput N/A 61.3KB N/A N/A 10.9KB N/A
core/DateTimeInput N/A 99.0KB N/A N/A 14.7KB N/A
core/Dialog N/A 13.6KB N/A N/A 6.9KB N/A
core/DialogHeader N/A 45.7KB N/A N/A 9.5KB N/A
core/Divider N/A 6.3KB N/A N/A 3.4KB N/A
core/Drawer N/A 22.8KB N/A N/A 7.9KB N/A
core/DrawerHeader N/A 45.7KB N/A N/A 10.9KB N/A
core/DropdownMenu N/A 69.0KB N/A N/A 14.4KB N/A
core/DropdownMenuCheckboxItem N/A 16.0KB N/A N/A 5.4KB N/A
core/DropdownMenuDivider N/A 6.5KB N/A N/A 3.4KB N/A
core/DropdownMenuGroup N/A 5.9KB N/A N/A 3.1KB N/A
core/DropdownMenuItem N/A 15.3KB N/A N/A 4.9KB N/A
core/DropdownMenuRadioGroup N/A 5.9KB N/A N/A 3.1KB N/A
core/DropdownMenuRadioItem N/A 16.0KB N/A N/A 5.4KB N/A
core/DropdownMenuSubMenu N/A 54.5KB N/A N/A 9.3KB N/A
core/EmptyState N/A 7.5KB N/A N/A 3.4KB N/A
core/Field N/A 41.2KB N/A N/A 7.7KB N/A
core/FieldLabel N/A 36.9KB N/A N/A 6.4KB N/A
core/FieldStatus N/A 10.2KB N/A N/A 4.0KB N/A
core/FileInput N/A 50.6KB N/A N/A 10.1KB N/A
core/FormLayout N/A 6.2KB N/A N/A 3.2KB N/A
core/Grid N/A 4.2KB N/A N/A 3.5KB N/A
core/GridSpan N/A 3.3KB N/A N/A 3.1KB N/A
core/HStack N/A 7.2KB N/A N/A 4.8KB N/A
core/Heading N/A 9.0KB N/A N/A 6.7KB N/A
core/HoverCard N/A 14.4KB N/A N/A 4.8KB N/A
core/Icon N/A 8.7KB N/A N/A 3.4KB N/A
core/IconButton N/A 40.2KB N/A N/A 9.0KB N/A
core/InputGroup N/A 41.7KB N/A N/A 7.8KB N/A
core/InputGroupText N/A 6.1KB N/A N/A 3.4KB N/A
core/Item N/A 11.2KB N/A N/A 4.5KB N/A
core/Kbd N/A 6.6KB N/A N/A 3.3KB N/A
core/LayerProvider N/A 54.4KB N/A N/A 9.9KB N/A
core/Layout N/A 8.0KB N/A N/A 5.3KB N/A
core/LayoutContent N/A 7.3KB N/A N/A 4.8KB N/A
core/LayoutFooter N/A 7.2KB N/A N/A 4.6KB N/A
core/LayoutHeader N/A 7.2KB N/A N/A 4.6KB N/A
core/LayoutPanel N/A 7.4KB N/A N/A 4.7KB N/A
core/Lightbox N/A 46.5KB N/A N/A 9.6KB N/A
core/Link N/A 40.6KB N/A N/A 7.4KB N/A
core/LinkProvider N/A 3.5KB N/A N/A 20B N/A
core/List N/A 6.6KB N/A N/A 3.3KB N/A
core/ListItem N/A 50.1KB N/A N/A 10.3KB N/A
core/Markdown N/A 133.3KB N/A N/A 16.9KB N/A
core/MetadataList N/A 23.0KB N/A N/A 3.5KB N/A
core/MetadataListItem N/A 6.3KB N/A N/A 3.3KB N/A
core/MobileNav N/A 45.7KB N/A N/A 9.8KB N/A
core/MobileNavToggle N/A 43.2KB N/A N/A 9.2KB N/A
core/MoreMenu N/A 69.2KB N/A N/A 14.4KB N/A
core/MultiSelector N/A 72.0KB N/A N/A 14.1KB N/A
core/NavHeadingMenu N/A 8.8KB N/A N/A 3.1KB N/A
core/NavIcon N/A 3.3KB N/A N/A 3.2KB N/A
core/NumberInput N/A 52.5KB N/A N/A 10.4KB N/A
core/Outline N/A 28.5KB N/A N/A 3.9KB N/A
core/OverflowList N/A 8.4KB N/A N/A 3.4KB N/A
core/Overlay N/A 14.2KB N/A N/A 3.7KB N/A
core/Pagination N/A 83.7KB N/A N/A 14.8KB N/A
core/Popover N/A 44.2KB N/A N/A 9.2KB N/A
core/PowerSearch N/A 144.1KB N/A N/A 18.1KB N/A
core/ProgressBar N/A 7.6KB N/A N/A 6.4KB N/A
core/RadioIndicator N/A 3.7KB N/A N/A 3.6KB N/A
core/RadioList N/A 42.5KB N/A N/A 7.8KB N/A
core/RadioListItem N/A 49.2KB N/A N/A 9.4KB N/A
core/ResizeHandle N/A 25.0KB N/A N/A 3.7KB N/A
core/ScrollableArea N/A 10.4KB N/A N/A 4.2KB N/A
core/Section N/A 7.4KB N/A N/A 6.0KB N/A
core/SegmentedControl N/A 35.9KB N/A N/A 6.2KB N/A
core/SegmentedControlItem N/A 8.5KB N/A N/A 3.7KB N/A
core/SelectableCard N/A 12.6KB N/A N/A 7.0KB N/A
core/Selector N/A 75.2KB N/A N/A 14.5KB N/A
core/SelectorOption N/A 14.4KB N/A N/A 4.8KB N/A
core/SideNav N/A 52.8KB N/A N/A 10.3KB N/A
core/SideNavCollapseButton N/A 43.6KB N/A N/A 9.2KB N/A
core/SideNavHeading N/A 51.6KB N/A N/A 9.9KB N/A
core/SideNavItem N/A 51.3KB N/A N/A 9.9KB N/A
core/SideNavSection N/A 6.4KB N/A N/A 3.5KB N/A
core/Skeleton N/A 3.7KB N/A N/A 3.5KB N/A
core/Slider N/A 45.5KB N/A N/A 8.3KB N/A
core/Spinner N/A 26.2KB N/A N/A 7.4KB N/A
core/Stack N/A 6.9KB N/A N/A 4.8KB N/A
core/StackItem N/A 5.9KB N/A N/A 3.2KB N/A
core/StatusDot N/A 16.1KB N/A N/A 6.0KB N/A
core/Step N/A 32.3KB N/A N/A 5.1KB N/A
core/Stepper N/A 44.4KB N/A N/A 9.3KB N/A
core/Switch N/A 45.4KB N/A N/A 9.1KB N/A
core/Tab N/A 9.6KB N/A N/A 4.0KB N/A
core/TabList N/A 37.3KB N/A N/A 7.0KB N/A
core/TabMenu N/A 48.5KB N/A N/A 9.8KB N/A
core/Table N/A 80.2KB N/A N/A 14.6KB N/A
core/TableBody N/A 3.2KB N/A N/A 3.0KB N/A
core/TableCell N/A 75.0KB N/A N/A 14.4KB N/A
core/TableFooter N/A 3.2KB N/A N/A 3.0KB N/A
core/TableHeader N/A 3.2KB N/A N/A 3.0KB N/A
core/TableHeaderCell N/A 74.8KB N/A N/A 14.3KB N/A
core/TableRow N/A 6.1KB N/A N/A 3.4KB N/A
core/TableSelectionToolbar N/A 49.1KB N/A N/A 11.0KB N/A
core/Text N/A 8.5KB N/A N/A 6.7KB N/A
core/TextArea N/A 46.0KB N/A N/A 9.1KB N/A
core/TextInput N/A 50.0KB N/A N/A 10.2KB N/A
core/Thumbnail N/A 47.0KB N/A N/A 10.8KB N/A
core/TimeInput N/A 76.2KB N/A N/A 13.2KB N/A
core/Timer N/A 9.1KB N/A N/A 6.7KB N/A
core/Timestamp N/A 27.4KB N/A N/A 9.3KB N/A
core/Toast N/A 51.2KB N/A N/A 9.5KB N/A
core/ToggleButton N/A 41.0KB N/A N/A 9.1KB N/A
core/ToggleButtonGroup N/A 6.2KB N/A N/A 3.1KB N/A
core/Token N/A 29.5KB N/A N/A 4.3KB N/A
core/Tokenizer N/A 61.2KB N/A N/A 11.4KB N/A
core/Toolbar N/A 36.9KB N/A N/A 7.6KB N/A
core/Tooltip N/A 14.1KB N/A N/A 4.8KB N/A
core/TopNav N/A 46.6KB N/A N/A 10.1KB N/A
core/TopNavHeading N/A 51.0KB N/A N/A 9.7KB N/A
core/TopNavItem N/A 8.9KB N/A N/A 3.7KB N/A
core/TopNavMegaMenu N/A 51.0KB N/A N/A 10.5KB N/A
core/TopNavMegaMenuFeaturedCard N/A 6.6KB N/A N/A 3.3KB N/A
core/TopNavMegaMenuItem N/A 9.0KB N/A N/A 3.9KB N/A
core/TopNavMenu N/A 50.5KB N/A N/A 9.9KB N/A
core/TreeList N/A 32.4KB N/A N/A 4.5KB N/A
core/Typeahead N/A 57.8KB N/A N/A 11.0KB N/A
core/TypeaheadItem N/A 6.1KB N/A N/A 3.3KB N/A
core/VStack N/A 7.2KB N/A N/A 4.8KB N/A
core/VisuallyHidden N/A 3.4KB N/A N/A 291B N/A
lab/ChatEmojiPicker N/A 55.6KB N/A N/A 773B N/A
lab/ChatReactionBar N/A 56.2KB N/A N/A 1.1KB N/A
lab/ChatTypingIndicator N/A 23.4KB N/A N/A 612B N/A
lab/ChatUnreadDivider N/A 3.4KB N/A N/A 343B N/A
lab/CircularProgress N/A 7.0KB N/A N/A 1022B N/A
lab/CommentComposer N/A 89.7KB N/A N/A 1.9KB N/A
lab/CommentThread N/A 201.0KB N/A N/A 2.4KB N/A
lab/Comments N/A 205.9KB N/A N/A 2.5KB N/A
lab/DiffViewer N/A 43.6KB N/A N/A 2.1KB N/A
lab/EmojiPicker N/A 59.3KB N/A N/A 722B N/A
lab/InfoTip N/A 18.7KB N/A N/A 458B N/A
lab/ListInput N/A 60.7KB N/A N/A 1.6KB N/A
lab/LogStream N/A 7.8KB N/A N/A 1.6KB N/A
lab/MobilePowerSearch N/A 148.2KB N/A N/A 1.4KB N/A
lab/MobileTokenizer N/A 82.3KB N/A N/A 775B N/A
lab/SVGIcon N/A 7.4KB N/A N/A 761B N/A
lab/Stat N/A 4.0KB N/A N/A 644B N/A
lab/Tour N/A 3.7KB N/A N/A 20B N/A
lab/TourStep N/A 47.5KB N/A N/A 590B N/A
richtext/RichTextEditor N/A 264.9KB N/A N/A 2.6KB N/A
richtext/RichTextView N/A 246.0KB N/A N/A 2.3KB N/A

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core 4.9KB N/A 1.2KB
@astryxdesign/lab 4.6KB N/A 1.9KB
@astryxdesign/richtext 1.4KB N/A 746B

Accessibility Audit

Status: The accessibility audit did not run on this pull request. It runs after merges to main and before each release; pull requests that touch components run it with the ci:heavy-lanes label.


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.

Thanks for moving Comments onto the shared announcement channel: the routing matches AST-086 in both layouts and nothing changes visually, but a few fixes are needed before approval.

  • In the embedded layout and CommentThread, pressing Retry a second time after a failed retry re-announces “Couldn't send this comment.” as the retry starts, because clearing the description changes the announced message; announce each failure where it happens (as the delete failure does) or key the occasion on the failure.
  • Comments.tsx:260 and CommentParts.tsx:295 build announcements with a literal . join, which INV1a in docs/architecture/internationalization.md rules out and which reads “comment.. Retrying didn't work.” in English; use one catalog message with placeholders instead.
  • The edit-history slot test also passes against the previous code; assert the empty slot while history is loading and that the Banner itself has no role.

[Automated review]

const bannerRef = useRef<HTMLDivElement>(null);
useStatusAnnouncement(
bannerRef,
description != null ? `${title}. ${description}` : title,

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 joins title and description with a literal . . INV1a in docs/architecture/internationalization.md asks for one ICU message with placeholders for joined announcement text instead of call-site concatenation, and with the current catalog strings this is announced as “Couldn't send this comment.. Retrying didn't work.”

Keying the announcement on this joined string also means that when a second Retry clears the description, the bare title is announced again while the retry is pending (embedded layout and CommentThread).

Comment thread packages/lab/src/Comments/Comments.tsx Outdated
useStatusAnnouncement(
loadErrorRef,
loadError != null
? `${t('@astryx.comments.loadFailed')}. ${loadError}`

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.

Same pattern for the load failure: t('@astryx.comments.loadFailed'), a literal . and loadError are concatenated here. One catalog message with a placeholder for the caller's text keeps the join translatable (INV1a in docs/architecture/internationalization.md).

Comment on lines +47 to +50
if (announcedRef.current === message) {
return;
}
announcedRef.current = message;

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.

An occasion here is a change of the message string, so a Banner whose description is removed counts as a new occasion: after a failed retry, pressing Retry again clears the retry failure (clearActionError) while status is still error, and the title is announced again as the retry starts. AST-086 FR6 wants one announcement per failure; announcing from the failure handler, as the delete failure does in CommentsContext.tsx, or keying the occasion on the failure would avoid it.

Comment on lines +1468 to +1474
const slot = document.querySelector<HTMLElement>('dialog [role="alert"]');
if (slot == null) {
throw new Error('History alert slot not found');
}
expect(slot.textContent).toContain("Edit history couldn't load");
// The Banner added to the slot has no live role of its own.
expect(slot.querySelector('[role]')).toBeNull();

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 also passes against the previous code: there dialog [role="alert"] matches the Banner itself, which has no other [role] inside. Asserting that the slot exists and is empty while loadVersions is pending, and that the Banner element has no role, would make it fail if the slot were reverted.

…as a retry starts

- The error announcement is one ICU message, @astryx.comments.errorAnnouncement
  ({title} {description}), not a title and description joined with a literal
  ". " (architecture:internationalization INV1a), which also read ".." after
  titles that end in a period.
- An ErrorBanner says nothing while its action runs: starting a second Retry
  no longer re-announces the bare failure, and each failed retry, a new
  occasion, is announced again (spec:AST-086 FR6).
- The history-slot test now proves the slot is mounted empty before the
  failure and receives it, so it fails on main.

@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.

Thanks for moving Comments onto the shared announcement channel: routing now matches AST-086 in both layouts, the retry-start repeat and the joined announcement text are fixed, and nothing changes visually. One fix remains: the failed-post Banner takes isActionDisabled from the panel-wide rowActionsBusy (CommentRow.tsx:375, :504), so in the embedded layout and CommentThread posting any other comment or reply, or uploading an image, re-announces “Couldn't post this comment.” assertively as it settles, right after a successful post (AST-086 FR6). Silencing the announcement only while that comment's own action is pending (or announcing the retry failure from the catch in runCommentAction, as the delete failure does), plus a test that posts once more in the embedded layout, would close it.

[Automated review]

// the outcome is the next occasion (spec:AST-086 FR6).
useStatusAnnouncement(
bannerRef,
isActionDisabled === true

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.

isActionDisabled doubles as the announcement gate here, and the failed-post caller passes the panel-wide rowActionsBusy (CommentRow.tsx:375, :504), which is also true while any other post, reply or composer upload is pending. In the embedded layout and CommentThread that clears the hook's record, so when the unrelated action settles “Couldn't post this comment.” is announced again, assertively (AST-086 FR6: “Rerender, StrictMode replay, and an update to the same value do not repeat it.”). Gating on the comment's own pending action (isBusy) through a separate field, or announcing the retry failure from the catch in runCommentAction as the delete failure does, keeps the retry behaviour without the repeat.

…y runs

The failed-post Banner silenced itself while the panel-wide rowActionsBusy
was true, which is also true while any other post, reply or upload is
pending, so an unrelated action settling announced the failure again
(spec:AST-086 FR6). ErrorBanner now takes isRetrying, and CommentRow passes
the comment's own pending state.

@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.

Thanks: this head fixes the repeated failed-post announcement, and Comments' failures and progress label now follow AST-086 in both layouts with no visual change, so one thing remains before approval. The pause that keeps a failed post silent only while its own retry runs (isRetrying: isBusy, CommentRow.tsx:505) has no regression test: switching it back to the panel-wide rowActionsBusy leaves every test green while an unrelated post re-announces the failure. Please add a test to the Comments status announcements block that renders an embedded failed post, cycles isSubmitting once (or posts another comment) and expects a single announcement (AST-086 FR6; docs/architecture/component-test-sufficiency.md INV4 and INV10).

[Automated review]

actionLabel: can.retry ? t('@astryx.comments.retry') : undefined,
onAction: can.retry ? () => scope.retry(comment) : undefined,
isActionDisabled: rowActionsBusy,
isRetrying: isBusy,

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 scoping is what keeps an unrelated post, reply or upload from re-announcing the failure, but no test protects it: with isRetrying: rowActionsBusy here, every Comments test still passes while a single isSubmitting cycle in the embedded layout announces "Couldn't post this comment." twice. A channel-spy test that cycles isSubmitting once with a failed post showing and expects one announcement would fail on that change (AST-086 FR6 verification row; component-test-sufficiency INV4, INV10).

…led post

Pins the own-retry pause (spec:AST-086 FR6): reverting it to the panel-wide
busy state re-announces the failure when another post settles. Shares one
failed-comment fixture across the announcement tests, and keeps CommentRow's
existing formatting.

@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.

Thanks: Comments' failure Banners and progress label now follow AST-086 in both layouts with no visual change, and the own-retry pause is covered by a test, but one fix remains before approval. In layout="embedded" and CommentThread, a failed delete is now announced twice: the delete dialog's handler announces "This comment couldn't be deleted. Try again." (CommentsContext.tsx:495) and the row's action ErrorBanner (CommentRow.tsx:531-543) now announces "This comment couldn't be deleted." for the same failure (AST-086 FR6). Keeping the dialog as the only owner, for example by marking that stored failure as already announced and passing null to useStatusAnnouncement for it, plus a test that fails a delete in the embedded layout and expects one announcement, would close it. The branch also needs a merge with main, which changed the same HistoryDialog lines in CommentParts.tsx (#7909).

[Automated review]

const {actionLabel, description, isActionDisabled, onAction, title} = content;
const t = useTranslator();
const bannerRef = useRef<HTMLDivElement>(null);
useStatusAnnouncement(

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.

Outside a chat log this also announces a failed delete. runCommentAction stores the delete failure for the row (CommentsContext.tsx:358-366), so the row's action Banner says "This comment couldn't be deleted." right after the delete dialog's handler has said "This comment couldn't be deleted. Try again." (CommentsContext.tsx:495). In layout="embedded" and CommentThread a channel spy records two assertive announcements for that one failure (AST-086 FR6); marking that stored failure as already announced and passing null here for it keeps the dialog as the only owner.

@HelloOjasMutreja

Copy link
Copy Markdown
Contributor Author

Thanks for the commits on this branch, they are merged in along with current main (the HistoryDialog lines merged without conflict).

The double announcement of a failed delete is fixed in this push. The delete dialog stays the only owner: after it announces "This comment couldn't be deleted. Try again.", it marks the failure stored for the row as already announced, and the row's action Banner stays silent for it. A later failure, such as a retry that fails again, is a new occasion and announces normally. The new test fails a delete in layout="embedded" and expects exactly one assertive announcement; it fails if the marker is dropped. Comments suite: 73 passed.

…egions

# Conflicts:
#	packages/lab/src/Comments/CommentParts.tsx

@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.

Thanks: Comments' failure Banners and progress label now follow AST-086 in both layouts with no visual change, and the new marker stops a delayed delete failure from being announced twice, but two fixes remain before approval. When onDelete throws synchronously (its MaybePromise type allows it) or returns an already-rejected promise, the stored failure renders before confirmDelete marks it (CommentsContext.tsx:503-510), so in layout="embedded" the row's Banner still announces "This comment couldn't be deleted." beside the dialog's sentence; storing the failure already marked in runCommentAction's catch, plus the synchronous variant of the new delete test (which fails today), would close it. The new @astryx.comments.errorAnnouncement key in packages/core/locales/en.json also needs a [fix] Changeset naming @astryxdesign/core (AST-017 FR7), which is what the failing Lint check reports.

[Automated review]

announce(message, 'assertive');
// The dialog owns this failure's announcement (AST-086 FR1, FR6); the
// stored failure the row shows must not say it a second time.
setActionErrors(previous =>

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 marker lands in a second update, after runCommentAction has already stored the failure (:363). When onDelete throws synchronously (its MaybePromise type allows it) or returns an already-rejected promise, the unmarked failure renders first after a real click, so in layout="embedded" the row's ErrorBanner also writes "This comment couldn't be deleted." to the assertive region: two writes in one frame in Chromium, and the new delete test fails with both calls when onDelete throws synchronously (AST-086 FR6). Storing the failure already marked in the catch that stores it removes the ordering dependency.

"defaultMessage": "Resolved by {name}",
"description": "Tooltip of the Resolved text on a comment thread in a lab Comments panel. `name` is the person who resolved it."
},
"@astryx.comments.errorAnnouncement": {

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.

A new English key in @astryxdesign/core needs a Changeset naming core: AST-017 FR7 exempts only translation updates and English description or formatting edits that keep every key and default message, and CI's lint job fails on this file. pnpm changeset:new --packages @astryxdesign/core --category fix adds one.

@HelloOjasMutreja

Copy link
Copy Markdown
Contributor Author

Both points are in this push.

  • A failed delete is now stored already marked as announced (runCommentAction takes an isAnnounced argument, and confirmDelete passes it), so the row's Banner is silent from its first render. This covers a synchronous throw and an already-rejected promise. The follow-up state update in confirmDelete is gone. I added the synchronous-throw variant of the delete test and checked that it fails without the change.
  • Added a [fix] changeset for @astryxdesign/core covering the @astryx.comments.errorAnnouncement key; check:changesets passes.

The Comments suite passes (46 tests in Comments.test.tsx).

@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.

Thanks: a failed delete of a sent comment is now announced once in every timing and the core Changeset is in, but two small fixes remain before approval. Deleting a comment whose post failed is still announced twice in layout="embedded" and CommentThread, because the failed-post Banner shows the delete failure as its description but never receives isAnnounced (CommentRow.tsx:505); passing isAnnounced: actionFailure?.isAnnounced there, with a test that deletes a failed post, closes it. useStatusAnnouncement also treats a new failure with unchanged words as a repeat (useStatusAnnouncement.ts:47-49), so picking a second non-image file in a composer outside the chat log is silent, which AST-086 FR6 rules out ("A new occasion with the same words announces again"); keying that Banner per failure, as the earlier-comments Banner does, or giving the hook an occasion argument, plus a test, would fix it.

[Automated review]

actionLabel: can.retry ? t('@astryx.comments.retry') : undefined,
onAction: can.retry ? () => scope.retry(comment) : undefined,
isActionDisabled: rowActionsBusy,
isRetrying: isBusy,

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 Banner also shows a stored delete failure as its description (:501), but only the action Banner reads isAnnounced (:540). Deleting a comment whose post failed, with a failing onDelete, therefore writes "Couldn't post this comment. This comment couldn't be deleted." to the assertive channel beside the dialog's "This comment couldn't be deleted. Try again." in layout="embedded", whether onDelete throws, rejects at once or rejects later (AST-086 FR1, FR6). Adding isAnnounced: actionFailure?.isAnnounced here leaves one write in all three timings and keeps the existing tests green; a test that deletes a failed post would protect it.

Comment on lines +47 to +49
if (announcedRef.current === message) {
return;
}

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.

An occasion here is a change of message text, so a new failure with the same words is skipped while the Banner stays mounted: picking a second non-image file in a composer outside the chat log leaves "Only image files can be added" unchanged and announces nothing. AST-086 FR6 says "A new occasion with the same words announces again." A per-failure key on that Banner (as key={olderFailureCount} does for earlier comments) or an occasion argument, like core's internal useAnnounceRenderedText(ref, isShown, occasion), would cover it.

@HelloOjasMutreja

Copy link
Copy Markdown
Contributor Author

Both points are in this push.

  • Deleting a comment whose post failed: the failed-post Banner now receives isAnnounced from the stored failure, so its description (the delete failure) is not said a second time. New test deletes a failed post in layout="embedded" and expects one announcement.
  • A second refusal with the same words: the composer's action-failure Banner is keyed per failure, so each refusal mounts its own Banner and is announced again (FR6). New test picks two non-image files in a row and expects two announcements.

I checked that both new tests fail without the change. The Comments suite passes (79 tests) and ESLint is clean.

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 25, 2026

@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.

Thanks: the Comments announcement changes now match AST-086 in both layouts, and both points from the last review (a failed post's delete announced twice, and a repeated refusal left silent) are fixed. One change remains before approval: the latest merge of main ran the pre-commit Prettier hook over three unrelated files, docs/architecture/cli-surface.md, docs/specs/AST-081-global-mode/spec.md and packages/cli/assets/templates/pages/library/page.tsx, which fails the required lint job's Changeset coverage for @astryxdesign/cli and puts this PR behind the spec-owner gate. Restoring those three files from main, committed with the hook skipped (for example HUSKY=0) so lint-staged does not reformat them again, should clear both.

[Automated review]

type: 'Component',
imageUrl:
'/template-assets/colorful-home-horizontal-1.png',
imageUrl: '/template-assets/colorful-home-horizontal-1.png',

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 template changes only because the pre-commit Prettier hook ran while main was merged in, and it is what makes the required lint job ask for an @astryxdesign/cli Changeset. Restoring it from main (together with docs/architecture/cli-surface.md and docs/specs/AST-081-global-mode/spec.md), committed with the hook skipped, keeps this PR to Comments.

Comment thread docs/specs/AST-081-global-mode/spec.md Outdated
place of the leading `astryx` when it prints or writes that text. A doc writes a
package-manager step as a `{@pm …}` token, or as `{@pm-only <manager>
"<reason>" …}` for a step only that package manager can do, and `{@@…}`
"<reason>" …}` for a step only that package manager can do, and `{@@…}`

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.

Whitespace-only edit to a current spec record, from the same merge-time Prettier run; it renders the same but puts this PR behind spec-owner approval. Restoring the file from main removes that gate.

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 27, 2026
@HelloOjasMutreja

Copy link
Copy Markdown
Contributor Author

Restored docs/architecture/cli-surface.md, docs/specs/AST-081-global-mode/spec.md and packages/cli/assets/templates/pages/library/page.tsx from main in 75c8ae0, committed with the hook skipped so lint-staged did not reformat them again. The diff against main is now only Comments, the en.json strings and the changesets, and changeset coverage passes locally.

@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.

Thanks: this looks ready for an engineering owner's approval. The Comments error Banners and progress label now follow AST-086 in both layouts (one channel announcement per failure outside the chat log, the log delivering them inside it), the edit-history failure lands in an alert region that exists before it, nothing changes visually, and the three unrelated files from the last merge are restored. Two small notes that do not block: the PR description still says no Changeset is needed and cites 70 tests, and the NVDA + Chrome and VoiceOver + Safari rows remain recommended follow-up rather than a merge requirement under AST-009 FR17.

[Automated review]

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Oct 31, 2026
@cixzhang cixzhang closed this Oct 31, 2026
@cixzhang cixzhang reopened this Oct 31, 2026
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
…oined (#9070)

## Exact decision needed

Whether `spec:AST-086` FR9's shared channel joins a component's superseded message about its current state with its next one, and the optional public `useAnnounce` option that asks for replacement. Today every message written to a region before the previous one is exposed is joined, so a component that states its current state on every input, such as a search's result count, has all its stale states spoken together when input outpaces a frame (a barcode scanner, dictation, automation): `1 result Create "Urg" Create "Urge" Create "Urgen" Create "Urgent"`.

## Existing authority searched

- `spec:AST-086` FR9 (the join), FR6 (an identical message repeated in a frame is one message), FR8 (a busy start its outcome overtakes is dropped), FR13 and FR14 (own-content messages and modal containers).
- `architecture:interaction-modality` INV8: superseded work must not change the current status or announcement, with supersession left to component contracts.
- `spec:AST-075` DEC-2 and FR7: Astryx's comboboxes announce their result count with `useAnnounce`, the same hook products use. Tokenizer's record: its sheet's count and empty-state text go through `useAnnounce`. MultiSelector's record (draft): its result count and create row label go through the polite channel.
- `spec:AST-002` FR1, FR2, FR5, FR7, FR16 and FR20 for the new public option; `has*` booleans such as `hasClear` and `hasPaging` for its name.
- Open pull requests that mention AST-086 (#7871, #7902, #7910, #8175, #8211, #8583, #8001): none edits FR9. #8640 implements the replacement for MultiSelector and waits for this decision.

## Decision

A `useAnnounce` instance created with `hasReplace` states one current state of its owner, such as a search's result count: each message it writes withdraws that instance's previous message while it is not yet exposed, whatever their urgencies, and is spoken in the region of its own urgency; a message already exposed has been heard and stays. Messages from other instances, and from instances without `hasReplace`, still join. `useAnnounce` takes an optional options object with one field, `hasReplace` (default `false`), and the `announce(message, politeness)` it returns is unchanged. FR14's modal containers withdraw the same way, and a picker's own empty-panel message comes from its search's `hasReplace` instance (FR13). Astryx's search counts and MultiSelector's create row use a separate `useAnnounce({hasReplace: true})` instance (`spec:AST-075` FR7, Tokenizer's and MultiSelector's records); selection messages keep their own plain instance. DEC-4 records it; its decider is the approving engineering owner, with INV8 and FR8 as its reasons.

Public option (`spec:AST-002` FR5, FR20): two otherwise identical messages, `"7 results"` written twice in one frame, need different outcomes. As a search's count it replaces the earlier one; as two distinct notices both are spoken. Only the caller knows which it sends, and the channel cannot derive it. Before: `const announce = useAnnounce(); announce(t('resultCount', {count}));`. After: `const announceCount = useAnnounce({hasReplace: true}); announceCount(t('resultCount', {count}));`. Existing calls are unchanged.

## Rejected alternatives

- Each owner debouncing its own messages: every announcement waits, and every owner repeats the rule.
- An exception for every `useAnnounce` message: Astryx's comboboxes and Tokenizer announce through `useAnnounce`, so their counts would keep joining.
- A string key on each message (`announce(message, politeness, {currentState})`): a third argument whose strings every call must keep consistent, where one instance already states one state.

## Claim scope and non-goals

FR9's replacement within one `hasReplace` instance, the option that asks for it, and the AST-075, Tokenizer and MultiSelector sentences that describe their counts' announcement. Which messages a component sends through a `hasReplace` instance stays with its own record.

## Evidence and implementation relationship

- On main, the MultiSelector CreateRow accessibility spec, which types into the create row at about four keystrokes per frame, fails 9 of 10 runs alone and 26 of 48 under load, its polite region reading the joined statuses.
- #8640 implements the replacement for MultiSelector. With it, the spec passes 10 of 10 alone and 48 of 48 under load. It lands after this record changes, adopting `useAnnounce({hasReplace: true})`.

## Writing rubric results

- R1 narration: none, in AST-086, AST-075, Tokenizer's or MultiSelector's record.
- R2 research in the record: none.
- R3 evidence naming a change: none.
- R4 rejected alternatives over one line or outside a decision: one, inside DEC-4, one line; nothing added to the other records.
- R5 pull request or issue references remaining: none.
- 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

Local gates at 2b84901: `pnpm check:knowledge` (records and templates aligned), Prettier, `git diff --check`, `pnpm check:repo`.
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Oct 31, 2026
@cixzhang
cixzhang merged commit b4b978d into meta:main Oct 31, 2026
158 of 165 checks passed
@HelloOjasMutreja
HelloOjasMutreja deleted the fix/comments-live-regions branch October 31, 2026 07:10

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Comments (lab): error banners and progress labels mount as live regions with their text

2 participants