Skip to content

Studio: size the composer and model picker to the window and zoom - #18074

Merged
shimmyshimmer merged 5 commits into
mainfrom
studio-composer-picker-fit
Nov 17, 2026
Merged

shimmyshimmer merged 5 commits into
mainfrom
studio-composer-picker-fit

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

The chat composer and the composer model picker now size themselves to the window and to zoom, connected (cloud) models can be ejected from the composer picker again, and models with no logo get a letter tile.

Composer

  • An empty composer reserves two rows. It used to reserve one.
  • It grows to 10 rows before scrolling, and to fewer on short or zoomed windows, staying under about 30% of the window height (at least 3 rows). It used to grow to 12 rows (292px) everywhere, more than half of a 640px window.
  • In a thread it sits 16px above the window foot instead of 8px.
  • On a new chat in a window under 34rem tall, the composer moves to the foot instead of the vertical centre.
  • Width is unchanged.

Composer model picker

  • Width: 30vw, between 360px and 520px. It was a fixed 420px.
  • Height: at least 420px (380px on short landscape windows, judged by on-screen size so zoom does not change it). Above that it grows, up to 540px, only into the room under Select model. It was a fixed 420px. The existing list glide smooths tab changes.
  • Position: still opens 8px under Select model. When the room below is shorter than the floor, it stays at the floor and rides up over the composer by the shortfall, never past the window top. Opening upward, the same rule uses the room above.
  • Run settings opens at the floor, and its advanced view can still reach 640px.
  • Zoom: browser zoom and the desktop app's zoom change the CSS viewport. When the page is zoomed out, the caps grow by the zoom-out factor (browser: outerWidth / innerWidth; desktop: the webview zoom), so the picker keeps its on-screen size instead of shrinking. A large monitor at 100% stays capped.

On-screen picker size and position (Room = space under Select model):

Screen Room Before After
2560x1440 755 420x420 520x480 (Downloaded) / 520x540 (Discover), under the button
1920x1080 539 420x420 520x480 / 520x540, under the button
1512x982 (MacBook Pro 14) 481 420x420 454x480, under the button
1440x900 (MacBook Air) 431 420x420 432x432, under the button
1536x864 410 420x420 461x410, under the button
1366x768 352 420x420 410x380, rides up 20px
1280x640 275 420x420 384x380, rides up 97px
390x844 (phone) 401 358x420 358x420, rides up 11px
1512x982 at 50% zoom 535 210x210 454x420 / 454x535, under the button

Connected models can be ejected again

A connected model is never "loaded", so since the picker moved into the composer the chip's hover eject, the panel's Eject button and the row menu's Eject were all hidden for it. They now show for a connected model in use, and ejecting clears the selection (ejectModel already handled external ids). With two or more local models loaded, the panel's "Eject all" still unloads only the local models, as before.

Screenshots

Before is main's fixed 420x420 picker on its default tab; after shows the tab named in each caption.

1920x1080, Discover tab after: wider, and taller into the room under Select model.

1920x1080 before and after

MacBook Air (1440x900), Discover tab after: 431px of room, so it grows to 432px and stays under Select model.

MacBook Air before and after

1366x768, Discover tab after: 352px of room is under the 380px floor, so it rides up 20px.

1366x768 before and after

MacBook Pro 14 zoomed out to 50%, Discover tab after: the picker used to shrink to 210px on screen, now it keeps its size.

50% zoom before and after

Composer with a 40-line prompt on a MacBook Air, before (12 rows) and after (10 rows):

Long prompt before and after

A connected model in use, before (no Eject) and after (Eject on the chip and in the panel):

Connected model before
Connected model after

Letter tiles for models with no logo

