fix(app): make model picker height adaptive to model count - #718
Conversation
Pin h-[400px] -> max-h-[400px] so the popover hugs the natural content height and only scrolls when models exceed the 400px cap. Add an E2E spec that locks the geometry invariant (no empty band between the last visible model and the Thinking row) and captures a screenshot artifact for visual review.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Suggested priority: P2 (includes user-path files (packages/app/src/components/prompt-input/model-picker.tsx)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
There was a problem hiding this comment.
Code Review
This pull request updates the model picker's styling to use a maximum height instead of a fixed height, ensuring the container fits its content without leaving empty space. A new E2E test was added to validate this behavior. The review feedback suggests improving the robustness of the E2E test by using a more specific selector to avoid ambiguity and potential fragility.
Perf delta summaryComparator: pass
|
The variant (Thinking) sub-popover also renders [data-picker-content]. .first() works today because the variant content only mounts when its trigger is expanded, but scoping by [data-slot="list-scroll"] keeps the locator unambiguous if future test changes interact with the variant popover.
The previous spec wrapped the no-empty-band assertion in 'if (!listOverflowing)', which silently skipped the regression check if a future fixture rendered enough models to overflow the 400px cap. Promote the short-list expectation to a precondition assertion so the spec fails loudly when the fixture grows, prompting maintainers to restore a short-list scenario or add a separate overflow spec.
|
Thanks for the audit. Addressed the two P3 items:
|
Promote the regression to the PR smoke gate. The bug is real (user- reported visible UI break) and the cost is minimal: ~4s per PR plus a one-time alphabetical-order entry in the opencode smoke inventory. Catching a regression at PR time keeps the bug from sneaking through to a release cut before nightly E2E runs.
|
Reversing my earlier call on P3-2. After a second pass through the three-question check:
Tagged |
…r-height # Conflicts: # packages/opencode/test/config/e2e-smoke-tagging.test.ts
Summary
Switch the model selector popover from a fixed
h-[400px]tomax-h-[400px]so it hugs its natural content height and only scrolls when models exceed the 400px cap. Add an E2E spec that locks the geometry invariant.Why
When a user only has a handful of visible models (e.g. the OpenCode Zen free tier with four entries), the popover was still forced to 400px tall, leaving a ~190px empty band between the last model row and the Thinking row at the bottom. The popover should adapt to model count.
Root cause:
packages/app/src/components/prompt-input/model-picker.tsx:218set a fixed height on theKobalte.Content. The innerModelListusesflex-1 min-h-0, so it expanded to fill the fixed 400px and produced a visible empty band above the Thinking row.Related Issue
Closes #719.
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
Kobalte.Content. Theflex-1 min-h-0chain onModelList->list-scrollstill works undermax-hbecause the chain stays unbroken when the cap kicks in; when content fits, the column shrinks to content height instead.[data-slot="list-item"]and[data-action="prompt-model-thinking-trigger"], and finally thatpopover.height <= 400. If a future fixture grows large enough to overflow the cap, the precondition fails loudly rather than silently skipping the regression check.@smokeso the regression is enforced by the PRe2e-artifactsgate. The smoke inventory inpackages/opencode/test/config/e2e-smoke-tagging.test.tsis updated in lockstep (alphabetical order).Risk Notes
None. The fix is a single CSS class swap with no behavioral side effects. The new spec runs in the existing Playwright project, no infra changes.
How To Verify
Smoke inventory contract:
bun --cwd packages/opencode test test/config/e2e-smoke-tagging.test.ts-> 2 pass.Screenshots or Recordings
E2E captures a screenshot artifact at
e2e/test-results/.../model-picker.pngon every run. With the fix applied the popover ends right under the four visible models and the Thinking row, with no empty band. Local screenshot reviewed and confirmed visually before opening this PR.Checklist
bug,enhancement,task, ordocumentation), at least one primary routing label (app,ui,platform,harness, orci), and exactly one priority label (P0toP3), or I requested maintainer labelingdev, and my PR title and commit messages use Conventional Commits in English