fix: prevent chat input and message overflow with long unbroken strings
Add min-w-0 to chat input flex container and textarea to prevent field-sizing-content from expanding the layout. Replace break-words with break-all on user message bubbles to force wrapping at any character for strings without spaces.
This commit is contained in:
parent
e38c64c70c
commit
afc34632f7
2 changed files with 4 additions and 4 deletions
|
|
@ -230,7 +230,7 @@ export default function NotebookPage() {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Chat Column - always expanded, takes remaining space */}
|
{/* Chat Column - always expanded, takes remaining space */}
|
||||||
<div className="transition-all duration-150 flex-1 lg:pr-6 lg:-mr-6">
|
<div className="transition-all duration-150 flex-1 min-w-0 lg:pr-6 lg:-mr-6">
|
||||||
<ChatColumn
|
<ChatColumn
|
||||||
notebookId={notebookId}
|
notebookId={notebookId}
|
||||||
contextSelections={contextSelections}
|
contextSelections={contextSelections}
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ export function ChatPanel({
|
||||||
onReferenceClick={handleReferenceClick}
|
onReferenceClick={handleReferenceClick}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<p className="text-sm break-words overflow-wrap-anywhere">{message.content}</p>
|
<p className="text-sm break-all">{message.content}</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{message.type === 'ai' && (
|
{message.type === 'ai' && (
|
||||||
|
|
@ -290,7 +290,7 @@ export function ChatPanel({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="flex gap-2 items-end">
|
<div className="flex gap-2 items-end min-w-0">
|
||||||
<Textarea
|
<Textarea
|
||||||
id={chatInputId}
|
id={chatInputId}
|
||||||
name="chat-message"
|
name="chat-message"
|
||||||
|
|
@ -300,7 +300,7 @@ export function ChatPanel({
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
placeholder={`${t.chat.sendPlaceholder} (${t.chat.pressToSend.replace('{key}', keyHint)})`}
|
placeholder={`${t.chat.sendPlaceholder} (${t.chat.pressToSend.replace('{key}', keyHint)})`}
|
||||||
disabled={isStreaming}
|
disabled={isStreaming}
|
||||||
className="flex-1 min-h-[40px] max-h-[100px] resize-none py-2 px-3"
|
className="flex-1 min-h-[40px] max-h-[100px] resize-none py-2 px-3 min-w-0"
|
||||||
rows={1}
|
rows={1}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue