Repository navigation
Studio: align the Images and Video preset dropdown with the title's top - #16081
Merged
Merged
Conversation
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
This was referenced Oct 30, 2026
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.
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.
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.122emoftext-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-xland--ui-space-scalevalues 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.
Pixel rows at 2x, in a 1440x900 dark viewport:
npm run typecheck: clean.npm test: 14,463 of 14,468 pass, 1 skipped. The 4 failures are inhub-gguf-card-unified-budget.test.tsand fail identically onmain.Not covered
Not checked at non-default UI sizes beyond the formula scaling with
--ui-space-scale.