Repository navigation
fix(ButtonGroup): in forced colors, a last child with the hidden attribute leaves the outer edge closed on the last visible button - #13724
Conversation
…ter edge closed on the last visible button
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec db32930 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Button · Storybook | 69.6 kB (+5 B) · 11.2 kB CSS (+5 B) | 808 (0) | ✓ · ✓ · ✗ |
| CheckboxInput | 73.3 kB (+34 B) · 11.0 kB CSS (+6 B) | — | — · — · — |
| DropdownMenu | 136.2 kB (+35 B) · 19.9 kB CSS (+4 B) | — | — · — · — |
121 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Toast | 109.6 kB (+33 B) · 11.5 kB CSS (+6 B) | — | — · — · — |
| MobileNavToggle | 71.4 kB (+33 B) · 11.8 kB CSS (+5 B) | — | — · — · — |
| TextInput | 103.6 kB (+32 B) · 12.9 kB CSS (+6 B) | — | — · — · — |
| ChatLayout | 93.4 kB (+32 B) · 11.7 kB CSS (+5 B) | — | — · — · — |
| MoreMenu | 136.5 kB (+33 B) · 19.9 kB CSS (+4 B) | — | — · — · — |
| SideNav | 117.9 kB (+31 B) · 12.6 kB CSS (+5 B) | — | — · — · — |
| NumberInput | 108.6 kB (+27 B) · 13.1 kB CSS (+7 B) | — | — · — · — |
| Switch | 113.7 kB (+27 B) · 10.8 kB CSS (+6 B) | — | — · — · — |
| ComplexSelector | 86.4 kB (+23 B) · 13.4 kB CSS (+9 B) | — | — · — · — |
| TimeInput | 184.2 kB (+26 B) · 17.9 kB CSS (+6 B) | — | — · — · — |
| Carousel | 80.1 kB (+25 B) · 12.2 kB CSS (+6 B) | — | — · — · — |
| InfoTip | 53.3 kB (+24 B) · 6.1 kB CSS (+7 B) | — | — · — · — |
| TextArea | 97.0 kB (+25 B) · 10.3 kB CSS (+6 B) | — | — · — · — |
| TopNav | 73.2 kB (+24 B) · 12.1 kB CSS (+7 B) | — | — · — · — |
| Avatar | 48.2 kB (+23 B) · 6.3 kB CSS (+7 B) | — | — · — · — |
| Slider | 118.9 kB (+23 B) · 9.6 kB CSS (+7 B) | — | — · — · — |
| ContextMenu | 109.7 kB (+24 B) · 19.7 kB CSS (+5 B) | — | — · — · — |
| Lightbox | 153.5 kB (+22 B) · 12.4 kB CSS (+7 B) | — | — · — · — |
| TopNavMegaMenu | 84.3 kB (+22 B) · 13.2 kB CSS (+7 B) | — | — · — · — |
| BreadcrumbItem | 105.9 kB (+11 B) · 14.2 kB CSS (+17 B) | — | — · — · — |
| InputGroupText | 7.5 kB (+22 B) · 4.1 kB CSS (+6 B) | — | — · — · — |
| Table | 129.1 kB (+21 B) · 21.3 kB CSS (+7 B) | — | — · — · — |
| Thumbnail | 74.1 kB (+21 B) · 12.8 kB CSS (+7 B) | — | — · — · — |
| DateInput | 212.0 kB (+21 B) · 19.0 kB CSS (+6 B) | — | — · — · — |
| PowerSearch | 323.6 kB (+22 B) · 27.4 kB CSS (+5 B) | — | — · — · — |
| RadioList | 64.7 kB (+21 B) · 8.0 kB CSS (+6 B) | — | — · — · — |
| SideNavHeading | 91.1 kB (+21 B) · 12.6 kB CSS (+6 B) | — | — · — · — |
| TableCell | 110.8 kB (+21 B) · 20.3 kB CSS (+6 B) | — | — · — · — |
| TabMenu | 87.3 kB (+22 B) · 12.5 kB CSS (+5 B) | — | — · — · — |
| Tokenizer | 116.3 kB (+20 B) · 22.0 kB CSS (+7 B) | — | — · — · — |
| TopNavHeading | 90.7 kB (+23 B) · 12.6 kB CSS (+4 B) | — | — · — · — |
| lab/Comments | 393.9 kB (+27 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/Schedule | 121.3 kB (+27 B) · 3.9 kB CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 54.3 kB (+19 B) · 6.4 kB CSS (+7 B) | — | — · — · — |
| FieldLabel | 58.7 kB (+20 B) · 6.5 kB CSS (+6 B) | — | — · — · — |
| Popover | 108.1 kB (+20 B) · 15.7 kB CSS (+6 B) | — | — · — · — |
| SegmentedControl | 105.2 kB (+21 B) · 7.6 kB CSS (+5 B) | — | — · — · — |
| lab/SelectableCardGroup | 73.6 kB (+26 B) · 162 B CSS (0) | — | — · — · — |
| lab/TabBarMoreList | 107.3 kB (+26 B) · 1.8 kB CSS (0) | — | — · — · — |
| DateRangeInput | 109.1 kB (+18 B) · 14.3 kB CSS (+7 B) | — | — · — · — |
| lab/TransferList | 142.3 kB (+25 B) · 1.2 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 86.5 kB (+14 B) · 12.2 kB CSS (+10 B) | — | — · — · — |
| CheckboxList | 77.3 kB (+15 B) · 8.5 kB CSS (+9 B) | — | — · — · — |
| Field | 63.2 kB (+18 B) · 8.0 kB CSS (+6 B) | — | — · — · — |
| ToggleButton | 97.1 kB (+19 B) · 11.3 kB CSS (+5 B) | — | — · — · — |
| TopNavMenu | 90.2 kB (+17 B) · 12.6 kB CSS (+7 B) | — | — · — · — |
| Markdown | 213.7 kB (+19 B) · 23.6 kB CSS (+4 B) | — | — · — · — |
| Selector | 124.5 kB (+20 B) · 19.8 kB CSS (+3 B) | — | — · — · — |
| lab/CommentComposer | 190.1 kB (+23 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 98.8 kB (+23 B) · 2.3 kB CSS (0) | — | — · — · — |
| lab/MediaPlayButton | 232.4 kB (+23 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaSeekButton | 232.4 kB (+23 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaTimeSlider | 232.4 kB (+23 B) · 1.5 kB CSS (0) | — | — · — · — |
| AppShell | 93.8 kB (+16 B) · 15.0 kB CSS (+6 B) | — | — · — · — |
| FileInput | 79.7 kB (+16 B) · 12.9 kB CSS (+6 B) | — | — · — · — |
| lab/AudioPlayer | 242.2 kB (+22 B) · 1.8 kB CSS (0) | — | — · — · — |
| lab/MediaCaptionsButton | 232.4 kB (+22 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaFullscreenButton | 232.4 kB (+22 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaTime | 232.4 kB (+22 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaVolume | 232.4 kB (+22 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/TourStep | 99.1 kB (+22 B) · 691 B CSS (0) | — | — · — · — |
| lab/TransferListSelector | 154.4 kB (+22 B) · 1.4 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 319.6 kB (+22 B) · 454 B CSS (0) | — | — · — · — |
| charts/ChartTooltip | 230.8 kB (+21 B) · 451 B CSS (0) | — | — · — · — |
| AlertDialog | 136.4 kB (+12 B) · 16.3 kB CSS (+9 B) | — | — · — · — |
| ChatComposerInput | 90.6 kB (+16 B) · 12.6 kB CSS (+5 B) | — | — · — · — |
| ChatComposerTokenElement | 90.6 kB (+16 B) · 12.6 kB CSS (+5 B) | — | — · — · — |
| DateTimeInput | 236.3 kB (+15 B) · 20.7 kB CSS (+6 B) | — | — · — · — |
| Pagination | 157.3 kB (+19 B) · 20.2 kB CSS (+2 B) | — | — · — · — |
| StatusDot | 36.1 kB (+14 B) · 6.0 kB CSS (+7 B) | — | — · — · — |
| lab/MediaPlaybackRate | 232.4 kB (+21 B) · 1.5 kB CSS (0) | — | — · — · — |
| InputGroup | 65.4 kB (+14 B) · 9.2 kB CSS (+6 B) | — | — · — · — |
| MultiSelector | 112.1 kB (+15 B) · 19.0 kB CSS (+5 B) | — | — · — · — |
| TableHeaderCell | 110.7 kB (+17 B) · 20.1 kB CSS (+3 B) | — | — · — · — |
| charts/Chart | 254.3 kB (+19 B) · 516 B CSS (0) | — | — · — · — |
| Link | 59.6 kB (+13 B) · 7.8 kB CSS (+6 B) | — | — · — · — |
| Tooltip | 34.3 kB (+12 B) · 5.1 kB CSS (+7 B) | — | — · — · — |
| lab/EmojiPicker | 123.2 kB (+19 B) · 751 B CSS (0) | — | — · — · — |
| ListItem | 83.9 kB (+18 B) · 12.8 kB CSS (0) | — | — · — · — |
| RadioListItem | 81.0 kB (+16 B) · 11.5 kB CSS (+2 B) | — | — · — · — |
| Stepper | 71.3 kB (+12 B) · 11.3 kB CSS (+6 B) | — | — · — · — |
| lab/CommentThread | 387.0 kB (+18 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/VideoPlayer | 239.8 kB (+18 B) · 2.1 kB CSS (0) | — | — · — · — |
| ChatComposer | 93.4 kB (+11 B) · 13.6 kB CSS (+6 B) | — | — · — · — |
| MobileNav | 82.0 kB (+12 B) · 11.8 kB CSS (+5 B) | — | — · — · — |
| lab/ChatReactionBar | 132.7 kB (+17 B) · 1.1 kB CSS (0) | — | — · — · — |
| AvatarGroup | 51.1 kB (+8 B) · 6.4 kB CSS (+7 B) | — | — · — · — |
| CheckboxListItem | 84.8 kB (+15 B) · 12.8 kB CSS (0) | — | — · — · — |
| Typeahead | 98.1 kB (+9 B) · 14.5 kB CSS (+6 B) | — | — · — · — |
| richtext/RichTextView | 289.8 kB (+15 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 131.5 kB (+12 B) · 773 B CSS (0) | — | — · — · — |
| Banner | 71.7 kB (+6 B) · 11.7 kB CSS (+5 B) | — | — · — · — |
| CodeBlock | 85.8 kB (+5 B) · 12.9 kB CSS (+6 B) | — | — · — · — |
| lab/ListInput | 99.4 kB (+11 B) · 922 B CSS (0) | — | — · — · — |
| DrawerHeader | 73.0 kB (+5 B) · 14.3 kB CSS (+5 B) | — | — · — · — |
| CommandPaletteInput | 34.7 kB (0) · 8.3 kB CSS (+9 B) | — | — · — · — |
| lab/CommentPin | 63.2 kB (+9 B) · 1.2 kB CSS (0) | — | — · — · — |
| IconButton | 69.6 kB (+3 B) · 11.2 kB CSS (+5 B) | — | — · — · — |
| richtext/RichTextEditor | 313.2 kB (+8 B) · 2.7 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 70.1 kB (+2 B) · 11.3 kB CSS (+5 B) | — | — · — · — |
| ChatToolCalls | 33.6 kB (+1 B) · 9.2 kB CSS (+6 B) | — | — · — · — |
| CommandPalette | 84.7 kB (−1 B) · 13.8 kB CSS (+8 B) | — | — · — · — |
| NavHeadingMenuItem | 19.9 kB (−1 B) · 7.0 kB CSS (+8 B) | — | — · — · — |
| ProgressBar | 12.6 kB (0) · 7.0 kB CSS (+7 B) | — | — · — · — |
| Spinner | 25.7 kB (0) · 6.9 kB CSS (+7 B) | — | — · — · — |
| Calendar | 80.8 kB (−1 B) · 11.8 kB CSS (+7 B) | — | — · — · — |
| DropdownMenuSubMenu | 82.8 kB (−1 B) · 11.5 kB CSS (+7 B) | — | — · — · — |
| Heading | 12.9 kB (0) · 6.1 kB CSS (+6 B) | — | — · — · — |
| Text | 12.0 kB (0) · 6.1 kB CSS (+6 B) | — | — · — · — |
| DialogHeader | 72.8 kB (−1 B) · 12.9 kB CSS (+6 B) | — | — · — · — |
| SideNavItem | 85.2 kB (−2 B) · 12.5 kB CSS (+7 B) | — | — · — · — |
| Timer | 14.5 kB (0) · 6.7 kB CSS (+5 B) | — | — · — · — |
| Timestamp | 28.4 kB (−1 B) · 11.5 kB CSS (+6 B) | — | — · — · — |
| lab/DialogHeroHeader | 94.3 kB (+5 B) · 372 B CSS (0) | — | — · — · — |
| ChatMessageList | 29.1 kB (−1 B) · 7.8 kB CSS (+5 B) | — | — · — · — |
| TableSelectionToolbar | 80.2 kB (−3 B) · 14.6 kB CSS (+7 B) | — | — · — · — |
| SideNavCollapseButton | 70.4 kB (−1 B) · 11.3 kB CSS (+4 B) | — | — · — · — |
| ChatSendButton | 70.0 kB (−3 B) · 11.2 kB CSS (+5 B) | — | — · — · — |
| ChatLayoutScrollButton | 70.1 kB (−4 B) · 11.4 kB CSS (+4 B) | — | — · — · — |
| charts/ChartLegend | 42.6 kB (−1 B) · 224 B CSS (0) | — | — · — · — |
| lab/LineClamp | 14.6 kB (−1 B) · 168 B CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 8.03 MB packed (+274 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: the selector fix itself looks right, but the release note promises more than it delivers.
- The changeset and title say a group whose last child is hidden now closes its outer edge, but the new selector skips only elements with the
hiddenattribute, so a last child hidden by CSS (for example adisplay: noneclass that hides the last Button at narrow widths) still leaves the edge open; narrow the wording to a last child with thehiddenattribute.
The new selector comment uses the same broad wording, and an inline suggestion covers it. The new Chromium cases have not run on this head yet.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: on the base, a hidden last child leaves the last visible button with no trailing edge in forced colors. Verified: the base edge rules key off the last member, which is the hidden child.
- Claim: without a hidden child the outline closes. Verified: both selectors pick the same button then.
- Claim: InputGroup is not affected. Verified: only grouped Buttons spread the edge rules, and InputGroup keeps its own member styles.
- Claim: the fix moves the edge to the last member that renders. False as worded: it skips only the
hiddenattribute. - Claim: the corners still use the old member selector, so they stay as they are. Verified.
- Claim: eight edge entries change, in both orientations and for
destructive; corner and InputGroup styles do not. Verified. - Claim: no API, default or rest-state style changes. Verified: the module is private and its rest values are unchanged.
- Claim: the new Chromium case fails on the base and passes on the head. Pending: CI has not run on this head; the selectors support both outcomes.
- Claim: unit tests, typecheck, lint and the changeset check pass. Pending CI.
- Changeset: a group whose last child is hidden now closes its edge on the last button you can see. False as worded (finding above).
- Changeset: before, that button drew no trailing border. Verified.
- Changeset: the hidden child still counts for the corners, which stay square. Verified.
- Changeset: nothing changes outside forced colors. Verified: the edge values apply only inside the forced-colors media query.
- File
.changeset/buttongroup-forced-colors-end-edge-hidden-follower.md: finding (claim scope). - File
packages/core/src/Button/__tests__/Button.forcedColors.a11y.chromium.spec.ts: clear. - File
packages/core/src/privateAttributes/tooltipDescription.stylex.ts: clear, apart from the comment wording suggestion.
…fragment; AR7 verification lists the hidden follower
|
/approve-spec a535aa1 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, so the new forced-colors Chromium cases have not run.
The changeset and title now say exactly what the selector does, a last child with the hidden attribute, which resolves the earlier request. One optional inline suggestion drops a comment that only restates IS_LAST_MEMBER.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: on the base, a group whose last child is hidden draws no trailing border on its last visible button in forced colors. Verified: the base edge rules key off the last member, and a hidden child counts as one.
- Claim: without the hidden child the outline closes. Verified: both predicates pick the same button then.
- Claim: InputGroup is not affected. Verified: only grouped solid Buttons take the edge rules (
Button.tsx:941-963), and InputGroup's selectors compile to the same strings as before. - Claim: the edge moves to the last member without the
hiddenattribute, and the corners keep the existing member selector. Verified (tooltipDescription.stylex.ts:54,:65-85,:87-135). - Claim: eight edge entries change (width, style and colour, both orientations,
destructiveincluded), built from one shared member fragment. Verified (:38-39). - Claim: no API, default or rest-state style changes. Verified: the module is private and every edge value sits under the forced-colors media query with
default: null. - Claim: the AR7 verification row lists groups with a hidden-attribute last child. Verified: one cell changes; the other rows only re-pad.
- Claim: a child hidden only by CSS is not covered and keeps today's behaviour. Verified: only
[hidden]is skipped. - Claim: two new cases per group story (horizontal, primary, vertical), in and out of forced colors. Verified (
Button.forcedColors.a11y.chromium.spec.ts:224-250). - Claim: the forced-colors case fails on the base (3 failed, 17 passed) and the file passes on the head (20 passed). Pending CI: not re-run; the file holds 20 tests, and the base selector predicts exactly those three failures.
- Claim: unit tests, typecheck, lint, baselines and the changeset check pass. Pending CI: not re-run.
- Claim: screenshots show the edge open on the base and closed on the head in forced colors, and identical frames without forced colors. Not re-run: no forced-colors capture was possible here; consistent with the selectors.
- Changeset: a group whose last child has the
hiddenattribute now closes its outer edge on the last button you can see. Verified. - Changeset: before, that button drew no trailing border. Verified.
- Changeset: the hidden child still counts for the corners, which stay square. Verified.
- Changeset: nothing changes outside forced colors. Verified.
- Changeset: a child hidden only by CSS is not covered. Verified.
- File
.changeset/buttongroup-forced-colors-end-edge-hidden-follower.md: clear. - File
docs/specs/components/Button/Button.spec.md: clear; an engineering owner approved the record change at this head. - File
packages/core/src/Button/__tests__/Button.forcedColors.a11y.chromium.spec.ts: clear. - File
packages/core/src/privateAttributes/tooltipDescription.stylex.ts: clear, apart from the optional comment suggestion.
| // The group's last member. | ||
| // |
There was a problem hiding this comment.
Non-blocking: this line restates IS_LAST_MEMBER. Drop it and the empty line after it, so the block starts with the reason (:nth-last-child(1 of …), not :not(:has(~ …))).
| // The group's last member. | |
| // |
User impact
In forced colors (Windows high contrast), a ButtonGroup whose last child is hidden, for example a caller's
<span hidden>, draws no trailing border on its last visible button. The group's outline stays open on that side, so a high-contrast user cannot see where the group ends. Without the hidden child, the group closes its outline. InputGroup is not affected.Problem and solution fit
The fix moves only the forced-colors outer edge to the last member without the
hiddenattribute. The corners still use the last member, which counts a hidden follower, so they stay as they are.Expected behavior and authority
component:ButtonAR7: under forced colors, a solid button keeps a visible 1px system-colour border, and in a ButtonGroup its first and last buttons close the group's outer edge.component:ButtonGroupFR3 is unchanged: any following element other than layer pieces counts as a member, so a hidden follower keeps the trailing corners off the visible button outside forced colors.Smallest restoration
privateAttributes/tooltipDescription.stylex.ts: the eight forced-colors trailing-edge entries (width, style, and colour, both orientations,destructiveincluded) select the last member without thehiddenattribute: the existing member selector plus:not([hidden]), both built from one shared member fragment. The corner and InputGroup styles keep the existing member selector. No API, default, or rest-state style changes.Button.spec.mdAR7's verification row now lists the groups with a hidden-attribute last child among its scenarios.Limit: this covers a follower with the
hiddenattribute, which a selector can see. A follower hidden only by CSS (display: none) still counts as a member everywhere and keeps today's behavior. Covering it would mean ButtonGroup no longer counting non-rendering children as members, which is a separate FR3 decision.Evidence
<span>follows it.Button.forcedColors.a11y.chromium.spec.tsadds two cases per group story (horizontal, primary, vertical). With forced colors active and a hidden follower appended, the outer edge closes on the last visible button. Without forced colors, the follower adds no edge.Scope
Components: ButtonGroup, Button
Testing
vitest run --project ui packages/core/src/Button packages/core/src/ButtonGroup packages/core/src/InputGroup packages/core/src/privateAttributes: 295 passed.tsc --noEmit -p packages/core: clean. ESLint clean. Comment-provenance and other baselines up to date.check:changesetspasses.packages/core/src/Button/__tests__/Button.forcedColors.a11y.chromium.spec.ts:2bfebe7b, with this spec): 3 failed, 17 passed. The 3 failures are exactly the new forced-colors hidden-follower cases: the last visible button's trailing border is 0 (horizontal, primary, vertical);<span hidden>appended: