Skip to content

Studio: align the Images and Video preset dropdown with the title's top - #16081

Merged
shimmyshimmer merged 1 commit into
mainfrom
studio-media-preset-align
Oct 30, 2026
Merged

shimmyshimmer merged 1 commit into
mainfrom
studio-media-preset-align

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What changed

On Images and Video, the top of the preset dropdown ("Default") now lines up with the top of the "Create images" / "Create videos" title. Before, it sat about 1px lower than the title icon.

Why

The dropdown was offset to the heading's cap top (0.122em of text-xl). The title icon is the tallest part of the title and starts above the letters, so the dropdown read as low. It now uses the icon's drawn top: the icon is centred in the line, and its stroke starts 1.25/24 into the glyph. The offset is built from the same --text-xl and --ui-space-scale values as the icon, so it scales with the UI size.

Verification

Images page, WebKit, 2x zoom. The red line marks the top of the title icon. Before, the dropdown border sits below it; after, it starts on it.

Before and after: the preset dropdown top relative to the title icon

  • Pixel rows at 2x, in a 1440x900 dark viewport:

    Icon top Dropdown top, before Dropdown top, after
    WebKit, Images and Video 27 29 27
    Chromium, Images and Video 26 28 26
  • npm run typecheck: clean.

  • npm test: 14,463 of 14,468 pass, 1 skipped. The 4 failures are in hub-gguf-card-unified-budget.test.ts and fail identically on main.

Not covered

Not checked at non-default UI sizes beyond the formula scaling with --ui-space-scale.

The dropdown was offset to the heading's cap top, which sits below the title
icon, so it read as about 1px low. It now starts at the icon's drawn top.
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 30, 2026
@shimmyshimmer
shimmyshimmer merged commit c6056ff into main Oct 30, 2026
1 of 42 checks passed
@shimmyshimmer
shimmyshimmer deleted the studio-media-preset-align branch October 30, 2026 08:15
shimmyshimmer added a commit that referenced this pull request Oct 30, 2026
…issal (#16077)

## What changed

Closing a dropdown by clicking elsewhere no longer leaves text
highlighted. Before, a quick second click selected a word, and a third
selected a whole message or, in Settings, the entire dialog. This
affected every dropdown, select and popover, on every page.

## Why

The OS counts the press that closes a menu as click 1 of a click
sequence. The menu swallows that press, so people click again, and the
next quick clicks arrive with click count 2 and 3. The browser treats
those as a double click (select word) and a triple click (select block).

A capture-phase guard, installed once in `AppProvider`
(`src/lib/dismiss-click-streak.ts`), notes when a left press lands
outside an open Radix menu, listbox or popover. For the rest of that
click sequence, each press selects as if the dismissing click had not
counted:
- click 2 places the caret
- click 3 selects the word (`Intl.Segmenter`, since `Selection.modify`
word steps differ by platform)
- click 4 and later select the enclosing block

The press that closes the menu is untouched, and so are text fields.
Double and triple clicks select as usual when no menu was just closed,
and a fast run of clicks still ends up selecting text.

## Verification

- `npm run typecheck`, `npm run build`: clean.
- `npm test`: 14,463 of 14,468 pass, 1 skipped. The 4 failures are in
`hub-gguf-card-unified-budget.test.ts` and fail identically on `main`.
- New `tests/dismiss-click-streak.test.ts`:
  - follow-ups after a dismissal select one step finer
  - the click-count to granularity mapping
  - word bounds from `Intl.Segmenter`
  - normal double and triple clicks still select
  - a new click sequence resets the guard
  - presses inside the menu and in text fields keep native selection
  - the guard installs once and removes its listeners
- Playwright, WebKit and Chromium. Each case opens a menu, then sends a
hand-paced click sequence (click count 1, 2, 3, about 180ms apart) onto
nearby text:

    | Menu | Before (click 2 / click 3) | After (click 2 / click 3) |
  | --- | --- | --- |
  | Settings Theme | "Accent" / "Accent " | nothing / "Accent" |
  | Settings UI font | "Contrast" / "Contrast " | nothing / "Contrast" |
| Composer "Approve for me" | "Lorem" / whole 347-char message | nothing
/ "Lorem" |
| Account menu | "Lorem" / whole 347-char message | nothing / "Lorem" |

- A fast run of 8 clicks after a dismissal selects the caret, the word,
then the block, instead of nothing.
- At 12 points across four words, the word and block selected after a
dismissal match a native double and triple click in 47 of 48 cases. The
exception is Chromium on the last 2px of a word's final letter, where
native selects the following space.

## Also in this PR

Comment-only trims to `thread.tsx`, `images-page.tsx` and
`video-page.tsx`, carried over from #16076 and #16081, which merged
before their final comment pass.

## Not covered

Not tested in the Desktop app's native WebView or on touch input. The
guard only acts on mouse click counts above 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant