Skip to content

Commit a9b4384

Browse files
committed
fix(ui): improve message bubble width and overflow handling
1 parent 2746296 commit a9b4384

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

web/src/components/MessageBubble.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export const MessageBubble = memo(function MessageBubble({
265265
{/* Message Content */}
266266
<div
267267
className={classNames(
268-
"flex flex-col w-full sm:w-auto sm:max-w-[75%]",
268+
"flex flex-col w-full sm:w-auto sm:max-w-[75%] min-w-0",
269269
isUserMessage ? "items-end" : "items-start"
270270
)}
271271
>
@@ -348,7 +348,7 @@ export const MessageBubble = memo(function MessageBubble({
348348
{/* Bubble */}
349349
<div
350350
className={classNames(
351-
"relative px-4 py-2.5 shadow-sm text-sm leading-relaxed max-w-[85vw] sm:max-w-none",
351+
"relative px-4 py-2.5 shadow-sm text-sm leading-relaxed max-w-[85vw] sm:max-w-full min-w-0 overflow-hidden",
352352
isUserMessage
353353
? "bg-blue-600 text-white rounded-2xl rounded-tr-none"
354354
: isDark
@@ -432,7 +432,7 @@ export const MessageBubble = memo(function MessageBubble({
432432
content={formatEventLine(ev)}
433433
isDark={isDark}
434434
invertText={isUserMessage}
435-
className="break-words [overflow-wrap:anywhere] overflow-x-auto max-w-full"
435+
className="break-words [overflow-wrap:anywhere] max-w-full"
436436
/>
437437

438438
{/* Attachments */}

web/src/styles/markdown.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
.markdown-body {
6161
word-wrap: break-word;
6262
overflow-wrap: break-word;
63+
max-width: 100%;
6364
}
6465

6566
/* Code Block Wrapper & Header */
@@ -68,6 +69,7 @@
6869
overflow: hidden;
6970
border: 1px solid #e1e4e8;
7071
background-color: #f6f8fa;
72+
max-width: 100%;
7173
}
7274

7375
.dark .code-block-wrapper {
@@ -80,6 +82,7 @@
8082
border: none !important;
8183
border-radius: 0 !important;
8284
background: transparent !important;
85+
overflow-x: auto;
8386
}
8487

8588
.code-block-header {

0 commit comments

Comments
 (0)