Commit 643f420
committed
Select: redesign as a macOS pop-up button with an over-the-trigger glass menu
Reshapes the house `Select` dropdown (settings, viewer, transfer, debug all render through it) to match a native macOS pop-up button, the look David and his designer landed on for simple selects.
- Trigger is a borderless pill that hugs its content: value text + a round chevron stepper (`chevrons-up-down`), replacing the full-width bordered box with the `▼`. On hover/open the whole trigger fills with the stepper's color, so it reads as one uniform pill (the macOS behavior); the chevrons use the brighter primary text color.
- Menu opens *over* the trigger, macOS-style: the currently-selected row's label lands on the trigger value, measured and applied as a `transform` on the content (a child of zag's positioner, so it never fights zag's own placement), clamped to the viewport. The geometry is the pure, unit-tested `computeOverlapShift` in `select-positioning.ts`.
- Menu is a frosted-glass surface (shared `--color-bg-glass` tokens with tooltips / filter-chip popovers; blur drops under `html.reduce-transparency`). The checkmark marks the current value on the LEFT; the accent fill follows the keyboard/pointer highlight, so a checked-but-not-highlighted row is plain — distinct from the old "checked = accent bg".
- Reveal is driven by the open state through an `$effect` (with a rAF retry loop and a `setTimeout` fallback), NOT zag's `onPositioned`, which never fires in zag 1.41.x and would otherwise leave the menu stuck invisible.
- New `portal` prop (default off) teleports the open menu to `document.body` so it escapes the settings page's masked, scrolling content wrapper (an ancestor `mask-image` fades descendants regardless of z-index, which left the top rows shaded and un-clickable). `SettingSelect` opts in; the viewer's pickers stay non-portaled per their restricted capability set.
Keyboard navigation, ARIA, and the `.select-*` class contract (incl. the a11y-contrast checker's `dropdown_states.go` matrix) are preserved. Verified live (mouse + keyboard) via the Tauri MCP.1 parent 3a2809b commit 643f420
7 files changed
Lines changed: 459 additions & 118 deletions
File tree
- apps/desktop/src
- lib
- settings/components
- ui
- icons
- routes/dev/graphics/sections
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
243 | 277 | | |
244 | 278 | | |
245 | 279 | | |
246 | 280 | | |
247 | 281 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 282 | + | |
| 283 | + | |
254 | 284 | | |
255 | 285 | | |
256 | 286 | | |
| |||
0 commit comments