fix: prevent Enter/send button from being pushed off-screen by long code blocks (#12958)#12961
Open
AmariahAK wants to merge 1 commit into
Open
fix: prevent Enter/send button from being pushed off-screen by long code blocks (#12958)#12961AmariahAK wants to merge 1 commit into
AmariahAK wants to merge 1 commit into
Conversation
…ode blocks (continuedev#12958) Long code blocks without line breaks were causing the chat sidebar to stretch horizontally, pushing the Enter/send button out of view. Two issues combined: 1. pre elements used max-width: calc(100vw - 24px) which in a VS Code webview sidebar can be the full VS Code window width (~1900px), not the actual sidebar width (~400px), allowing code blocks to grow far beyond the panel. 2. The scrollable StepsDiv flex container lacked min-w-0, so CSS flexbox default min-width: auto prevented it from shrinking below oversized content, pushing the fixed input area off-screen. Fixes: - Chat.tsx: added min-w-0 to StepsDiv (flex-1 container) - StyledMarkdownPreview/index.tsx: changed pre max-width from calc(100vw - 24px) to 100%, and overflow-x from scroll to auto - SyntaxHighlightedPre.tsx: added max-width: 100% to StyledPre - StepContainer.tsx: added min-w-0 to message wrapper div Unlike the temporary CSS hotfix (continuedev#12910) which applies min-width: 0 to all flex elements globally and word-break: break-all to all pre/code (making code unreadable), this fix is targeted at only the specific elements in the overflow chain. Closes continuedev#12958 Closes continuedev#12912 Co-authored-by: atlarix-agent <agent@atlarix.dev>
Contributor
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
Description
When AI responses contain long code blocks without line breaks, the chat sidebar stretches horizontally, pushing the Enter/send button out of view. This fix addresses the root cause in two places:
Root causes:
StyledMarkdownPreview/index.tsx:<pre>elements usedmax-width: calc(100vw - 24px). In a VS Code webview sidebar,100vwcan be the full VS Code window width, not the actual sidebar width, allowing code blocks to grow far beyond the panel.Chat.tsxStepsDiv: The scrollable history container (flex-1) lackedmin-w-0. CSS flexbox defaults tomin-width: autofor flex children, preventing the container from shrinking below oversized content, shoving the input area + Enter button off-screen.Changes (4 files, targeted and surgical):
gui/src/pages/gui/Chat.tsx— addedmin-w-0toStepsDivso the flex container clips overflow instead of growinggui/src/components/StyledMarkdownPreview/index.tsx— changedpremax-widthfromcalc(100vw - 24px)to100%, andoverflow-xfromscrolltoautogui/src/components/StyledMarkdownPreview/SyntaxHighlightedPre.tsx— addedmax-width: 100%toStyledPregui/src/components/StepContainer/StepContainer.tsx— addedmin-w-0to the message wrapper divUnlike the temporary CSS hotfix in Sidebar buttons pushed off-screen due to Flexbox overflow #12910 — which applies
min-width: 0to all flex elements globally andword-break: break-allto all<pre>/<code>elements (making code unreadable) — this fix is targeted at only the specific elements in the overflow chain. No wildcards, no!important, no code readability sacrifice.Closes Enter / send message button goes out of the screen over time #12958
Closes Continue chat pane sizing error #12912
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
N/A — this is a CSS/layout fix with no visual changes to the UI; it prevents the layout from breaking. To verify, test with a prompt that generates a long code block (e.g., "Write a Python script with a 500+ character string on one line") and confirm the Enter button remains visible.
Tests
No new tests added — this is a CSS flexbox layout fix targeting four specific elements. The existing test suites pass (lint-staged + Prettier verified on commit). Manual verification procedure: