mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-06-11 18:05:58 +00:00
fix(frontend): prevent user message bubble overflow with long unbreakable strings (#3488)
- Add max-w-full min-w-0 to user message wrapper div to constrain width - Change bubble width from w-fit to w-full max-w-full for consistent layout - Add break-words to user message content for long string wrapping - Add overflow-x-clip as defensive overflow protection Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
@@ -302,6 +302,7 @@ function MessageContent_({
|
|||||||
if (isHuman) {
|
if (isHuman) {
|
||||||
const messageResponse = contentToDisplay ? (
|
const messageResponse = contentToDisplay ? (
|
||||||
<AIElementMessageResponse
|
<AIElementMessageResponse
|
||||||
|
className="break-words"
|
||||||
remarkPlugins={humanMessagePlugins.remarkPlugins}
|
remarkPlugins={humanMessagePlugins.remarkPlugins}
|
||||||
rehypePlugins={humanMessagePlugins.rehypePlugins}
|
rehypePlugins={humanMessagePlugins.rehypePlugins}
|
||||||
components={components}
|
components={components}
|
||||||
@@ -311,10 +312,15 @@ function MessageContent_({
|
|||||||
</AIElementMessageResponse>
|
</AIElementMessageResponse>
|
||||||
) : null;
|
) : null;
|
||||||
return (
|
return (
|
||||||
<div className={cn("ml-auto flex flex-col gap-2", className)}>
|
<div
|
||||||
|
className={cn(
|
||||||
|
"ml-auto flex max-w-full min-w-0 flex-col gap-2",
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
>
|
||||||
{filesList}
|
{filesList}
|
||||||
{messageResponse && (
|
{messageResponse && (
|
||||||
<AIElementMessageContent className="w-fit">
|
<AIElementMessageContent className="w-full max-w-full">
|
||||||
{messageResponse}
|
{messageResponse}
|
||||||
</AIElementMessageContent>
|
</AIElementMessageContent>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user