A model with no maker logo (flint, Ornith, snac_24khz, a local folder) used to show no icon. It now gets the coloured letter tile that a connection without a logo already uses, drawn from the model's name.

  • The tile is 16px, a little over the 14px logo slot (with a negative margin so the row text does not move), because a solid disc reads smaller than the logos beside it.
  • The colour takes any hue from the name (FNV-1a plus murmur3's finalizer, so names sharing a suffix like -GGUF do not cluster) with four lightness steps that keep white text readable. Connections without a logo get the same colours.
  • The canvas redraws once fonts load and when it resizes, so a tile drawn before the UI font arrives or mid open-animation does not stay off centre.

Letter tiles in light and dark

Verification

  • npm run typecheck, npm test (16476 pass, 0 fail), npm run build.
  • New tests for composerMaxRows, pickerWidth, pickerZoomOut, pickerMinHeight, pickerRoomBelow, pickerDropOffset and the letter tile colours, plus source checks for the picker height and eject rules.
  • An isolated torch-free Studio was measured with Playwright at 8 common screen sizes and 4 zoom levels, with the merge-base bundle and then this branch.
  • Cloud eject was checked live with a local-only test connection (no key, closed port): on main there is no eject control and the pick stays; on this branch the hover eject and the Eject button both appear and clear the pick.

Not tested here

  • Real browser zoom: headless Chromium cannot zoom, so zoom levels were emulated by window size and a matching outerWidth.
  • The docked in-thread composer with a conversation, since this host cannot load a model. That change is the 8px to 16px bottom padding only.
  • Desktop (Tauri) builds.

The composer reserves two rows when empty, grows to 10 rows (fewer on short
or zoomed windows), sits 16px off the window foot in a thread, and drops to
the foot on a new chat in a window under 34rem tall.

The composer model picker tracks the window: 30vw between 360px and 520px
wide, and fits its rows between a 240px floor and 56dvh capped at 540px. Its
caps grow by the page's zoom-out factor so zooming out keeps its on-screen
size. It opens 8px under Select model and rides up over the composer only
when its rows do not fit below.

A connected model in use can be ejected from the composer picker again.
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
…room below

The picker is at least 420px tall (380px on short landscape windows, judged in on-screen px so zoom does not move it). It grows past that, up to 540px, only into the room under Select model, and rides up over the composer only when that room is shorter than the floor. Run settings opens at the floor again and its advanced view can reach 640px.

[skip ci]
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T06:19:47.562852Z 1647f5a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 6a7db731bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A model with no maker logo (flint, a local folder, snac) now shows the coloured letter tile a connection without a logo already gets, at 16px so the disc reads as large as the logos beside it. Tile colours take any hue from the name (FNV-1a with murmur3's finalizer, four lightness steps), and the tile redraws once fonts load and on resize so the letter stays centred. Also trims two picker comments.
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 17, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

…or default

The rule declaring --picker-floor sits in the utilities layer after Tailwind, so its default beat the [--picker-floor:available-height] utility on upward panels and capped them against the whole viewport. Use the default only as a var() fallback.

[skip ci]
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 1647f5aeea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

shimmyshimmer added a commit that referenced this pull request Nov 19, 2026
## Studio: keep the composer one row tall inside a conversation

#18074 raised the empty composer from one row to two (`COMPOSER_MIN_ROWS
= 2`, a 64px editor instead of 40px) so a new chat has room to start
typing. Inside a conversation that extra row only pushed the messages up
and made the docked composer read as a large empty box.

Now the empty editor reserves two rows only on the new chat screen
(`thread.isEmpty`) and one row once a conversation exists. Typing still
grows the box the same way, up to the window-based row limit from
#18074.

- `components/assistant-ui/thread.tsx`: the min editor height is `(16 +
24 * (threadEmpty ? COMPOSER_MIN_ROWS : 1)) * uiSpaceScale`.
- `tests/ui-font-size-scales-spacing.test.ts`: pins the one-row rule for
the main composer; Compare's shared composer keeps two rows.

### Verification

- `npm run typecheck` and `npm test` (16735 passed, 0 failed) on a
branch that included this change.
- In a local Studio with gemma-3-270m loaded: after one message, the
composer's editor measured 40px; on a new chat it measured 64px.

### Not covered

- Compare (`features/chat/shared-composer.tsx`) is unchanged and still
reserves two rows.
shimmyshimmer added a commit that referenced this pull request Nov 20, 2026
…ender fixes, settings tidy (#18576)

## Summary

A set of chat polish fixes: wallpaper conversations no longer show text
through or under the composer, the model picker keeps one height across
tabs again, wallpaper effects stop failing on transient errors, the
header matches the wallpaper shade without glass, and a few settings and
composer sizes are tidied.

## Wallpaper: thread fades out behind the composer

With a chat wallpaper, the conversation scrolled behind the composer and
kept showing through it and in the gap below it, because the wallpaper
hides the solid bottom fade that normally covers that area. The thread
now runs to the composer's top edge and fades out within the 10px
beneath it (scaled with interface scale), so no text shows through the
composer body or below it.

- `ThreadComposerDock` measures the composer surface against the bottom
of the thread viewport and publishes `--thread-composer-clip` and
`--thread-composer-fade` on the thread root (cleared when the thread is
empty or the dock unmounts).
- The wallpaper mask on `.aui-thread-viewport` gains a steep fade
starting at that height.

Without a wallpaper nothing changes: only the wallpaper rules read these
variables.

## Wallpaper: header shade without glass

The wallpaper wash now sits on the thread root for every material (it
already did for Glass), so the header strip has the same shade as the
conversation instead of the brighter raw wallpaper. The extra header
darkening (`.chat-wallpaper::after`) is dropped for conversations
without glass. Glass, the new chat view and page routes keep their
current look.

## Wallpaper: "Could not render the effect"

The message, with blank previews, came from steps that fail for reasons
unrelated to the image:

- `HTMLImageElement.decode()` may reject while the image still loads
(the HTML spec allows it), and every wallpaper load awaited it directly.
Images now load through `loadImage`, which only fails when the image
itself fails to load.
- A tab still running the previous build asks for an effect worker file
the new build no longer has (404), so every effect failed until reload.
A worker that cannot start now falls back to the same transform on the
main thread.
- A later successful render clears a stale effect error instead of
leaving it up until the next setting change.

Both failure modes were reproduced by fault injection (a 404 for the
worker asset, and `decode()` rejecting every other call): before, the
error showed for Dither, Halftone and ASCII; after, no error and the
effect paints. Without injection I could not reproduce the error in
Chromium or WebKit.

## Model picker height

Since #18074 the open picker grew from 420px up to 540px with the number
of rows in the current tab, so it changed size when switching tabs. Its
height now comes from the window only, so every tab has the same height:
400px on short landscape windows, 420px up to a 1080px-tall window,
rising to 540px at 1380px and taller. It is measured in on-screen
pixels, so zoom does not change it, and it is still capped to the
window. The growth into the room under Select model
(`--composer-picker-max-h`, `--picker-room`) is removed; Run settings
keeps its own height.

Measured on every tab: 1440x900 = 400, 1920x1080 = 420, 2560x1230 = 480,
2560x1440 = 540.

## Settings and composer sizes

- **Customization section:** Settings > Chat gets a Customization
section under Composer, holding Chat width, Composer position, Composer
outline and Monochrome model icons (moved from Model selection).
Composer keeps Send shortcut, Follow-up behavior, Share drafts and Plain
text composer, and gains Scroll while generating and Speed and context
stats from Chat defaults. The title is added to every locale.
- **Chat defaults:** Condense long pastes, Context window usage, Sent
attachments and Rich text paste (last) move there from Composer.
- **Composer position:** the new chat default is 45 (was 40). Saved
preferences keep their value.
- **New chat composer:** 8px shorter on the new chat page only (118px at
100% scale), all from the gap between the text and the bottom row. An
empty saved chat or the floating chat keeps 126px.
- **Compare composer:** reserves one row, like a conversation's
composer, instead of two (102px at 100% scale).
- **Compare cursor:** the Compare textarea carries `role="combobox"`,
which the global pointer-cursor rule turned into a hand. Text fields
with that role now keep the text cursor; button comboboxes keep the
pointer.

## Verification

- `npm run typecheck`, `npm run build`, `npm test` (16826 pass).
- Isolated Studio on CPU driven with Playwright: wallpaper conversation
screenshots (text fades just under the composer edge, none inside it, no
wash seam), header strip before/after with glass off, picker height on
every tab at four window sizes, settings sections, new chat and Compare
composer heights, and the effect error under fault injection.

Not checked here: Glass materials and the Desktop shell on macOS /
Windows / Linux, and GPU-only flows.

---------

Co-authored-by: Unsloth <[email protected]>
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