Repository navigation
fix(Comments): announce error banners and progress labels through the shared channel - #7902
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsAlertDialog (@astryxdesign/core) · View in Storybook
AppShell (@astryxdesign/core) · View in Storybook
AspectRatio (@astryxdesign/core) · View in Storybook
Badge (@astryxdesign/core) · View in Storybook
Banner (@astryxdesign/core) · View in Storybook
Blockquote (@astryxdesign/core) · View in Storybook
Button (@astryxdesign/core) · View in Storybook
ButtonGroup (@astryxdesign/core) · View in Storybook
Calendar (@astryxdesign/core) · View in Storybook
Card (@astryxdesign/core) · View in Storybook
Carousel (@astryxdesign/core) · View in Storybook
Center (@astryxdesign/core) · View in Storybook
CheckboxInput (@astryxdesign/core) · View in Storybook
ClickableCard (@astryxdesign/core) · View in Storybook
Code (@astryxdesign/core) · View in Storybook
CodeBlock (@astryxdesign/core) · View in Storybook
ComplexSelector (@astryxdesign/core) · View in Storybook
ContextMenu (@astryxdesign/core) · View in Storybook
DateInput (@astryxdesign/core) · View in Storybook
DateTimeInput (@astryxdesign/core) · View in Storybook
Divider (@astryxdesign/core) · View in Storybook
EmptyState (@astryxdesign/core) · View in Storybook
FieldStatus (@astryxdesign/core) · View in Storybook
FileInput (@astryxdesign/core) · View in Storybook
FormLayout (@astryxdesign/core) · View in Storybook
HoverCard (@astryxdesign/core) · View in Storybook
Icon (@astryxdesign/core) · View in Storybook
IconButton (@astryxdesign/core) · View in Storybook
Item (@astryxdesign/core) · View in Storybook
Kbd (@astryxdesign/core) · View in Storybook
Lightbox (@astryxdesign/core) · View in Storybook
Markdown (@astryxdesign/core) · View in Storybook
MoreMenu (@astryxdesign/core) · View in Storybook
MultiSelector (@astryxdesign/core) · View in Storybook
NavIcon (@astryxdesign/core) · View in Storybook
NumberInput (@astryxdesign/core) · View in Storybook
Overlay (@astryxdesign/core) · View in Storybook
Popover (@astryxdesign/core) · View in Storybook
PowerSearch (@astryxdesign/core) · View in Storybook
ProgressBar (@astryxdesign/core) · View in Storybook
Section (@astryxdesign/core) · View in Storybook
SelectableCard (@astryxdesign/core) · View in Storybook
Skeleton (@astryxdesign/core) · View in Storybook
Slider (@astryxdesign/core) · View in Storybook
Spinner (@astryxdesign/core) · View in Storybook
StatusDot (@astryxdesign/core) · View in Storybook
Switch (@astryxdesign/core) · View in Storybook
Text (@astryxdesign/core) · View in Storybook
TextArea (@astryxdesign/core) · View in Storybook
TextInput (@astryxdesign/core) · View in Storybook
Thumbnail (@astryxdesign/core) · View in Storybook
TimeInput (@astryxdesign/core) · View in Storybook
Timestamp (@astryxdesign/core) · View in Storybook
Toast (@astryxdesign/core) · View in Storybook
Token (@astryxdesign/core) · View in Storybook
Tokenizer (@astryxdesign/core) · View in Storybook
Toolbar (@astryxdesign/core) · View in Storybook
Tooltip (@astryxdesign/core) · View in Storybook
TreeList (@astryxdesign/core) · View in Storybook
VisuallyHidden (@astryxdesign/core) · View in Storybook
CircularProgress (@astryxdesign/lab) · View in Storybook
DiffViewer (@astryxdesign/lab) · View in Storybook
EmojiPicker (@astryxdesign/lab) · View in Storybook
InfoTip (@astryxdesign/lab) · View in Storybook
ListInput (@astryxdesign/lab) · View in Storybook
LogStream (@astryxdesign/lab) · View in Storybook
MobilePowerSearch (@astryxdesign/lab) · View in Storybook
MobileTokenizer (@astryxdesign/lab) · View in Storybook
SVGIcon (@astryxdesign/lab) · View in Storybook
Stat (@astryxdesign/lab) · View in Storybook
RichTextEditor (@astryxdesign/richtext) · View in Storybook
RichTextView (@astryxdesign/richtext)
Component Size
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
Accessibility AuditStatus: The accessibility audit did not run on this pull request. It runs after merges to Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
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:260andCommentParts.tsx:295build announcements with a literal.join, which INV1a indocs/architecture/internationalization.mdrules 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, |
There was a problem hiding this comment.
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).
| useStatusAnnouncement( | ||
| loadErrorRef, | ||
| loadError != null | ||
| ? `${t('@astryx.comments.loadFailed')}. ${loadError}` |
There was a problem hiding this comment.
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).
| if (announcedRef.current === message) { | ||
| return; | ||
| } | ||
| announcedRef.current = message; |
There was a problem hiding this comment.
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.
| 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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
|
Thanks for the commits on this branch, they are merged in along with current 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 |
…egions # Conflicts: # packages/lab/src/Comments/CommentParts.tsx
There was a problem hiding this comment.
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 => |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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.
…the locale changeset
|
Both points are in this push.
The Comments suite passes (46 tests in |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
| if (announcedRef.current === message) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
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.
…ated refusal again
|
Both points are in this push.
I checked that both new tests fail without the change. The Comments suite passes (79 tests) and ESLint is clean. |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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.
| 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 `{@@…}` |
There was a problem hiding this comment.
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.
|
Restored |
There was a problem hiding this comment.
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]
…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`.
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"orrole="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
spec:AST-086FR2 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:useStatusAnnouncement, announces a message once per occasion throughuseAnnounce(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'sChatTypingIndicator, kept local rather than adding a core export.ErrorBanner(older comments, post and reaction failures, composer) and the progress label use it.Testing
Comments.test.tsxandCommentComposer.test.tsx: existinggetByRole('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 whenlayout="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.tscfor lab shows the same 33 errors with and without this change (stale core build output in this checkout), none in files I touched.@astryxdesign/labis private, socheck:changesetsrejects one.Assistive technology (spec:AST-009)
loadError, or fail a post, reaction or "load earlier" action, or show a comment withprogress. 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.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.