Skip to content

refactor(styles): share the [popover] border reset as popupReset.borderless - #168

Open
aayushbtw wants to merge 1 commit into
ui-sdkfrom
refactor/popup-border-reset
Open

aayushbtw wants to merge 1 commit into
ui-sdkfrom
refactor/popup-border-reset

Conversation

@aayushbtw

Copy link
Copy Markdown
Owner

Why

The goal is to fix every bug on ui-sdk that we can fix on our side, before it lands on main. This unit is the tracker follow-up "Popup border resets" from #157. Five popups each zeroed the browser's [popover] border with their own copy of the same four lines and their own comment. ui-sdk leaves that border on menu, select, combobox and date picker content (@ui-sdk/react/docs/styling-and-animation.md:144). The next popup that needs the reset should find it in one place.

What changed

  • popupReset.borderless in packages/ui/src/lib/constella/styles.ts zeroes the four border widths.
  • Select, Combobox, Dropdown Menu, Date Range Picker and Prompt Input's command list apply it right after popupReset.base (Date Range Picker after popoverStyles.popup, which is popupReset.base). Each drops its own four lines.
  • Margin and padding stay in each file, since they differ. Select and Combobox keep their comments, trimmed to what they still reset.

Tradeoffs

  • Border only, not the whole [popover] box. Comment Sicko proposed widening it to border, margin and padding. Rejected. Dropdown Menu, Date Range Picker and Prompt Input set no margin today, and Prompt Input's menu measures margin-top: 8px. A shared margin reset would change that, so this would not be a pure refactor.
  • Not in popupReset.base or popupSurface.base. Sheet, Tooltip and Popover also use popupReset.base, and Hover Card and Model Picker use popupSurface.base. Adding the reset there would change those parts.
  • The name is borderless, not border. The project lint constella(no-shorthand-mix) reads a border key as the shorthand.
  • Principles: laziness-protocol (share only what is identical). prove-it-works (built CSS, prerender and runtime computed styles, not just the type check).

Verification

  • vpr check, vpr build and vpr test pass (75 files, 664 passed, 1 expected fail).
  • node apps/site/scripts/diff-prerender.ts before after reports 0 of 84 pages differ.
  • The built CSS is byte-identical. styles-ByMNzEmc.css has the same name and md5 in both builds.
  • A Playwright script served both builds and opened each popup in light and dark. It compared the computed border width and style, margin, padding, inset and size, plus the class set, of the open popup. 10 of 10 cases are identical. Script ~/.local/share/pw/jpop-cmp.mjs. Report and screenshots are local in orbit-autopilot/ui-sdk-fix-all/shots/J-popreset/.
  • The ui-sdk-reuse-reviewer returned CLEAN. ui-sdk has no reset API for these parts, and its web.css is a whole theme that Constella doesn't import.
  • /orbit:deslop and /orbit:no-comments ran. Comment Sicko deleted nothing, and its one kill is rejected under Tradeoffs.

Tracker

  • Follow-ups, "Popup border resets": done in this PR. The four border widths are now popupReset.borderless. Margin and padding stay in each part because they differ.

…erless

Select, Combobox, Dropdown Menu, Date Range Picker and Prompt Input's command list each zeroed the browser's [popover] border on their own. They now take popupReset.borderless; each keeps its own margin and padding, which differ. Built CSS and prerendered pages are identical, and the open popups' computed styles match base in light and dark.
@aayushbtw aayushbtw added the ui-sdk Base UI to ui-sdk migration label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui-sdk Base UI to ui-sdk migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant