Repository navigation
fix(core): move the popup theme targets onto the surface that paints - #5009
Merged
Merged
Conversation
The targets added in #4991 landed on each component's content box, while the element carrying background, radius and elevation is the surface usePopover renders one level above it. A theme rule written against those classes could not paint the popup. usePopover now names the surface: a shared astryx-popover-surface on every popup, plus an optional per-component surfaceTarget. Selector gains the astryx-selector-popup its sibling MultiSelector already had.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
cixzhang
enabled auto-merge (squash)
August 14, 2026 01:02
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
Popover (@astryxdesign/core) · View in Storybook
Selector (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
The guard scans core for themeProps()/stableClassName()/legacyNames literals. A surface target is a literal too — it just rides a usePopover option, because the element it names is not the component's to render.
ernestt
added a commit
that referenced
this pull request
Aug 14, 2026
Adopt surfaceTarget from #5009 which correctly places the theme target on the popover surface element. Keep the handleRef composition API close helper and handlePopoverHide callback. Use shared focusOutlineStyles for ghost variant focus ring.
4 tasks done
This branch was successfully deployed
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
You asked whether #4991's targets were consistent with Selector's. Checking that turned up something worse than a naming problem: the targets were on the wrong element.
Measured in Chromium, the ancestor chain of
.astryx-complex-selector-popupas shipped in 0.4.0:.astryx-complex-selector-popuprgba(0,0,0,0)0px8pxrole="dialog", no astryx classrgb(255,255,255)12px0px[popover]layerDepth 1 is the surface
usePopoverrenders. That is the element painting the popup, and it had no theme target at all — so the class a theme reaches for to restyle a popup's background, border or elevation was attached to the padding box inside it, where none of those rules can paint the popup. The changelog promised exactly those four properties.What
The targets move to the surface. Because the surface belongs to
usePopoverand not to the component, a component cannot put a class there on its own — sousePopovergainssurfaceTarget, the name to stamp on it, and always stamps a sharedastryx-popover-surfaceso a theme can style every popup surface at once.Selectorgainsastryx-selector-popup, whichMultiSelectorhad and it did not — the asymmetry that started this. Putting the target on the surface also dissolves the reason I skipped Selector in #4991: its popup root differs by thehasSearchbranch, but the surface is the same element either way, so one theme rule now means one box instead of two.Names unchanged, so no deprecation alias:
-popupwas the right word for this element all along. Anything styling padding through these classes in the few hours 0.4.0 has existed would need to move to the component's own content, which is why this is a[fix]rather than silent.Risk
Low. No default visual change — the surface's own StyleX styles are untouched, and the classes only add a theming hook. The behavioral change is which element the class sits on, and it is hours old with no known consumer.
One trap worth flagging for review:
mergePropsis positional, and a third object argument is read asstyle, not as more props. My first attempt passedstylex.props(...)third and silently lost every surface style — caught by re-measuring, not by types or tests. The call is now composed into two arguments. Worth a follow-up: a variadicmergeProps, or a dev warning, because that failure is invisible.Testing
packages/corefull suite: 6310 pass, 242 files. Typecheck clean. eslint clean on all four changed component dirs (the oneborderVarswarning in MultiSelector is pre-existing — 1 before, 1 after).hasSearch, pinning that both branches resolve to the same element.surfaceTargetfails exactly 5 tests and nothing else; restoring passes 223.rgb(255,255,255)/12px/ shadow set for both ComplexSelector and MultiSelector.