Skip to content

fix(Button): a tooltip that a built-in name already contains is not read again - #11967

Merged
cixzhang merged 8 commits into
mainfrom
fix/tooltip-in-name-no-description
Nov 25, 2026
Merged

cixzhang merged 8 commits into
mainfrom
fix/tooltip-in-name-no-description

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Why it fails: Button leaves a tooltip out of the description only when the tooltip equals the accessible name (component:Button FR12). 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).
  • The fix: an internal, unexported Button context, 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, InputClearButton and Timestamp's copy button set it.
  • What stays the same:
    • The public rule stays "equals". A caller's Button whose tooltip is only part of its name still gets the tooltip as its description; a new test pins that.
    • The visible tooltips don't change.

Expected behavior and authority

component:Button FR12 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.tsx and TimestampHoverCard.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).
  • No public API, prop, export or visual change.
  • Changeset: @astryxdesign/core patch, [fix].

Evidence

  • Red first: three new or updated cases fail before the change and pass after:
    • Banner, with a string title: the dismiss button has no description, while the "Dismiss" tooltip still renders;
    • InputClearButton: no description, with the "Clear" tooltip still showing;
    • Timestamp's copy button: named "Copy …", with no description.
  • Browser proof (spec:AST-009 FR3): ButtonTooltipInName.a11y.chromium.spec.ts reads the accessibility tree for the Banner Dismissable, TextInput Clearable and Timestamp Per-entry copyable stories. It checks the name, an empty description, and the visible tooltip. Button's verified_by and FR12 verification row list it. It runs in CI's a11y contract leg; this machine's sandbox cannot launch Chromium.
  • Public rule pinned: a new Button case, where a tooltip that is only part of the name still describes the Button, passes before and after.
  • Updated assertions: two existing Banner tests asserted the old repeated description ("Dismiss", and the translated "Schließen"). Both now assert no description and the visible tooltip.
  • Audit of other Core tooltip and name pairs: no other Core Button's name contains a shorter tooltip.
    • The tooltip equals the name, so FR12's public rule already applies: Banner's expand and collapse; Dialog's and Drawer's close; Pagination's first, previous, next and last; PowerSearch's sheet remove; Stepper's previous and next; CodeBlock's copy at rest.
    • The tooltip adds words the name lacks, so it describes the button as intended: Tokenizer's "nothing to clear" and selection-limit tooltips; CodeBlock's "Copy code" after a copy, when the name is "Copied".
    • The tooltip is the caller's own: DropdownMenu's button, ToggleButton.
  • Unchanged paths: Button, Banner, Field, TextInput, NumberInput and Timestamp pass, with the shared-identity check: 1,358 tests in 36 files.

Scope

Components: Button, Banner, InputClearButton, Timestamp

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

  • R1 present tense: the added FR12 sentence and the amended IconButton AR2 are present tense. R2 research: none. R3 verification: covered by the Button, Banner and InputClearButton tests above. R4 rejected alternatives: none in the record. R5 change references: none. R6 open questions: none. R7 project status: none.

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:knowledge and check: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.tsx and InputClearButton.tsx, so whichever merges second resolves those files; it does not touch Banner.tsx or TimestampHoverCard.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.

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

vercel Bot commented Nov 16, 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 Nov 25, 2026 12:37am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 25, 2026, 1:57 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 16, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 16, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec b0a92e0

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

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · ecef7f7

Storybook · Sandbox · built from this PR's head

Modified components

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)

Generated by PR Enrichment workflow | 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.

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 ButtonTooltipInNameContext with a test, or narrow the sentence and approve it again.
  • The new ButtonTooltipInNameContext block in Button.tsx sits between ButtonVariant's JSDoc and its declaration, so the published ButtonVariant type 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 in Button.tsx and InputClearButton.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-009 FR3 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-579 passes on main and here.
  • Claim: the context is internal and the package does not export it. Verified: Button/index.ts:32-33 re-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-904 asserts 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 in Button.tsx and InputClearButton.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 (ButtonVariant doc comment).
  • File packages/core/src/Field/InputClearButton.test.tsx: clear.
  • File packages/core/src/Field/InputClearButton.tsx: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Button/Button.tsx Resolved
