Skip to content

Model picker: collapse on load, logo-only row icons, steadier first open - #17839

Merged
shimmyshimmer merged 6 commits into
mainfrom
studio-picker-load-collapse
Nov 16, 2026
Merged

shimmyshimmer merged 6 commits into
mainfrom
studio-picker-load-collapse

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

What changed

  • Collapsed on load. Loading a model collapses the model picker; ejecting expands it again. If you expand or collapse it while a model is loaded, that choice holds for the rest of that load (including after a refresh). Ejecting clears it, so the next load, even of the same model, starts collapsed.
  • No placeholder icons. Rows for models without a logo of their own no longer show a generic icon. On the composer chip, such a model still ejects on hover: the eject icon slides in only while hovered, so the chip is no wider at rest.
  • Shorter picker. Height goes from 460px to 420px.
  • Pinned run settings header. In a model's run settings, the "Run settings" label scrolls away while the Back button and model name stay pinned at the top, fading into the rows below once they stick (the same pattern as the Library header). At the top, Back stays centred on both lines as before; once the row sticks it slides level with the title. Nothing resizes, so there is no jump.
  • Tab underline. The underline sits 2px closer to the tab labels.
  • First-open jump fixed. After a refresh, the first time you opened the picker the composer jumped for a frame. The loaded model's logo arrived late, which wrapped the pill row before it compacted again. The logo now resolves from the cached model path at load, and the pill-fit measurement also watches the model chip.
  • Logo after refresh. The same fix stops a model's logo from sometimes disappearing after a refresh.

Verification

  • npm run typecheck, npm test, npm run i18n:check:strict, npm run build.
  • New tests cover the per-load expand memory and the no-logo rows.
  • Checked in a local build: load, expand, close, reopen; eject and reload; refresh with a model loaded; hover-eject on a model loaded from a plain local path (no logo), with the pill row staying out of its compact layout.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 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-16T03:13:53.486633Z 4fff8f1 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff8c1668a7

ℹ️ 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".

