Repository navigation
fix(Dialog): a DialogHeader that mounts after the dialog opens names it - #11828
Conversation
Dialog set its default aria-labelledby only in its own callback ref, so a header that mounted later never named it. The header title's callback ref now reports its mount and unmount through the dialog context, and the dialog sets or clears the default name. A caller aria-label or aria-labelledby still wins, including one that arrives later. Dialog's record gains AR4.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec b14a8ab |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/CommentThread | 379.5 kB (+71 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/Comments | 386.5 kB (+64 B) · 2.5 kB CSS (0) | — | — · — · — |
| DialogHeader | 70.5 kB (+45 B) · 12.8 kB CSS (0) | — | ✓ · ✓ · ✓ |
8 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Dialog | 27.8 kB (+33 B) · 7.3 kB CSS (0) | — | ✓ · ✓ · — |
| AlertDialog | 132.8 kB (+26 B) · 16.2 kB CSS (0) | — | — · — · — |
| CommandPalette | 82.5 kB (+25 B) · 13.5 kB CSS (0) | — | — · — · — |
| Tokenizer | 111.0 kB (+1 B) · 21.5 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 33.9 kB (0) · 7.9 kB CSS (0) | — | — · — · — |
| CommandPaletteItem | 13.6 kB (0) · 3.6 kB CSS (0) | — | — · — · — |
| lab/DialogHeroHeader | 91.7 kB (0) · 372 B CSS (0) | — | — · — · — |
| PowerSearch | 316.2 kB (−1 B) · 26.9 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 7.85 MB packed (+396 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: the fix works, but the release note and the description misstate one case it changes.
- The changeset and the description's "Unchanged" bullet say a dialog's own
aria-labelstill wins as before, but onmainanaria-labelthat arrives while aDialogHeaderis mounted loses to the header title, and this change makes it win without saying so or testing it.
Please reword the changeset and the description (and the commit message, if it stays) to say that a late aria-label now names the dialog instead of losing to the header title, and add a Dialog.test.tsx case for it that AR4's verification row names. The new AR4 verification row is also missing its Audit section cell (non-blocking).
Claims and files checked
Review mode: same-head; reason: none
- Claims checked
- Changeset: a header that mounts after the dialog opens now names it, and the name goes when it unmounts: verified (the new test fails on
mainand passes here; the Chromium accessibility tree agrees). - Changeset: a dialog's own
aria-labeloraria-labelledbystill wins: false for anaria-labelthat arrives while a header is mounted, whichmainignored and this change honors. - Description, Who and Before: the dialog was unnamed with a late header, and apps repeated the heading in
aria-label: verified againstmain. - Description, After: named by the title while it is mounted, unnamed after it unmounts: verified.
- Description, Unchanged: a caller name always wins, including one that arrives later: verified for
aria-labelledby, false for a latearia-label. - Description, Unchanged: a header present on the first render names the dialog as before: verified.
- The title's callback ref reports mount and unmount, with no new Effect: verified in
DialogHeader.tsx. syncDefaultNamesets ontrue, clears only its own default onfalse, and looks again with no argument: verified inDialog.tsx.- The context type and doc change: verified in
DialogContext.ts. - The record gains AR4 and a verification row: verified; the row has no Audit section cell.
- A
[fix]changeset: present, in the repository's format. - The red-first test fails on
mainand passes here: verified. - The two caller-name tests pass: verified; they also pass on
main. - The Dialog and AlertDialog suites pass (249 tests): verified.
- Strict lint, the core typecheck and the knowledge check are clean: verified.
- The cited records (the WCAG name baseline and the existing default-name intent): verified as intent; AR4 is the first clause that states it.
- Writing rubric results for the record: verified; AR4 is present tense, and the row names test cases, not a pull request.
- No public API change, and the context stays internal: verified (the generated surface comparison shows no rows).
- Public text contains no internal context: verified.
- Overlap with #11204, #11451, #11203 and #11121: verified; each merges with this head with no conflict in this pull request's files.
- Changeset: a header that mounts after the dialog opens now names it, and the name goes when it unmounts: verified (the new test fails on
- Files checked
.changeset/dialog-late-header-name.md: finding (caller-name claim).docs/specs/components/Dialog/Dialog.spec.md: clear; the AR4 row lacks its Audit section cell (non-blocking).packages/core/src/Dialog/Dialog.test.tsx: clear; no case for a latearia-label.packages/core/src/Dialog/Dialog.tsx: clear.packages/core/src/Dialog/DialogContext.ts: clear.packages/core/src/Dialog/DialogHeader.tsx: clear.
…names the dialog The release note says so, and AR4's verification row names the case and its audit section.
|
/approve-spec 2450d9a |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
A DialogHeader that mounts after the dialog opens now names it, and the late aria-label case is described in the release note and covered by a test that fails on main. One non-blocking point:
- The description's Evidence bullet says the Dialog and AlertDialog suites pass with 249 tests; with the new case they run 250.
Claims and files checked
Review mode: same-head; reason: none
- Claims checked
- Changeset: a header that mounts after the dialog opens now names it, and the name goes when it unmounts: verified (the new test fails on
mainand passes here; Chromium's accessibility tree agrees). - Changeset: a dialog's own
aria-labeloraria-labelledbywins: verified (the caller-name tests and the accessibility tree). - Changeset: an
aria-labelthat arrives while the header is mounted now names the dialog instead of losing to the header title: verified (its new test fails onmainand passes here). - Description, Who and Before: a late header left the dialog unnamed, and apps repeated the heading in
aria-label: verified againstmain; the workaround is context. - Description, After: named by the title while it is mounted, unnamed after it unmounts: verified.
- Description, Also changed: a late
aria-labelnow names the dialog, and a test covers it: verified. - Description, Unchanged: a caller
aria-labelledbywins, a late one included; anaria-labelgiven from the start wins; a header on the first render names the dialog as before: verified onmainand here. - The title's callback ref reports mount and unmount, with no new Effect: verified in
DialogHeader.tsx. syncDefaultNamesets ontrue, clears only its own default onfalse, and looks again with no argument: verified inDialog.tsx.- The context type and doc change: verified in
DialogContext.ts. - The record gains AR4 and a verification row: verified, with its audit section.
- A
[fix]changeset: present, in the repository's format. - Red first: the late-header test fails on
mainand passes here: verified. - The caller-name tests pass: verified; they also pass on
main. - The Dialog and AlertDialog suites pass (249 tests): they pass; the count is 250 here.
- Strict lint, the core typecheck and the knowledge check are clean: verified.
- The cited records: the WCAG name baseline and the header record's naming clause are verified; the Dialog record had no naming clause before this change, and AR4 adds it.
- Writing rubric results for the record: verified; AR4 is present tense, and the row names test cases.
- Scope (three Dialog files, one test file, the record and a changeset): verified.
- No public API change, and the context stays internal: verified (the generated surface comparison shows no rows).
- Public text contains no internal context: verified.
- Overlap with #11204, #11451, #11203 and #11121: verified; none changes a line this pull request changes.
- Reported in #11981, and fixes it: verified; both patterns in the issue, content rendered on open and an imperative show, are named at the accessibility tree.
- Owner and land path: process context; the spec approval for this head is recorded and CI has not run.
- Changeset: a header that mounts after the dialog opens now names it, and the name goes when it unmounts: verified (the new test fails on
- Files checked
.changeset/dialog-late-header-name.md: clear.docs/specs/components/Dialog/Dialog.spec.md: clear.packages/core/src/Dialog/Dialog.test.tsx: clear.packages/core/src/Dialog/Dialog.tsx: clear.packages/core/src/Dialog/DialogContext.ts: clear.packages/core/src/Dialog/DialogHeader.tsx: clear.
|
/approve-spec 1124f6b |
There was a problem hiding this comment.
Approved pending CI: CI is still running on this head.
A DialogHeader that mounts after the dialog opens now names it, the name goes when the header unmounts, and an aria-label that arrives while the header is mounted now wins; the tests for both cases fail on main and pass here, and Chromium's accessibility tree shows the same names. One non-blocking point:
- The description's Evidence bullet says the Dialog and AlertDialog suites pass with 249 tests; after the merge of
mainthey run 257.
Claims and files checked
Review mode: same-head; reason: none
- Changed rules since the last review: changed rules (0): none
- Claims checked
- Changeset: a header that mounts after the dialog opens now names it, and the name goes when it unmounts: verified (the new test fails on
mainand passes here; Chromium's accessibility tree agrees). - Changeset: a dialog's own
aria-labeloraria-labelledbywins: verified (the caller-name tests, and the accessibility tree for anaria-labeland for anaria-labelledbyinside the dialog). - Changeset: an
aria-labelthat arrives while the header is mounted now names the dialog instead of losing to the header title: verified (its test fails onmainand passes here). - Description, Who and Before: a late header left the dialog unnamed, and apps repeated the heading in
aria-label: verified againstmain; the workaround is context. - Description, After: named by the title while it is mounted, unnamed after it unmounts: verified.
- Description, Also changed: a late
aria-labelnow names the dialog, and a test covers it: verified. - Description, Unchanged: a caller
aria-labelledbywins, a late one included; anaria-labelgiven from the start wins; a header on the first render names the dialog as before: verified onmainand here. - The title's callback ref reports mount and unmount, with no new Effect: verified in
DialogHeader.tsx. syncDefaultNamesets ontrue, clears only its own default onfalse, and looks again with no argument: verified inDialog.tsx.- The context type and doc change: verified in
DialogContext.ts. - The record gains AR4 and a verification row: verified, with its audit section.
- A
[fix]changeset: present and valid. - Red first: the late-header test fails on
mainand passes here: verified (two cases fail onmain). - The caller-name tests pass: verified; they also pass on
main. - The Dialog and AlertDialog suites pass (249 tests): they pass; the count is 257 here after the merge of
main. - Strict lint, the core typecheck and the knowledge check are clean: verified; CI's lint and typecheck also pass on this head.
- The cited records: the WCAG name baseline and the header record's naming clause are verified; the Dialog record had no naming clause before this change, and AR4 adds it.
- Writing rubric results for the record: verified; AR4 is present tense, and the row names test cases.
- Preflight: build, typecheck, lint, UI tests, knowledge and changeset checks pass, and the only node test failures came from the author's network proxy: consistent with CI on this head (build, typecheck, lint and every node test shard pass; three of four UI test shards had passed and the fourth was running); the author's own run cannot be reproduced here.
- Scope (three Dialog files, one test file, the record and a changeset): verified.
- No public API change, and the context stays internal: verified (the built surface comparison and CI's API report show no rows).
- Public text contains no internal context: verified.
- Overlap with four other pull requests: the two focus fixes have merged into
mainand this head includes them; the two open drafts still merge cleanly with this head. - Reported in the linked issue, which this fixes: verified; the issue is open and both of its reproductions are named here.
- Owner and land path: process context, not a product claim.
- Changeset: a header that mounts after the dialog opens now names it, and the name goes when it unmounts: verified (the new test fails on
- Files checked
.changeset/dialog-late-header-name.md: clear.docs/specs/components/Dialog/Dialog.spec.md: clear (AR4 and its row; the table re-pad changes no other row's text).packages/core/src/Dialog/Dialog.test.tsx: clear.packages/core/src/Dialog/Dialog.tsx: clear.packages/core/src/Dialog/DialogContext.ts: clear.packages/core/src/Dialog/DialogHeader.tsx: clear.
User impact
DialogwhoseDialogHeadermounts after the dialog opens. For example, a form component that renders its own header once the dialog is open.aria-label.aria-labelthat arrives while a DialogHeader is mounted now names the dialog. Before, it lost to the header title. A test covers it.aria-labelledbywins, including one that arrives later, and anaria-labelgiven from the start wins. A header present on the first render names the dialog as before.What changed
DialogHeader.tsx: the title's callback ref reports its mount and unmount through the dialog context (syncDefaultName(true | false)). No new Effect.Dialog.tsx:syncDefaultNametakes an optionalisTitleMounted.truesets the defaultaria-labelledby.falseclears it only when it is still the default, so a caller name that arrived meanwhile stays. With no argument it looks for the title again, as before, for composed headers.DialogContext.ts: the hook's type and doc.component:Dialogrecord: AR4 "Without its ownaria-labeloraria-labelledby, a Dialog is named by its DialogHeader title whenever that title is mounted", plus its verification row.[fix]changeset.Evidence
Dialog.test.tsx"is named by a DialogHeader that mounts after the dialog opens, until it unmounts" fails onmain, which leaves the dialog unnamed, and passes here.tscandcheck:knowledgeare clean.spec:AST-020FR1, and the existing default-name intent incomponent:Dialogandmodule:Dialog/DialogHeader. AR4 states that intent for a header that mounts late.Writing rubric results
Record touched:
component:Dialog(AR4 and its verification row).Preflight
pnpm preflightat 1124f6b (main ee65f4f merged), run on a separate build machine: review:pre, build, typecheck, lint, vitest ui, knowledge and changesets PASS. vitest node failed only.github/scripts/lib/offline-media.test.mjs's two real-browser cases, because that machine reaches the network through a proxy that holds an unreachable host open; re-run without the proxy, the file passes 24/24. No other failure.Scope
Overlap checked: #11204 (draft by nynexman4464: a late-mounting header no longer takes focus from a control inside the dialog; that is focus, this is naming, and both touch
DialogHeader.tsxwithout overlapping lines), and #11451, #11203, #11121 (Dialog.tsx and Dialog.test.tsx; text color, nested initial focus and focus return; no shared lines). Whichever merges second merges main.Reported by @qufeng33 in #11981, which traces the same gap: a
DialogHeaderthat renders after the dialog mounted never callssyncDefaultName, so the dialog stays unnamed.Fixes #11981
Owner: Astryx fix-loop lane 0. Land path: CodeBunny approval of the exact head, Specs stamp, CI, then the merge queue.