Repository navigation
fix(desktop): responsive composer, model-picker viewport fit, provider model search - #101
Merged
Merged
Conversation
…r model search Three user-visible UI defects, fixed at their root causes: 1. Composer turned to soup at narrow widths (DevTools docked, split screen): .composer-row was a single-line flex of fixed-size items and the model pill had no truncation, so long model ids wrapped inside the fixed-height pill and controls spilled out of the card. The row now wraps; the trailing model/mic/voice/send cluster is one right-aligned .composer-actions unit that wraps as a whole; long model ids ellipsize (full id on the pill tooltip). 2. Model+effort mega-menu opened clipped past the viewport top: useMenuFit measured once at open, but the picker's provider list loads async and the bottom-anchored panel then grows UPWARD with no re-measure. The hook now re-clamps on panel size changes (ResizeObserver), and a panel taller than the viewport is capped to it and scrolls internally (author max-heights tighter than the viewport stay untouched). .mp-pop also loses its rigid 520px min-width (width: min(520px, 100vw - 16px), flexible columns). 3. Models & keys drowned in chips after "Load models" (hundreds of ids, no search): big catalogs now get a per-provider search box (filters the FULL catalog, case-insensitive, with a match counter) and a 24-chip cap behind "Show all N models" / "Show fewer". Every chip feature (pick, eye, remove, custom add) keeps operating on the full catalog. Sweep fixes from the same review: .settings-overlay and .palette-overlay sat on z-index auto, so open in-page menus (z 40-45) could paint over them — both now sit on the modal tier (60). Tests: ResizeObserver growth + viewport-cap cases in useMenuFit.test; search/ cap/expander cases in ProvidersPage.test; new ModelPicker.test (async load, select/effort/thinking/close paths); new Composer.test (pill truncation contract, actions grouping); new styles.contract.test pinning the load-bearing CSS rules (jsdom computes no layout, so the stylesheet contract is asserted as text). Desktop suite: 357 tests green; typecheck + build green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes the three reported frontend issues at their root causes, plus a stacking sweep from the same review.
1 — Composer breaks when DevTools narrows the window
Root cause:
.composer-rowwas a single-line flex of fixed-size items, and the model pill had no truncation — a long model id (gemini-3.1-pro-preview) wrapped inside the fixed 32px pill and the controls spilled out of the card.Fix: the row wraps (
flex-wrap); the trailing model/mic/voice/send cluster is one right-aligned.composer-actionsunit that wraps as a whole; long ids ellipsize via amin-width:0chain with the full id on the pill tooltip.Verified live at 770px: no overflow, row wraps to two tidy lines, a 45-char id keeps the pill at 32px with an ellipsis.
2 — Models & keys unusable after "Load models" (hundreds of chips, no search)
Root cause:
ProvidersPagerendered the entire catalog unconditionally.Fix: catalogs ≥ 10 models get a per-provider search box (filters the full catalog, case-insensitive, live match counter); ≥ 24 models are capped behind "Show all N models" / "Show fewer". Every existing feature (click-to-use, eye visibility toggle, remove, custom add, Load models, Test, key entry) is untouched and keeps operating on the full catalog.
Verified live against the real backend: Google Gemini (48 loaded models) → 24 chips + search + "Show all 48 models"; NVIDIA NIM (122) same; searching "flash-image" → "3 of 48 match"; small providers keep the plain row.
3 — Model mega-menu opens clipped past the top of the window
Root cause:
useMenuFitmeasured once at open, but the picker's provider list loads async — the bottom-anchored panel then grows upward past the viewport top with no re-measure. (The 50vh CSS cap and the one-shot clamp landed in #21/#74; this was the remaining gap.)Fix: the hook re-clamps on panel size changes (
ResizeObserver) — which hardens every menu in the app, since they all route through it — and a panel taller than the viewport is capped to it and scrolls internally (author max-heights tighter than the viewport are respected)..mp-popalso drops its rigidmin-width: 520pxforwidth: min(520px, calc(100vw - 16px))with flexible columns, so it can't out-width a narrow window.Verified live: opened the picker, watched it grow 1 → 7 rows when the fetch landed, panel stayed fully on-screen with the models column scrolling internally.
4 — Comprehensive sweep + regression tests
.settings-overlayand.palette-overlayhad no z-index, so open in-page menus (z 40–45) could paint over the Settings modal / command palette — both now sit on the modal tier (60). Audited the full z scale (10/20/30/40–45/60/70/80/200) — no other inversions.useMenuFit, so the ResizeObserver fix covers the add-menu, flyouts, retry menu, mic picker, conv/project menus, etc.useMenuFit.test— growth-after-open re-clamp, taller-than-viewport cap, observer teardownProvidersPage.test— cap + expander, full-catalog search past the cap, counter, empty state, actions from a filtered view, small-catalog no-chromeModelPicker.test— async load row set, select/effort/thinking/more/close pathsComposer.test— pill truncation contract (short label + full-id tooltip), actions groupingstyles.contract.test— pins the load-bearing CSS rules as text (jsdom computes no layout), with a tiny brace-aware extractor that handles@medianestingnpm run typecheck✓ ·npm run test357/357 ✓ ·npm run build✓ (backend/shell untouched)🤖 Generated with Claude Code