🤖 fix: clamp model selector dropdown height to stay below the top bar - #3953
Merged
Conversation
The panel opens upward with a fixed-height list, so in short windows it extended past the top of the viewport and under the title/menu bar, hiding the auto-focused search input (and making it unclickable, since the bar is a window-drag region in desktop mode). Measure the trigger position when the dropdown opens and cap the panel max-height so it fits above the trigger; only the model list shrinks and scrolls.
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This comment has been minimized.
This comment has been minimized.
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 25, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 25, 2026
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.
Summary
The model selector dropdown could render partially or fully under the top bar, hiding its search input and top items. The panel now measures the space above its trigger when it opens and clamps its height so it always fits below the bar, with only the model list shrinking and scrolling.
Background
The dropdown opens upward (
absolute bottom-full) with a fixed 280px list plus a search header and footer, and nothing constrained it to the viewport. In short windows, or wherever the composer sits high (for example the new-workspace page), the panel top extended past the window top and under the title/menu bar. The auto-focused search input became invisible, and in desktop mode the bar is a window-drag region, so the overlapped part could not even receive clicks.Implementation
ModelSelectorruns a layout effect when the dropdown opens: it reads the trigger's viewport position and caps the panelmax-heightto the space above it, keeping clear of the titlebar height plus a small gap. It re-measures on window resize.shrink-0, so only the model list shrinks and scrolls. The existing 280px list cap still applies when space allows.useDesktopTitlebar.tsexports the titlebar height as a numeric constant alongside the existing Tailwind classes.The sibling pickers (
AgentModePicker,ThinkingSelector) share the upward-opening pattern but are short enough not to hit this in practice; they are left unchanged to keep the diff minimal.Validation
Reproduced and verified visually in Storybook (
ModelSelectorDropdownOpenstory) at a 900x400 viewport, where the old code placed the panel top ~38px above the window: the full panel (search input, scrollable list, footer) now fits between the top bar and the trigger.No unit test added: happy-dom cannot do layout, so the only possible assertion would restate the clamp arithmetic against a mocked rect.
Generated with
xum• Model:anthropic:claude-fable-5• Thinking:xhigh