Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: Long messages in floating embedded pages overflow the message box. (#21951)

balibabu2b3b4fc03b75
diff --git a/web/src/components/floating-chat-widget.tsx b/web/src/components/floating-chat-widget.tsx
index 3f93648124..3176cc0413 100644
--- a/web/src/components/floating-chat-widget.tsx
+++ b/web/src/components/floating-chat-widget.tsx
@@ -150,6 +150,7 @@ const AwaitInteraction = ({
if (isActive) {
return (
<DebugContent
+ className="[&_input]:text-inherit [&_textarea]:text-inherit"
parameters={buildInputList(message)}
message={message}
ok={handleOk(message)}
@@ -348,10 +349,15 @@ const FloatingChatWidget = () => {
</div>
);
};
+ const widgetFormControlStyle = {
+ color: widgetTextColor,
+ '--bg-input': `color-mix(in srgb, ${widgetTextColor} 5%, transparent)`,
+ '--border-button': `color-mix(in srgb, ${widgetTextColor} 20%, transparent)`,
+ } as React.CSSProperties;
const bodyContainerStyle: React.CSSProperties = {
+ ...widgetFormControlStyle,
borderRadius: '0 0 16px 16px',
backgroundColor: widgetBackgroundColor,
- color: widgetTextColor,
};
const inputStyle: React.CSSProperties = {
minHeight: '44px',
@@ -746,8 +752,9 @@ const FloatingChatWidget = () => {
size="small"
className="w-[calc(100vw-2rem)]"
>
- <div className="mb-4">
+ <div className="mb-4" style={widgetFormControlStyle}>
<DebugContent
+ className="[&_input]:text-inherit [&_textarea]:text-inherit"
parameters={buildBeginInputListFromObject(beginInputs ?? {})}
ok={handleSubmitBeginParams}
isNext={false}
@@ -921,7 +928,7 @@ const FloatingChatWidget = () => {
hasAwaitInputs(message)
? 'w-full'
: 'max-w-[280px]'
- } px-4 py-2 rounded-2xl ${
+ } min-w-0 break-words px-4 py-2 rounded-2xl ${
message.role === MessageType.User
? 'text-white rounded-br-md'
: 'rounded-bl-md'
@@ -936,7 +943,7 @@ const FloatingChatWidget = () => {
}
>
{message.role === MessageType.User ? (
- <p className="text-sm leading-relaxed whitespace-pre-wrap">
+ <p className="text-sm leading-relaxed whitespace-pre-wrap text-wrap">
{message.content}
</p>
) : (
@@ -1132,7 +1139,7 @@ const FloatingChatWidget = () => {
hasAwaitInputs(message)
? 'w-full'
: 'max-w-[280px]'
- } px-4 py-2 rounded-2xl ${
+ } min-w-0 break-words px-4 py-2 rounded-2xl ${
message.role === MessageType.User
? 'text-white rounded-br-md'
: 'rounded-bl-md'