The width of the model selector is too wide I don’t like how image goes to the…

merged…
osebo31d ago

The width of the model selector is too wide I don’t like how image goes to the second line

IMG_8712.jpeg
IMG_8712.jpeg
3 repliesoldestnewest
Osebotfable-5-131d ago

Cause: the model <select> in the run chip is sized by the browser to its widest option, "default (fable 5.1)", even when the shown value is "fable 5.1". On a 390px phone that makes [Ask Osebot | model] ~300px wide, and since .compose-tools wraps, the image chip drops to a second line.

Plan:

  1. Size the model select to its selected label: the .model-select wrapper gets a data-label with the current option text, a hidden ::before sizer draws that width, and the select lies over it. "fable 5.1" selected → ~105px instead of ~175px.
  2. Stop the tools row from wrapping: .compose-tools becomes nowrap, the run chip may shrink and the model label ellipsizes before the image chip is pushed down.
  3. Same fix in both composers (home thread-composer.tsx and the reply composer.tsx); mockup screenshots at 390px before/after.
Osebotfable-5-131d agothreadide@3f5bc82

Fixed on thread/bb170c16 (3f5bc82).

Why it was wide. A native <select> is laid out as wide as its widest option. The run chip's list contains "default (fable 5.1)", so the picker stayed ~175px even while it showed "fable 5.1". On a 390px phone [Ask Osebot | model] came to ~300px, and because the tools row wrapped, the Image chip dropped to its own line (your screenshot).

What changed

  • components/model-select.tsx (new): one ModelSelect used by both the reply composer and the home thread composer (they had two copies of the same select). The wrapper carries data-label = the selected option's text.
  • app/globals.css: .run-chip .model-select::before draws that label invisibly at the select's padding and the select sits over it (position:absolute; width:100%), so the control is exactly as wide as its value: "fable 5.1" → ~105px instead of ~175px.
  • .compose-tools no longer wraps; the chip has min-width:0 so on a very tight row the model label ellipsizes before the image chip is pushed down.

Result (screenshot attached): at 390px the row reads [Ask Osebot | fable 5.1] [img] with Post & run under it. With the long "default (fable 5.1)" label still selected it fits by ellipsizing to "default (fabl…"; on a 320px phone that worst case shows "de…". Any explicit model pick fits everywhere.

Verified with tsc and a static mockup of the real markup + globals.css (before pane reproduces your screenshot). Not checked on iOS Safari (no WebKit here), but the select keeps its old 40px box and 14px font, so text placement shouldn't move.

390px, dark: before (left) reproduces the screenshot; after (right) keeps the image chip on the row, with "fable 5.1" and the long default label
390px, dark: before (left) reproduces the screenshot; after (right) keeps the image chip on the row, with "fable 5.1" and the long default label
Osebot31d ago

Merged threadide #142 by @osebo (merge, fc029ff).