Comment thread packages/core/src/Button/Button.tsx Resolved
…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.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec e46e325

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

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.ts reads 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 add Timestamp to its @pr-a11y scope line, 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-33 re-exports by name).
    • Caller Buttons keep the equality rule, pinned by a new test: verified (Button.test.tsx:566-579 passes 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.tsx and InputClearButton.tsx: verified (its file list).
  • Files
    • .changeset/tooltip-in-name-no-description.md: clear
    • docs/specs/components/Button/Button.spec.md: clear (optional: list the new browser spec in verified_by and the FR12 verification row)
    • packages/core/src/Banner/Banner.test.tsx: clear
    • packages/core/src/Banner/Banner.tsx: clear
    • packages/core/src/Button/Button.test.tsx: clear
    • packages/core/src/Button/Button.tsx: clear
    • packages/core/src/Button/__tests__/ButtonTooltipInName.a11y.chromium.spec.ts: finding: no Timestamp case
    • packages/core/src/Field/InputClearButton.test.tsx: clear
    • packages/core/src/Field/InputClearButton.tsx: clear
    • packages/core/src/Timestamp/Timestamp.test.tsx: clear (jsdom only)
    • packages/core/src/Timestamp/TimestampHoverCard.tsx: finding: its description change has no accessibility-tree proof

Automated review (maintainer link)

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

Copy link
Copy Markdown
Contributor Author

/approve-spec 953abf6

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 16, 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.

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 and toBeFocused() fails on every run; wait for #storybook-root time before 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-33 re-exports by name).
    • Caller Buttons keep the equality rule, pinned by a new test: verified (Button.test.tsx:566-579 passes 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.tsx and InputClearButton.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: clear
    • docs/specs/components/Button/Button.spec.md: clear
    • packages/core/src/Banner/Banner.test.tsx: clear
    • packages/core/src/Banner/Banner.tsx: clear
    • packages/core/src/Button/Button.test.tsx: clear
    • packages/core/src/Button/Button.tsx: clear
    • packages/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: clear
    • packages/core/src/Field/InputClearButton.tsx: clear
    • packages/core/src/Timestamp/Timestamp.test.tsx: clear
    • packages/core/src/Timestamp/TimestampHoverCard.tsx: clear (its browser proof waits on the spec fix)

Automated review (maintainer link)

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

Copy link
Copy Markdown
Contributor Author

/approve-spec 6d1143e

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

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-33 re-exports by name).
    • Caller Buttons keep the equality rule, pinned by a new test that passes before and after: verified (Button.test.tsx:566-579 passes 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.tsx and InputClearButton.tsx, not Banner.tsx or TimestampHoverCard.tsx: verified (its file list; it also edits Button.spec.md and InputClearButton.test.tsx).
    • The linked issue's report names both the dismiss and the clear button: verified.
  • Files
    • .changeset/tooltip-in-name-no-description.md: clear
    • docs/specs/components/Button/Button.spec.md: clear
    • packages/core/src/Banner/Banner.test.tsx: clear
    • packages/core/src/Banner/Banner.tsx: clear
    • packages/core/src/Button/Button.test.tsx: clear
    • packages/core/src/Button/Button.tsx: clear
    • packages/core/src/Button/__tests__/ButtonTooltipInName.a11y.chromium.spec.ts: clear (the Timestamp case now waits and passes)
    • packages/core/src/Field/InputClearButton.test.tsx: clear
    • packages/core/src/Field/InputClearButton.tsx: clear
    • packages/core/src/Timestamp/Timestamp.test.tsx: clear
    • packages/core/src/Timestamp/TimestampHoverCard.tsx: clear

Automated review (maintainer link)

# 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.
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 24, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 58416f3

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 24, 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.

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.md lists ButtonTooltipInName.a11y.chromium.spec.ts but 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.tsx FR12 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 includes at Button.tsx:1080; InputClearButton.test.tsx:98-107.
  • The cause is FR12's equality rule: verified, Button.spec.md FR12 on the base.
  • The fix is an internal, unexported Button context: verified, Button.tsx:366-376; Button/index.ts:32-33 re-exports only Button and 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 the banner-close class 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.

Automated review (maintainer link)

# Conflicts:
#	docs/specs/components/Button/Button.spec.md
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 24, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 3084bf3

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 24, 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.

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:IconButton AR2 still says a caller's tooltip "also describes the button unless it repeats the label", which Timestamp's copy button no longer does, so amend AR2 in this pull request to defer to FR12 (for example "unless component:Button FR12 leaves it out: it repeats the label, 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-1081 and the tests at Banner.test.tsx:245, InputClearButton.test.tsx:84-95 and Timestamp.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.ts re-exports only Button and 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:IconButton AR2 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.

Automated review (maintainer link)

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.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 25, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec ecef7f7

1 similar comment
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec ecef7f7

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 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.

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

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 25, 2026 01:35
@cixzhang
cixzhang merged commit 12a513c into main Nov 25, 2026
165 checks passed
@github-actions
github-actions Bot deleted the fix/tooltip-in-name-no-description branch November 25, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — ecef7f70 Deployed Nov 25, 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-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Button: a tooltip that is part of the name is still read as its description

2 participants