Repository navigation
fix(Button): a tooltip that a built-in name already contains is not read again - #11967
Conversation
…ead again Banner's dismiss button and the field clear button pair a short tooltip with a longer name that contains it, so screen readers read the tooltip's word twice. An internal Button context lets those two Core parts leave the tooltip out of the description. The visible tooltips and Button's public equality rule are unchanged; FR12 gains one sentence for Core's behavior. Reported by @duytbp.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec b0a92e0 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Button · Storybook | 69.7 kB (+25 B) · 11.2 kB CSS (0) | 817 (+9) | ✓ · ✓ · ✗ |
| lab/EmojiPicker | 123.5 kB (+87 B) · 751 B CSS (0) | — | — · — · — |
| TimeInput | 184.4 kB (+69 B) · 17.9 kB CSS (0) | — | — · — · — |
84 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/CommentComposer | 190.3 kB (+69 B) · 1.9 kB CSS (0) | — | — · — · — |
| NumberInput | 108.7 kB (+59 B) · 13.1 kB CSS (0) | — | — · — · — |
| PowerSearch | 323.9 kB (+58 B) · 27.5 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 313.4 kB (+58 B) · 2.7 kB CSS (0) | — | — · — · — |
| Selector | 124.7 kB (+56 B) · 19.9 kB CSS (0) | — | — · — · — |
| FileInput | 79.9 kB (+54 B) · 12.9 kB CSS (0) | — | — · — · — |
| Markdown | 214.1 kB (+52 B) · 23.6 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 319.9 kB (+51 B) · 454 B CSS (0) | — | — · — · — |
| ChatComposer | 93.6 kB (+50 B) · 13.6 kB CSS (0) | — | — · — · — |
| Calendar | 81.0 kB (+49 B) · 11.8 kB CSS (0) | — | — · — · — |
| DateTimeInput | 236.4 kB (+48 B) · 20.7 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 290.0 kB (+48 B) · 2.4 kB CSS (0) | — | — · — · — |
| DialogHeader | 73.0 kB (+47 B) · 12.9 kB CSS (0) | — | — · — · — |
| Typeahead | 98.3 kB (+46 B) · 14.5 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 90.7 kB (+44 B) · 12.6 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 90.7 kB (+44 B) · 12.6 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 98.9 kB (+43 B) · 2.3 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 155.3 kB (+43 B) · 1.6 kB CSS (0) | — | — · — · — |
| ContextMenu | 109.9 kB (+42 B) · 19.8 kB CSS (0) | — | — · — · — |
| lab/MediaCaptionsButton | 232.6 kB (+41 B) · 1.5 kB CSS (0) | — | — · — · — |
| MobileNav | 82.2 kB (+40 B) · 11.8 kB CSS (0) | — | — · — · — |
| lab/MediaFullscreenButton | 232.6 kB (+40 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaPlayButton | 232.6 kB (+40 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaSeekButton | 232.6 kB (+40 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaTime | 232.6 kB (+40 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaTimeSlider | 232.6 kB (+40 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaVolume | 232.6 kB (+40 B) · 1.5 kB CSS (0) | — | — · — · — |
| Lightbox | 153.7 kB (+39 B) · 12.4 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 71.6 kB (+39 B) · 11.8 kB CSS (0) | — | — · — · — |
| Pagination | 157.5 kB (+39 B) · 20.2 kB CSS (0) | — | — · — · — |
| Table | 129.3 kB (+39 B) · 21.4 kB CSS (0) | — | — · — · — |
| lab/ListInput | 100.3 kB (+39 B) · 1.3 kB CSS (0) | — | — · — · — |
| lab/MediaPlaybackRate | 232.6 kB (+39 B) · 1.5 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 70.6 kB (+38 B) · 11.3 kB CSS (0) | — | — · — · — |
| TableCell | 111.0 kB (+38 B) · 20.4 kB CSS (0) | — | — · — · — |
| Toast | 109.8 kB (+38 B) · 11.5 kB CSS (0) | — | — · — · — |
| TextInput | 103.7 kB (+37 B) · 12.9 kB CSS (0) | — | — · — · — |
| lab/AudioPlayer | 242.5 kB (+37 B) · 1.8 kB CSS (0) | — | — · — · — |
| Banner · Storybook | 71.8 kB (+36 B) · 11.7 kB CSS (0) | 526 (+3) | ✓ · ✓ · — |
| Carousel | 80.3 kB (+36 B) · 12.2 kB CSS (0) | — | — · — · — |
| MultiSelector | 112.3 kB (+36 B) · 19.0 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 110.9 kB (+36 B) · 20.2 kB CSS (0) | — | — · — · — |
| lab/DialogHeroHeader | 94.4 kB (+36 B) · 372 B CSS (0) | — | — · — · — |
| DateInput | 212.2 kB (+35 B) · 19.0 kB CSS (0) | — | — · — · — |
| lab/TransferList | 143.3 kB (+35 B) · 1.4 kB CSS (0) | — | — · — · — |
| AlertDialog | 136.6 kB (+34 B) · 16.3 kB CSS (0) | — | — · — · — |
| ChatSendButton | 70.2 kB (+34 B) · 11.2 kB CSS (0) | — | — · — · — |
| lab/VideoPlayer | 240.0 kB (+34 B) · 2.1 kB CSS (0) | — | — · — · — |
| CodeBlock | 85.9 kB (+33 B) · 12.9 kB CSS (0) | — | — · — · — |
| TopNav | 73.4 kB (+33 B) · 12.1 kB CSS (0) | — | — · — · — |
| AppShell | 94.0 kB (+32 B) · 15.0 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 86.7 kB (+32 B) · 12.2 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 106.1 kB (+32 B) · 14.2 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 84.5 kB (+32 B) · 13.2 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 70.3 kB (+31 B) · 11.3 kB CSS (0) | — | — · — · — |
| DateRangeInput | 109.3 kB (+31 B) · 14.3 kB CSS (0) | — | — · — · — |
| TopNavHeading | 90.9 kB (+31 B) · 12.6 kB CSS (0) | — | — · — · — |
| ChatLayout | 93.6 kB (+30 B) · 11.7 kB CSS (0) | — | — · — · — |
| DrawerHeader | 73.2 kB (+30 B) · 14.3 kB CSS (0) | — | — · — · — |
| Tokenizer | 116.5 kB (+30 B) · 22.0 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 70.3 kB (+29 B) · 11.4 kB CSS (0) | — | — · — · — |
| Stepper | 71.5 kB (+29 B) · 11.3 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 387.4 kB (+29 B) · 2.4 kB CSS (0) | — | — · — · — |
| SideNavHeading | 91.2 kB (+28 B) · 12.6 kB CSS (0) | — | — · — · — |
| SideNavItem | 85.3 kB (+28 B) · 12.5 kB CSS (0) | — | — · — · — |
| lab/Schedule | 121.5 kB (+28 B) · 3.9 kB CSS (0) | — | — · — · — |
| TabMenu | 87.4 kB (+27 B) · 12.5 kB CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 132.9 kB (+27 B) · 1.1 kB CSS (0) | — | — · — · — |
| TopNavMenu | 90.3 kB (+25 B) · 12.6 kB CSS (0) | — | — · — · — |
| Thumbnail | 74.3 kB (+24 B) · 12.8 kB CSS (0) | — | — · — · — |
| ToggleButton | 97.3 kB (+24 B) · 11.3 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 131.7 kB (+22 B) · 773 B CSS (0) | — | — · — · — |
| lab/TourStep | 99.3 kB (+22 B) · 691 B CSS (0) | — | — · — · — |
| Popover | 108.2 kB (+20 B) · 15.7 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 80.3 kB (+20 B) · 14.6 kB CSS (0) | — | — · — · — |
| SideNav | 118.1 kB (+18 B) · 12.6 kB CSS (0) | — | — · — · — |
| IconButton | 69.8 kB (+17 B) · 11.2 kB CSS (0) | — | — · — · — |
| ComplexSelector | 86.6 kB (+14 B) · 13.4 kB CSS (0) | — | — · — · — |
| DropdownMenu | 136.5 kB (+14 B) · 20.0 kB CSS (0) | — | — · — · — |
| lab/Comments | 394.3 kB (+12 B) · 2.5 kB CSS (0) | — | — · — · — |
| MoreMenu | 136.7 kB (+10 B) · 20.0 kB CSS (0) | — | — · — · — |
| Field | 63.4 kB (0) · 8.0 kB CSS (0) | — | ✓ · ✓ · — |
| FieldLabel | 58.8 kB (0) · 6.5 kB CSS (0) | — | ✓ · ✓ · — |
| Timestamp · Storybook | 28.4 kB (−4 B) · 11.5 kB CSS (0) | 992 (+3) | ✓ · ✓ · — |
Package size: @astryxdesign/core 8.04 MB packed (+945 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Accessibility: 1 violation(s)
Accessibility Audit
Status: 1 accessibility violation(s) found — 1 serious.
Timestamp - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 1/21 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested. Banner's dismiss button and the field clear button now leave their short tooltip out of the description, and the new FR12 sentence is approved for this head; these points need fixing before approval:
- Timestamp's hover-card copy button is named "Copy {value}" with a "Copy" tooltip and still exposes "Copy" as its description, which the new FR12 sentence ("Core components whose name contains the tooltip text omit it from the description") rules out, so wrap it in
ButtonTooltipInNameContextwith a test, or narrow the sentence and approve it again. - The new
ButtonTooltipInNameContextblock inButton.tsxsits betweenButtonVariant's JSDoc and its declaration, so the publishedButtonVarianttype loses its doc comment; move the block above that comment or below the type. - The changeset says a field's clear button no longer has its tooltip read as a description, but in the other shipped locales the localized name does not contain the untranslated "Clear" tooltip and the description stays, so qualify it with "when its name already contains the tooltip, as in English".
- The description's overlap note is wrong (#11205 does not touch
Banner.tsx, and its head conflicts with this one inButton.tsxandInputClearButton.tsx), and the stacked-banner test does not assert the visible tooltip as the description says it does. - The changed descriptions are shown only by jsdom tests, while
spec:AST-009FR3 asks for accessibility-tree proof of a computed description, so add a Chromium case through the repository's a11y harness for both buttons.
The inline comments mark the exact lines.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: fixes the reported issue that names both buttons. Verified:
Banner.test.tsx:232,InputClearButton.test.tsx:67. - Claim: before the change both buttons read the tooltip word twice. Verified: the four new or updated cases fail on main.
- Claim: after the change each button is read once and its tooltip still shows. Verified in English:
Banner.test.tsx:232-245,:940-959,InputClearButton.test.tsx:83-86. - Claim: Button's public equality rule is unchanged and a new test pins it. Verified:
Button.test.tsx:566-579passes on main and here. - Claim: the context is internal and the package does not export it. Verified:
Button/index.ts:32-33re-exports by name; the built API surface is unchanged. - Claim: only Banner's dismiss button and the clear button set it. Verified:
Banner.tsx:796,InputClearButton.tsx:129. - Claim: the FR12 sentence is the specification owner's chosen shape. Verified: an engineering owner approved this head.
- Claim: no public API, prop, export or visual change. Verified: no API surface rows; focused screenshots are identical.
- Claim: red first, the new and updated cases fail before and pass after. Verified: four cases.
- Claim: the two updated Banner tests assert no description and the visible tooltip. False:
Banner.test.tsx:887-904asserts only the description. - Claim: the Button, Banner, Field, TextInput, NumberInput and Selector suites pass. Verified: 1,433 tests in 48 files pass here.
- Claim: typecheck, lint, knowledge, changeset and shared-identity checks pass. Verified.
- Claim: the overlap with #11205 is on different lines of those files. False: #11205 does not change
Banner.tsx, and the two heads conflict inButton.tsxandInputClearButton.tsx. - Changeset: a patch fix for core. Verified.
- Changeset: the dismiss and clear buttons no longer have their tooltip read as a description. Partly false: true in English; the clear button keeps "Clear" as its description in the other locales.
- Changeset: the visible tooltips are unchanged. Verified.
- File
.changeset/tooltip-in-name-no-description.md: finding (wording outside English). - File
docs/specs/components/Button/Button.spec.md: finding (Timestamp's copy button does not meet the new sentence; its verification row is not extended). - File
packages/core/src/Banner/Banner.test.tsx: finding (stacked-banner test, description claim). - File
packages/core/src/Banner/Banner.tsx: clear. - File
packages/core/src/Button/Button.test.tsx: clear. - File
packages/core/src/Button/Button.tsx: finding (ButtonVariantdoc comment). - File
packages/core/src/Field/InputClearButton.test.tsx: clear. - File
packages/core/src/Field/InputClearButton.tsx: clear.
…wser proof
Timestamp's hover-card copy button is named "Copy {value}" with a "Copy" tooltip, so it now also sets ButtonTooltipInNameContext, as FR12's Core sentence says. A Chromium accessibility-tree case proves the empty description for Banner's dismiss and the field clear button, with the tooltip still shown on hover. ButtonVariant keeps its doc comment, the changeset names the English-name condition, and the stacked-banner test asserts the visible tooltip.
|
/approve-spec e46e325 |
There was a problem hiding this comment.
Changes requested: one evidence gap remains. Banner's dismiss button, the field clear button and Timestamp's hover-card copy button no longer repeat their short tooltip as a description, and the new FR12 sentence is approved for this head.
- Timestamp's copy button now drops "Copy" from its accessible description, but
ButtonTooltipInName.a11y.chromium.spec.tsreads the accessibility tree only for Banner and the TextInput clear button, so add a Timestamp case (open the hover card, then check the copy button's name, empty description and visible "Copy" tooltip) and addTimestampto its@pr-a11y scopeline, as AST-009 FR3 requires for a changed description.
Optional: list the new browser spec in Button.spec.md's verified_by and its FR12 verification row, and note that CodeBlock's after-copy tooltip in the description's audit is "Copy code".
Claims and files checked
Review mode: same-head; reason: none
- Changed rules (0): none
- Claims
- Changeset: the three buttons stop reading their short tooltip as a description when the name contains it (as in English), and the visible tooltips are unchanged: verified (red-first unit cases; Chromium accessibility tree; identical focused frames).
- Title: a tooltip that a built-in name already contains is not read again: verified.
- Before the change each of the three buttons repeats its word: verified (Chromium on the base reads the descriptions "Dismiss", "Clear" and "Copy").
- After the change each is read once and the tooltip still shows: verified (no description on the head; the browser spec's hover check).
- Where a locale's name does not contain the tooltip text, the tooltip still describes the button: verified (
Button.tsx:1118, a case-sensitive match). - The cause is Button's equality check: verified (the base compares the whole trimmed name).
- The fix is an unexported Core context that only the three parts set: verified (three providers;
Button/index.ts:32-33re-exports by name). - Caller Buttons keep the equality rule, pinned by a new test: verified (
Button.test.tsx:566-579passes before and after). - The record gains one present-tense sentence, chosen and approved by an engineering owner for this head: verified (
Button.spec.md:138; the approval comment for this head). - No public API, prop, export or visual change: verified (built API surfaces differ by zero rows; frames pixel-identical).
- The new and updated unit cases fail before and pass after: verified (five cases fail on the base).
- The browser spec checks name, empty description and hover tooltip for Banner and TextInput: verified (fails on the base, passes on the head).
- Two existing Banner tests now assert no description and the visible tooltip: verified (
Banner.test.tsx:887,:945). - No other Core Button's name contains a shorter tooltip: verified; the CodeBlock example's after-copy tooltip is "Copy code", not "Copy", which leaves the conclusion unchanged.
- 1,358 tests in 36 files pass; typecheck, strict lint, knowledge and changeset checks pass: verified at this head.
- The overlap with #11205 is limited to
Button.tsxandInputClearButton.tsx: verified (its file list).
- Files
.changeset/tooltip-in-name-no-description.md: cleardocs/specs/components/Button/Button.spec.md: clear (optional: list the new browser spec inverified_byand the FR12 verification row)packages/core/src/Banner/Banner.test.tsx: clearpackages/core/src/Banner/Banner.tsx: clearpackages/core/src/Button/Button.test.tsx: clearpackages/core/src/Button/Button.tsx: clearpackages/core/src/Button/__tests__/ButtonTooltipInName.a11y.chromium.spec.ts: finding: no Timestamp casepackages/core/src/Field/InputClearButton.test.tsx: clearpackages/core/src/Field/InputClearButton.tsx: clearpackages/core/src/Timestamp/Timestamp.test.tsx: clear (jsdom only)packages/core/src/Timestamp/TimestampHoverCard.tsx: finding: its description change has no accessibility-tree proof
… not read again Adds a Timestamp case to the Chromium accessibility-tree spec (open the hover card by focus, then check the copy button's name, empty description and visible Copy tooltip), adds Timestamp to its pr-a11y scope, and lists the spec in Button's verified_by and FR12 verification row.
|
/approve-spec 953abf6 |
There was a problem hiding this comment.
Changes requested: one blocking test fix. The button changes themselves are right: Banner's dismiss button, the field clear button and Timestamp's hover-card copy button no longer repeat their short tooltip as a description, their tooltips still show, and the new FR12 sentence is approved for this head.
- The new Timestamp case in
ButtonTooltipInName.a11y.chromium.spec.ts(lines 89-94) presses Tab twice before the story has rendered, so focus stays on the page body andtoBeFocused()fails on every run; wait for#storybook-root timebefore the first Tab and for the Copy button before the second (with those waits the case passes on this head and fails on the base, as intended).
Optional: add TextInput and the three stories the spec loads (^apps/storybook/stories/(Banner|TextInput|Timestamp)) to its @pr-a11y scope line, as sibling specs do. CI has not run on this head yet because the pull request is a draft.
Claims and files checked
Review mode: same-head; reason: none
- Claims
- Changeset: the three buttons no longer have their short tooltip read as a description when the name contains it, as in English, and the visible tooltips are unchanged: verified (accessibility-tree probe on base and head; pixel-identical hovered and focused frames).
- Title: a tooltip that a built-in name already contains is not read again: verified.
- Before the change each of the three buttons repeats its word: verified (the base tree reads the descriptions "Dismiss", "Clear" and "Copy").
- After the change each is read once and its tooltip still shows: verified (no description on the head; tooltips visible).
- Where a locale's name does not contain the tooltip text, the tooltip still describes the button: verified (case-sensitive containment,
Button.tsx:1117-1119). - The cause is Button's equality check: verified (the base compares the whole trimmed name).
- The fix is an unexported Core context that only the three parts set: verified (three providers;
Button/index.ts:32-33re-exports by name). - Caller Buttons keep the equality rule, pinned by a new test: verified (
Button.test.tsx:566-579passes before and after). - The record gains one present-tense sentence, chosen and approved by an engineering owner: verified (
Button.spec.md:139; the approval comment for this head). - No public API, prop, export or visual change: verified (built surfaces of build, core and the seven themes differ by zero rows; frames pixel-identical).
- The new and updated unit cases fail before and pass after: verified (five cases fail on the base and pass on the head).
- The browser spec reads the accessibility tree for the Banner, TextInput and Timestamp stories: false for Timestamp (the case fails on this head before it reads the tree); verified for Banner and TextInput (fail on the base, pass on the head).
- The spec is listed in the record's verified-by list and FR12 verification row: verified (
Button.spec.md:21,:286). - The spec runs in CI's accessibility leg: verified (its scope pattern matches the changed component folders).
- Two existing Banner tests now assert no description and the visible tooltip: verified (
Banner.test.tsx:902-908,:958-963). - No other Core Button's name contains a shorter tooltip: verified (every other Core tooltip equals its name, adds words, or is the caller's own).
- 1,358 tests in 36 files pass, and typecheck, strict lint, knowledge and changeset checks pass: verified at this head.
- The overlap with #11205 is limited to
Button.tsxandInputClearButton.tsx: verified (its file list). - The linked issue names both the dismiss and the clear button: verified.
- Files
.changeset/tooltip-in-name-no-description.md: cleardocs/specs/components/Button/Button.spec.md: clearpackages/core/src/Banner/Banner.test.tsx: clearpackages/core/src/Banner/Banner.tsx: clearpackages/core/src/Button/Button.test.tsx: clearpackages/core/src/Button/Button.tsx: clearpackages/core/src/Button/__tests__/ButtonTooltipInName.a11y.chromium.spec.ts: finding: the Timestamp case fails (blocking); the scope line misses TextInput and the stories (optional)packages/core/src/Field/InputClearButton.test.tsx: clearpackages/core/src/Field/InputClearButton.tsx: clearpackages/core/src/Timestamp/Timestamp.test.tsx: clearpackages/core/src/Timestamp/TimestampHoverCard.tsx: clear (its browser proof waits on the spec fix)
The Timestamp case pressed Tab before the static Storybook had rendered the story, so focus stayed on the page body. It now waits for the story's time element before the first Tab and for the copy button before the second. The pr-a11y scope adds TextInput and the three stories the spec loads.
|
/approve-spec 6d1143e |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review.
The earlier blocking item is fixed: the Timestamp case in ButtonTooltipInName.a11y.chromium.spec.ts now waits for the story and the hover card, and all three browser cases pass on this head and fail on the base, as intended. Banner's dismiss button, the field clear button and Timestamp's hover-card copy button no longer repeat their short tooltip as a description, their tooltips still show, and the new FR12 sentence is approved for this head.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claims
- Changeset: the dismiss, clear and copy buttons no longer have their short tooltip read as a description when their name already contains it, as in English, and the visible tooltips are unchanged: verified (browser spec on this head and the base; pixel-identical hovered and focused frames).
- Title: a tooltip that a built-in name already contains is not read again: verified.
- Before the change each of the three buttons repeats its word: verified (the base reads the descriptions "Dismiss", "Clear" and "Copy").
- After the change each is read once and its tooltip still shows: verified (no description on this head; tooltips visible).
- Where a locale's name does not contain the tooltip text, the tooltip still describes the button: verified (case-sensitive containment,
Button.tsx:1117-1119; for example Timestamp in German). - The cause is Button's equality check: verified (the base compares the whole trimmed name).
- The fix is an unexported Core context that only the three parts set: verified (three providers;
Button/index.ts:32-33re-exports by name). - Caller Buttons keep the equality rule, pinned by a new test that passes before and after: verified (
Button.test.tsx:566-579passes on the base and this head). - The record gains one present-tense sentence chosen and approved by the specification owner: verified (
Button.spec.md:139; the approval comment for this head). - No public API, prop, export or visual change, released as a Core patch fix: verified.
- The new and updated unit cases for Banner, the clear button and Timestamp fail before and pass after: verified (five cases fail on the base and pass on this head).
- The browser spec reads the accessibility tree for the Banner, TextInput and Timestamp stories, checking the name, an empty description and the visible tooltip: verified (all three pass on this head in 3 of 3 runs and fail on the base in 3 of 3).
- The spec is listed in the record's verified-by list and FR12 verification row: verified (
Button.spec.md:21,:286). - The spec runs in CI's accessibility leg: verified (its routing line matches the changed component folders and stories).
- Two existing Banner tests now assert no description and the visible tooltip: verified (
Banner.test.tsx:899-908,:958-963). - No other Core Button's name contains a shorter tooltip: verified (every other Core tooltip equals its name, adds words, or is the caller's own).
- 1,358 tests in 36 files pass, with the shared-identity check: verified (35 component test files with 1,351 tests, plus the 7 shared-identity tests).
- Typecheck, strict lint, knowledge and changeset checks pass: verified.
- The overlap with #11205 is in
Button.tsxandInputClearButton.tsx, notBanner.tsxorTimestampHoverCard.tsx: verified (its file list; it also editsButton.spec.mdandInputClearButton.test.tsx). - The linked issue's report names both the dismiss and the clear button: verified.
- Files
.changeset/tooltip-in-name-no-description.md: cleardocs/specs/components/Button/Button.spec.md: clearpackages/core/src/Banner/Banner.test.tsx: clearpackages/core/src/Banner/Banner.tsx: clearpackages/core/src/Button/Button.test.tsx: clearpackages/core/src/Button/Button.tsx: clearpackages/core/src/Button/__tests__/ButtonTooltipInName.a11y.chromium.spec.ts: clear (the Timestamp case now waits and passes)packages/core/src/Field/InputClearButton.test.tsx: clearpackages/core/src/Field/InputClearButton.tsx: clearpackages/core/src/Timestamp/Timestamp.test.tsx: clearpackages/core/src/Timestamp/TimestampHoverCard.tsx: clear
# Conflicts: # docs/specs/components/Button/Button.spec.md # packages/core/src/Banner/Banner.test.tsx # packages/core/src/Banner/Banner.tsx
After the tooltip layer mounts at its first show, these tests rest the pointer on the button to read the tooltip's text, and check that no hidden description stands in for it.
|
/approve-spec 58416f3 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft; it runs once the pull request is marked ready, and the merge waits for the required checks.
Banner's dismiss button, the field clear button and Timestamp's copy button now leave a tooltip their name already contains out of the accessible description, under the component:Button FR12 sentence an engineering owner approved for this revision. There are no blocking findings.
- Miss: (non-blocking) FR12's verification row in
Button.spec.mdlistsButtonTooltipInName.a11y.chromium.spec.tsbut still names only the "Disabled with tooltip" state and the old failure signal; adding the three Core states and a signal such as "a Core button described by a tooltip its name contains fails" would make the record match its evidence. - The match is case-sensitive, so Timestamp's copy button still repeats its verb in German, Hungarian, Dutch and Turkish, and the clear button keeps the English "Clear" description in other locales until its tooltip key is translated; the description already states this limit.
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- Three built-in buttons read one word twice on the base (Banner dismiss, field clear, Timestamp copy): verified, the base Button compares the tooltip with the name for equality only (
Button.tsxFR12 check). - After the change each is read once with its full name and the tooltip still shows: verified,
Button.tsx:1075-1080;Banner.test.tsx:245-255,InputClearButton.test.tsx:72-95,Timestamp.test.tsx:1384-1390. - Where the name does not contain the tooltip text, the tooltip still describes the button: verified, case-sensitive
includesatButton.tsx:1080;InputClearButton.test.tsx:98-107. - The cause is FR12's equality rule: verified,
Button.spec.mdFR12 on the base. - The fix is an internal, unexported Button context: verified,
Button.tsx:366-376;Button/index.ts:32-33re-exports onlyButtonand its types. - Only Banner, the clear button and Timestamp's copy button set it: verified, they are its only importers.
- The public equality rule stays, pinned by a new test: verified,
Button.test.tsx:655-668. - The visible tooltips do not change: verified, no tooltip prop changes in the diff.
- FR12 gains one sentence, and the record owner chose this shape: verified,
Button.spec.md:147, with an engineering owner's approval for this revision. - No public API, prop, export or visual change: verified from source (exports map,
Button/index.ts, no style change). - The changeset is a Core patch marked as a fix: verified,
.changeset/tooltip-in-name-no-description.md:2,:5. - Red-first cases fail before the change: verified by reading (the base renders each description the tests assert absent); not run at this revision.
- The browser spec reads the name, an empty description and the visible tooltip for the three stories, and the record lists it: verified,
ButtonTooltipInName.a11y.chromium.spec.ts:47-110,Button.spec.md:22,:295; not run at this revision (CI skipped on the draft). - The two older Banner assertions now expect no description and a visible tooltip: verified,
Banner.test.tsx:975-995,:1027-1041. - No other Core Button's name contains a shorter tooltip: verified, CodeBlock, Tokenizer, Dialog, Drawer, Pagination, Stepper and PowerSearch pairs read.
- The suites, typecheck, lint and knowledge checks pass (a stated test count): not verifiable here, since nothing could be installed; the count predates the merge of main, and CI reruns them.
- The overlapping draft #11205 does not touch Banner or Timestamp: verified, neither file is among its 118.
- The change fixes #11949, reported by @duytbp: verified, the issue names the Banner and clear-button repeats.
- Changeset: the three buttons stop reading the tooltip as a description when the name contains it, as in English, a screen reader read the word twice, and the tooltips are unchanged: verified, as above.
Files:
.changeset/tooltip-in-name-no-description.md: clear.docs/specs/components/Button/Button.spec.md: non-blocking, the FR12 verification row lacks the new states and failure signal.packages/core/src/Banner/Banner.tsx: clear; the merge kept thebanner-closeclass inside the provider.packages/core/src/Banner/Banner.test.tsx: clear.packages/core/src/Button/Button.tsx: clear.packages/core/src/Button/Button.test.tsx: clear.packages/core/src/Button/__tests__/ButtonTooltipInName.a11y.chromium.spec.ts: clear; stories and names match the head.packages/core/src/Field/InputClearButton.tsx: clear.packages/core/src/Field/InputClearButton.test.tsx: clear.packages/core/src/Timestamp/TimestampHoverCard.tsx: clear.packages/core/src/Timestamp/Timestamp.test.tsx: clear.
# Conflicts: # docs/specs/components/Button/Button.spec.md
|
/approve-spec 3084bf3 |
There was a problem hiding this comment.
Changes requested: one record fix. An engineering owner approved the new component:Button FR12 sentence for this head, and the three buttons' code and tests match it.
- Miss:
component:IconButtonAR2 still says a caller's tooltip "also describes the button unless it repeats thelabel", which Timestamp's copy button no longer does, so amend AR2 in this pull request to defer to FR12 (for example "unlesscomponent:ButtonFR12 leaves it out: it repeats thelabel, or a Core part's name contains it").
The amended head then needs an engineering owner's /approve-spec again, and CI runs once the pull request leaves draft. Non-blocking: FR12's verification row in Button.spec.md still names only the "Disabled with tooltip" state and the old failure signal (see the inline note).
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Three built-in buttons read one word twice before this change (Banner dismiss, field clear, Timestamp copy): verified, the base compares the tooltip with the name for equality only.
- Each is now read once with its full name, and its tooltip still shows: verified by reading
Button.tsx:1075-1081and the tests atBanner.test.tsx:245,InputClearButton.test.tsx:84-95andTimestamp.test.tsx:1384; not run at this revision. - Where the name does not contain the tooltip text, the tooltip still describes the button: verified; the clear button in the non-English catalogs and Timestamp in German, Hungarian, Dutch and Turkish stay described.
- The fix is an internal, unexported Button context that only the three parts set: verified,
Button.tsx:366-376;Button/index.tsre-exports onlyButtonand its types. - The public equality rule stays, pinned by a new test: verified,
Button.test.tsx:655. - The visible tooltips do not change, and there is no public API, prop, export or visual change: verified from source.
- FR12 gains one sentence, with an engineering owner's approval for this revision: verified,
Button.spec.md:147. - The changeset is a Core patch marked as a fix and limits the fix to names that contain the tooltip, as in English: verified.
- The browser spec reads the name, an empty description and the visible tooltip for the Banner, TextInput and Timestamp stories, and the record lists it: verified,
Button.spec.md:22,:295; not run at this revision. - Two older Banner assertions now expect no description and a visible tooltip: verified,
Banner.test.tsx:975,:1026. - No other Core Button's name contains a shorter tooltip: verified.
- The suites, typecheck, lint and knowledge checks pass: not verified here; CI runs them.
Files:
.changeset/tooltip-in-name-no-description.md: clear.docs/specs/components/Button/Button.spec.md: blocking,component:IconButtonAR2 must follow the new FR12 sentence; non-blocking, the FR12 verification row lacks the new states and failure signal.packages/core/src/Banner/Banner.tsx: clear.packages/core/src/Banner/Banner.test.tsx: clear.packages/core/src/Button/Button.tsx: clear.packages/core/src/Button/Button.test.tsx: clear.packages/core/src/Button/__tests__/ButtonTooltipInName.a11y.chromium.spec.ts: clear.packages/core/src/Field/InputClearButton.tsx: clear.packages/core/src/Field/InputClearButton.test.tsx: clear.packages/core/src/Timestamp/TimestampHoverCard.tsx: clear in code; its change is what IconButton AR2 now misstates.packages/core/src/Timestamp/Timestamp.test.tsx: clear.
Timestamp's copy button is an IconButton whose name contains its tooltip, so its tooltip no longer describes it. AR2 now names both of FR12's cases. FR12's verification row lists the three Core buttons and the failure the browser spec checks.
|
/approve-spec ecef7f7 |
1 similar comment
|
/approve-spec ecef7f7 |
There was a problem hiding this comment.
Approved pending CI: CI is running on this head and must pass before merge; its accessibility browser specs, the new one included, already pass.
The new component:Button FR12 sentence and the component:IconButton AR2 amendment are approved by an engineering owner for this head, and no blocking findings remain. A possible follow-up: outside English the clear button's tooltip key is untranslated, so a localized name such as "Effacer Recherche" is still described by "Clear".
Claims and files checked
Review mode: same-head; reason: none
- Claim: Changeset: Banner's dismiss button, a field's clear button and Timestamp's copy button no longer read a short tooltip their name contains as a description, as in English — verified (Button.tsx:1075-1081, the three context providers, and the unit tests)
- Claim: Changeset: a screen reader read that word twice — verified (the base compares tooltip and name for equality only)
- Claim: Changeset: the visible Dismiss, Clear and Copy tooltips are unchanged — verified (tooltip props unchanged; hover assertions in the Banner and clear-button tests)
- Claim: Changeset: a core patch fix, reported by the issue's author — verified (only core source changes; #11949)
- Claim: Description: fixes #11949, and the report named both the dismiss and the clear button — verified
- Claim: Description: today a screen reader hears the word twice on these three buttons, and after the change each is read once while sighted users keep the short tooltips — verified
- Claim: Description: where a locale's name does not contain the tooltip, the tooltip still describes the button — verified (the containment test fails there, for example the untranslated clear tooltip)
- Claim: Description: Button drops a tooltip from the description only when it equals the name — verified (FR12 and the base Button.tsx)
- Claim: Description: the context is internal and unexported, and only Banner, the clear button and Timestamp set it — verified (Button/index.ts:32-33; three providers in the tree)
- Claim: Description: the public equality rule stays, and a new Button test pins it — verified (Button.test.tsx:655-668)
- Claim: Description: FR12 gains one sentence, its verification row and verified_by list the browser spec, and IconButton AR2 defers to FR12 — verified (Button.spec.md:22, :147, :295; IconButton.spec.md:126-129)
- Claim: Description: the owner chose this record shape — consistent with the engineering-owner approval of these records for this head
- Claim: Description: no public API, prop, export or visual change — verified
- Claim: Description: three new or updated cases fail before the change and pass after — verified by reading the base, where the equality check describes each name; not run here
- Claim: Description: the browser spec checks the name, an empty description and the visible tooltip on the Banner, TextInput and Timestamp stories, and runs in CI's accessibility leg — verified (its three cases passed in CI's accessibility browser leg at this head)
- Claim: Description: two existing Banner tests asserted the old description and now assert none plus the visible tooltip — verified (Banner.test.tsx:975-995, :1026-1041)
- Claim: Description: no other Core button's name contains a shorter tooltip — verified (every Core-supplied tooltip call site)
- Claim: Description: the scope checklist (one defect, no tagalong, no hidden API, no internal context) — verified
- Claim: Description: the added record text is in the present tense — verified
- Claim: Description: the author's local test, typecheck, lint, knowledge and changeset runs pass — typecheck and lint pass in CI at this head; CI's unit-test legs were still running
- Claim: Description: #11205 also edits Button.tsx and InputClearButton.tsx but not Banner.tsx or TimestampHoverCard.tsx — verified (it also edits Button.spec.md and InputClearButton.test.tsx)
- File: .changeset/tooltip-in-name-no-description.md — clear
- File: docs/specs/components/Button/Button.spec.md — clear (owner-approved at this head)
- File: docs/specs/components/IconButton/IconButton.spec.md — clear (owner-approved at this head)
- File: packages/core/src/Banner/Banner.tsx — clear
- File: packages/core/src/Banner/Banner.test.tsx — clear
- File: packages/core/src/Button/Button.tsx — clear
- File: packages/core/src/Button/Button.test.tsx — clear
- File: packages/core/src/Button/tests/ButtonTooltipInName.a11y.chromium.spec.ts — clear
- File: packages/core/src/Field/InputClearButton.tsx — clear
- File: packages/core/src/Field/InputClearButton.test.tsx — clear
- File: packages/core/src/Timestamp/TimestampHoverCard.tsx — clear
- File: packages/core/src/Timestamp/Timestamp.test.tsx — clear
Fixes #11949
User impact
A screen-reader user hears one word twice on three built-in buttons: Banner's dismiss button ("Dismiss Project A was archived, button, Dismiss"), a field's clear button ("Clear Assignee, button, Clear") and Timestamp's hover-card copy button ("Copy 3:42 PM, button, Copy"). Each name already contains its short tooltip's word, and the tooltip was also read as the button's description. After this change each button is read once with its full name. Sighted users still see the short "Dismiss", "Clear" and "Copy" tooltips. In a locale whose name does not contain the tooltip's text, the tooltip still describes the button, as before.
Problem and solution fit
component:ButtonFR12). These three callers deliberately pair a short tooltip with a longer name: the code keeps the tooltip concise, and the name carries the banner's title or the field's label (WCAG 2.5.3, label in name).ButtonTooltipInNameContext. A Core part sets it when its name contains the tooltip's text, and Button then leaves that tooltip out of the description. Only Banner's dismiss button,InputClearButtonand Timestamp's copy button set it.Expected behavior and authority
component:ButtonFR12 keeps its public equality rule and gains one sentence describing Core's own behavior: "Core components whose name contains the tooltip text omit it from the description." The specification owner chose this shape over changing the tooltips: a tooltip equal to the name would show long copy, and no tooltip would lose the visible label.Smallest restoration
Button.tsx: the context, plus the containment check when it is set.Banner.tsx,InputClearButton.tsxandTimestampHoverCard.tsx: each wraps its one Button in the context.Button.spec.md: the one FR12 sentence, and FR12's verification row (the three Core buttons and the failure the browser spec checks).IconButton.spec.md: AR2 defers to FR12 for when a tooltip describes the button (Timestamp's copy button is an IconButton).@astryxdesign/corepatch,[fix].Evidence
InputClearButton: no description, with the "Clear" tooltip still showing;spec:AST-009FR3):ButtonTooltipInName.a11y.chromium.spec.tsreads the accessibility tree for the BannerDismissable, TextInputClearableand TimestampPer-entry copyablestories. It checks the name, an empty description, and the visible tooltip. Button'sverified_byand FR12 verification row list it. It runs in CI's a11y contract leg; this machine's sandbox cannot launch Chromium.Scope
Components: Button, Banner, InputClearButton, Timestamp
Writing rubric results
Testing
vitest run packages/core/src/{Button,Banner,Field,TextInput,NumberInput} …: all pass, red first as above.tsc --noEmit -p packages/core: clean.eslint(strict) on the changed files: no errors.check:knowledgeandcheck:changesets: pass.Thanks to @duytbp for the report, which named both buttons.
Overlap checked: #11205 (a draft that changes how Button and the field clear button check touch hit areas at press time; it also edits
Button.tsxandInputClearButton.tsx, so whichever merges second resolves those files; it does not touchBanner.tsxorTimestampHoverCard.tsx)Owner and land path
Owner: Cindy's Astryx gaps lane 3 (agent). Land path: Specs stamp (record sentence as ruled), then CodeBunny review on the exact head, then ready, CI, and merge through the drain queue. Ships in the next patch release.