Repository navigation
fix(selector): drop the shared trigger-icon wrapper - #4846
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
August 9, 2026 17:03
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsComplexSelector (@astryxdesign/core) · View in Storybook
MultiSelector (@astryxdesign/core) · View in Storybook
Selector (@astryxdesign/core) · View in Storybook
Table (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
force-pushed
the
fix/selector-trigger-icon-wrapper
branch
from
August 9, 2026 17:16
4395448 to
e7e0f44
Compare
This was referenced Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Follow-up to #4838. That PR moved each rotation onto the icon it belongs to, but in the three selectors the icon still sat inside a shared wrapper span:
Two problems in one node. A theme could restyle the chevron but not the box around it, and the status glyph and the disclosure chevron — two unrelated affordances — shared a parent purely because they happen to occupy the same 16px.
The wrapper turned out to be entirely redundant:
<Icon>already provideswidth/height: 16size="sm"→1remcolor: --color-icon-secondarycolor="secondary"→ the same tokenalignItems/justifyContent: centerdisplay: flexinline-flexflexShrink: 0xstyleThe colour was already dead on the status branch — that
<Icon>passesSTATUS_ICON_COLOR_MAP[status.type]and overrides it. It existed only so the chevron could saycolor="inherit".What
Each trigger
<Icon>now carries its own box, colour, rotation and theme target;triggerIconcollapses toflexShrink: 0. Selector, MultiSelector and ComplexSelector were byte-identical here, and all three are converted.The chevron changes
color="inherit"→color="secondary"— the same--color-icon-secondaryit inherited from the wrapper, now set on the element a theme can reach.No new theme targets. The status icon still has none of its own; making it themeable is a separate decision, noted below.
The status tooltip's
<button>stays. It carriesaria-label,onClickand the tooltip ref — behaviour, not styling.IconButtonis not a fit: it is aButton, so it brings padding and a hit target that a bare inline affordance inside another control's trigger row should not have. And the button is not in the way — see the theme probe below.Visual verification
Two Storybook servers (this branch vs
mainat 4b1fef5), Playwright at 2×. Both the rendered pixels and each icon's measured box, position and computed colour:Selector/DefaultSelector/WithStatusSelector/StatusVariantComparisonSelector/ClearableWithStatusSelector/SizeVariantsSelector/GhostVariantMultiSelector/DefaultMultiSelector/StatusComplexSelector/FruitRipenessGridSelector/StatusVariantComparison— before / after, 0 differing pixels:Selector/SizeVariants, after — the 16px box is unchanged at every trigger size:Theme probe — the point of the change
Injecting the kind of same-element rule
defineThemeemits, into@layer astryx-theme, and measuring what lands:<button>?rgb(165,12,37)selector-indicator-icon)rgb(115,115,115)rgb(255,0,255)field-status-iconrgb(137,0,26)Every trigger icon is reachable, including the one inside the button — so the wrapper
<button>does not need adjusting for the icon to be themed. The chevron's own target overrides its colour, which is the seam this PR opens.Testing
pnpm -F @astryxdesign/core typecheck·pnpm -F @astryxdesign/core lint— 0 errors (12 warnings, all pre-existingno-style-only-wrapperreports on main)pnpm exec vitest run --project ui packages/core/src/Selector packages/core/src/MultiSelector packages/core/src/ComplexSelector— 175 passingcolor="secondary"instead ofcolor="inherit", matching where the colour moved. Same guard, same intent: no colour or size drift versus a standalone icon.Also here
Three unused
themePropsimports left behind onmainby #4838 (the Table plugins whose wrappers it removed). One line each; they were failing lint on this branch.Noted, not done
The on-field status icon has no theme target — it renders as a bare
astryx-icon, while the detached one hasastryx-field-status-icon. So a theme cannot restyle just the error/warning glyph in a Selector trigger. That is a new target rather than a consolidation, so it is deliberately not in this PR.