Comment on lines +5316 to +5318
.composer-run-settings [data-config-header-row] {
position: sticky;
top: calc(var(--run-settings-stick-at) - var(--run-settings-pad-y));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the sticky row within a full-height containing block

When scrolling a model's run settings, the Back/title row cannot remain pinned because its containing block is the small [data-config-header] wrapper, which contains only the eyebrow and the row itself. Sticky positioning is constrained by that wrapper's bottom edge, so the row scrolls out of view along with the header instead of staying accessible while the settings scroll. Move the sticky row into the container that also spans the settings content, or restructure the header so its containing block extends through that content.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f0fee0e: the Back + title row is now a direct child of the page column instead of a small wrapper, so it stays pinned through the settings.

: Number.POSITIVE_INFINITY;
const stuck =
el.scrollTop > 0 &&
offset <= Number.parseFloat(getComputedStyle(el).getPropertyValue("--run-settings-stick-at")) + 0.5;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve the sticky threshold before parsing it as a number

When the run settings scroll, getComputedStyle(el).getPropertyValue("--run-settings-stick-at") returns the custom property's calc(8px * …) expression, not an evaluated pixel length. Number.parseFloat therefore returns NaN, making stuck always false. Consequently, data-header-stuck is never set and the new covering strip and fade never appear. Read an evaluated length from a regular computed CSS property or otherwise resolve the expression before comparing it with the measured offset.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f0fee0e: stuck is now measured from the row's gap to the eyebrow above it (the Library header's check), so no custom property is parsed.

@danielhanchen

Copy link
Copy Markdown
Member

Chat UI, API, Update and GGUF inference fails on this branch at the model picker step of tests/studio/playwright_chat_ui.py (around line 1410):

[ui] model selector button text: 'Select model'
[ui] STEP model picker: open + drive search bar
AssertionError: [ui] FAIL: model picker search input not found

After clicking [data-tour="chat-model-selector"], the driver waits 10s for an input whose placeholder matches /Search.*models?/i and none appears. The button also still reads Select model right after /api/inference/load succeeded and the page reloaded. So either the picker no longer opens on that click, or the search field is renamed or hidden behind the new collapsed state. If the placeholder changed on purpose, updating the regex in that step keeps the gate meaningful.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 592b4b1f07

ℹ️ 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".

Comment on lines +2757 to +2759
if (modelLoading) {
sawLoad.current = true;
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Distinguish a fresh load from a cancelled unload

If a user expands the picker, clicks Eject while chats are running, and cancels the confirmation, their expansion choice is reset and persisted as collapsed even though the same model remains loaded. ejectModel in use-chat-model-runtime.ts calls beginModelLoading("unloading") before confirmation, and the runtime store sets modelLoading for unloading too. This effect therefore treats cancellation (or a failed unload) as a fresh load and discards the saved choice. Track successful loads separately rather than interpreting every modelLoading cycle as a new residency.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 4fff8f1: only a loading cycle that carries a load pick (set by the load paths, never by an unload) counts as a fresh load, so a cancelled or failed eject keeps the saved choice.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 4fff8f133a

ℹ️ 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
shimmyshimmer merged commit b336ce2 into main Nov 16, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-picker-load-collapse branch November 16, 2026 04:10
shimmyshimmer added a commit that referenced this pull request Nov 16, 2026
… PRs (#17900)

## What changed

Comment-only cleanup for the recently merged Studio UI PRs (#17839,
#17840, #17841, #17842, #17846). Restating comments are deleted and
multi-line explanations are cut to one line; comments that record an
invariant or a non-obvious reason stay (for example, why the sticky run
settings row must not be wrapped, and why `modelLoading` alone cannot
mark a fresh load).

- 14 files, 25 lines added, 60 removed.
- No code changes: every changed line is a comment line (checked line by
line over the diff).

## Verification

- `npm run typecheck`, `npm run build`, `npm run i18n:check:strict`.
- `npm test`: passes except two failures that also fail on `main`
without this change:
- `every settings tab sits in exactly one rail group`: the
`computer-use` tab added in #17666 is not in a sidebar group; fixed in
#17901.
- the KaTeX stylesheet import test, which fails only in this local setup
(shared `node_modules` outside the project root).
danielhanchen added a commit that referenced this pull request Nov 16, 2026
…ed Context field (#17902)

## Summary

Two intended Studio UI changes merged without their Playwright drivers
and contract tests being updated, so these gates are red on main and on
every PR:

1. **#17839 collapses the model picker on load.** With a model loaded,
opening the picker shows only that model's row (aria-label `<model>:
show all models`); the source tabs, the search field and the rows render
only after that row is clicked.
- `Chat UI` / `Chat UI, API, Update and GGUF inference`
(`playwright_chat_ui.py`): `model picker search input not found` (seen
on #17839, #17900 and the staging run of #17899).
- On the Windows lane the chat driver instead found an attached but
hidden `Search ... models` field and timed out after 60 s in
`Locator.fill` (staging run of #17899).
- Model config gate (`playwright_model_config.py`): `picker shows no
rows at all, so the hidden-model check below proves nothing`, then
`could not open run-settings`.
2. **#17840 renames the run settings "Context Length" field to
"Context".**
- `Repo tests (CPU, studio)`:
`test_model_picker_contracts.py::test_an_mlx_target_is_offered_a_context_length_not_a_sequence_length`
and `::test_run_settings_page_keeps_its_identifying_controls` still
assert the old label.
- Model config gate: `Context Length input has no numeric default`.
`playwright_memory_estimate.py` finds the field the same way.

Both product changes are deliberate, so the fix is on the test side. No
product code changes.

## Change

- `tests/studio/_playwright_robust.py`: new
`expand_collapsed_model_picker(scope)` waits for either the expanded
picker (the `Model sources` tablist) or the collapsed row, and clicks
the row only when the picker opened collapsed. It is a no-op on an
already expanded picker, and it only counts controls that are on screen,
so a hidden mounted copy is neither clicked nor taken as proof that the
picker expanded. The collapsed row suffix, the tablist selector and the
run settings context field name (`RUN_SETTINGS_CONTEXT_LABEL =
"Context"`) live here once.
- `playwright_chat_ui.py`: the search step expands the picker before
waiting for the search field, and waits for a visible one. The rest of
the step (two queries must show different picker text) is unchanged.
- `playwright_model_config.py`, `playwright_memory_estimate.py`:
`open_picker()` expands after clicking the trigger; `context_input()`
looks the field up by `RUN_SETTINGS_CONTEXT_LABEL` with an exact match,
since `Context` is a prefix of other run settings names.
- `test_model_picker_contracts.py`: the two run settings assertions read
`Context`.
- New `tests/studio/test_chat_ui_picker_collapsed_row.py` (CPU) pins the
coupling between the drivers and the frontend:
- the collapsed row suffix and the `Model sources` tablist are still
what `composer-model-picker.tsx` renders,
- a settled load still collapses the picker (so the expand click is not
dead code),
- all three drivers use the helper, the chat search step expands before
it waits, and `open_picker()` expands after the trigger click,
- `model-config-page.tsx` still names the context field
`RUN_SETTINGS_CONTEXT_LABEL`, and both drivers look it up by that name.

## Testing

- New test plus `test_model_picker_contracts.py`: 213 passed.
- Sabotage: with the three drivers reverted to main, 4 of the new checks
fail; without the on-screen filter in the helper, 1 fails; with the
field renamed back to `Context Length`, 2 fail.
- Every test that reads these drivers or `_playwright_robust.py` (17
files): 345 passed. `tests/studio/test_*.py` on CPU: the only failures
are 5 host-specific tests (AMD DRM detection, credential homes, version
compat sweep) that do not touch these files.
- The helper against a scripted page in real Chromium (Playwright 1.64):
a collapsed picker with hidden copies of the tablist and search is
expanded and its visible search filled; an expanded picker and a page
with neither are left alone; the old attached-only lookup on the
collapsed page times out in `fill()`, as on the Windows lane.
- The Chat UI and model config Playwright jobs on this PR exercise the
drivers end to end.
danielhanchen added a commit that referenced this pull request Nov 16, 2026
…d model (Windows race) (#17944)

## Summary

The Windows `Chat UI Tests` lane still fails intermittently at the model
picker step after #17902 (seen on the staging run of #17927, whose base
includes #17902):

```
playwright_chat_ui.py, line 1470: search.fill("")
TimeoutError: Locator.fill: Timeout 60000ms exceeded.
  waiting for get_by_placeholder(re.compile(r"Search.*models?", re.IGNORECASE)).visible.first
```

The job's screenshots show the race:

- `03c-model-picker-open`: the selector still reads `Select model` and
the picker is open and expanded, showing `Search on device models` and
`Loading models`. After the reload the frontend has not yet learned
which model is resident, so the picker opens expanded (`isExpanded =
expanded || !chosenName`) and the driver finds and fills the search.
- `03d-model-picker-search-qwen`: a moment later the residency check
lands, the chip reads `gemma-3-270m-it-GGUF`, and the picker collapses
to the loaded model's row (#17839's collapse on load). The search field
is gone, so the next `fill()` waits 60 s for it.

On Linux the residency check usually lands before the click, so the
picker opens collapsed and #17902's expand handles it; the slower
Windows runner opens it first.

The collapse itself is intended, and a person opening the picker in that
first moment after a reload is a narrow case, so this changes the
driver, not the product.

## Change

- `tests/studio/playwright_chat_ui.py`: before opening the picker, wait
(up to 30 s, polling the page) until the model selector no longer reads
`Select model`, i.e. the frontend knows the model loaded above. If it
never does, the step logs a warning and goes on as before, so the step
still reports the real failure.
- `tests/studio/test_chat_ui_picker_collapsed_row.py`: the search step
must wait for the selector to name the model before it clicks it.

## Testing

- `test_chat_ui_picker_collapsed_row.py` and every test that reads
`playwright_chat_ui.py`: 78 passed. With the driver reverted to main,
the new check fails.
- The wait against a scripted page in Chromium (Playwright 1.64): a
selector that switches from `Select model` to the model name after 1.5 s
settles after 1.6 s; one that never switches times out with a readable
message, which the step logs as a warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants