Repository navigation
refactor(ui): share the popup surface as popupSurface - #157
Merged
Merged
Conversation
Popover, Hover Card, Select, Combobox, Dropdown Menu, Prompt Input's menu and Model Picker's command each wrote out the raised fill, lg corners and lg shadow. popupSurface.base in styles.ts now holds them, beside popupReset, and each popup applies it before its own styles.
Owner
Author
|
Verdict: PASS+NOTES at 45c905c (code verified at 72e9140). check and 543 tests green; 104 popup shots light/dark, 0 px and 0 computed-style differences vs parent on dev and production builds; style order unchanged. Fix round made the ARCHITECTURE popupSurface bullet exact for Model Picker. Note: Prompt Input's / menu doesn't open on the dev server at parent or head (works in production); pre-existing. |
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
Goal: every popup that draws the raised popup surface should take it from one shared style, as the popups already take their motion from
popupMotion. Before this change, seven popups each wrote out the same three values: theraisedfill,lgcorners and thelgshadow. A later change to the surface had to find all seven. This closes the tracker row "Popup surfaces repeat one style". The look does not change.What changed
popupSurface.baseinpackages/ui/src/lib/constella/styles.ts, besidepopupReset, holds the fill, the fourlgcorners and thelgshadow.popoverStyles.surfacecarries it, so Date Range Picker and Model Picker's details keep the surface without an edit.popupSurface.base, and their localboxShadowis gone. Command is unchanged.docs/ARCHITECTURE.mdlistspopupSurfaceamong thestyles.tsexports and adds a bullet on who applies it.Scope
Left as they are, because they deliberately differ:
smcorners.xlcorners and thexlshadow.mdcorners. Side Panel usesshadows.panel.Out of scope: Select, Combobox, Dropdown Menu and Date Range Picker each repeat a reset of the browser's
[popover]border. The resets differ per part (margin, padding), so they stay out of the surface.Tradeoffs
styles.ts, notmotion.ts. ARCHITECTURE puts shared styles instyles.tsand motion inmotion.ts, andpopupResetalready lives there. The advisor picked this placement and the namepopupSurface.base, which mirrorspopupReset.base.Blast Radius
Every anchored popup's class list changes. StyleX atoms are hashed by property and value, so each popup gets the same atomic classes as before.
Verification
vpr checkandvpr teston the rebased head. Both pass (543 tests passed, 1 expected fail).origin/ui-sdkat 446959e and then on this change rebased onto it. The final rebase onto 75d1153 applied with no conflict and touched none of these lines.styles__popupSurface.base, so the "after" run used the new code./menu does not open in the browser on this branch (see below). A throwaway jsdom test opened it through@ui-sdk/core/testingand compared the content's atomic classes before and after. All 29 matched.Found and not fixed (out of scope): on the docs page, typing
/as the first character of the Prompt Input command demo is swallowed, so the menu never opens. Text typed after it lands. This happens onorigin/ui-sdkwithout this change, and still happens after #153. The jsdom tests still pass.