fix(gui): remove awkward inner scroll on onboarding API-key card#12802
Merged
Conversation
In the empty chat state, `main` is a fixed-height (100vh) flex scroll container. Its children (the StepsDiv banner area and the input/onboarding section) were allowed to flex-shrink, and StepsDiv's always-on `overflow-y-scroll` turned into a cramped nested scrollbox. This trapped the onboarding API-key card in a small inner scroll area instead of letting it lay out naturally. Only enable StepsDiv's overflow scroll when there is chat history (when it is `flex-1`), and mark both the empty-state StepsDiv and the input section `shrink-0` so the onboarding card keeps its natural height and the panel scrolls as one. Chat layout (history present) is unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
When the Continue side panel first opens with no models configured, the API-key onboarding card is trapped in an awkward, cramped inner scroll area with its own scrollbar instead of laying out naturally in the panel.
Root cause
In the empty chat state (
gui/src/pages/gui/Chat.tsx):main(ingui/src/pages/gui/index.tsx) is a fixed-height (100vh, viaLayout'sGridDiv)flex flex-col overflow-y-autoscroll container.StepsDiv(holding the deprecation banner) and therelativesection (main input + onboarding card) — were left with the defaultflex-shrink: 1.StepsDivalso had an always-onoverflow-y-scroll.So once the banner + input + onboarding card exceeded the panel height, the flex children were squeezed and
StepsDiv'soverflow-y-scrollbecame a nested, cramped scrollbox — confining the onboarding card to a small inner scroll area.Fix
gui/src/pages/gui/Chat.tsx(2 lines):overflow-y-scrolltoStepsDivonly when there is chat history (i.e. when it isflex-1); in the empty state make itshrink-0.relativesectionshrink-0.This keeps the onboarding card at its natural height and lets the whole panel scroll as one (normal panel scroll), with no cramped inner box. The chat layout (history present) is unchanged:
StepsDivis stillflex-1 overflow-y-scrolland the input is still pinned at the bottom.Before / after
Verification
cd gui && NODE_OPTIONS="--max-old-space-size=4096" npm run build→ exits 0 (tsc + vite).eslinton the changed file → clean.vitest run src/pages/gui/chat-tests/Chat.test.tsx→ 3/3 pass.Made with Cursor