diff --git a/apps/desktop/src/components/editor/AiAssistant.vue b/apps/desktop/src/components/editor/AiAssistant.vue
index a2e8a29c30..85990a6279 100644
--- a/apps/desktop/src/components/editor/AiAssistant.vue
+++ b/apps/desktop/src/components/editor/AiAssistant.vue
@@ -4780,7 +4780,7 @@ async function openExternalUrl(url: string) {
{{ mention.kind === "table" ? [mention.schema, mention.table].filter(Boolean).join(".") : mention.name }}
-
{{ msg.content }}
+ {{ msg.content }}
-
+
@@ -5716,6 +5716,10 @@ html.dbx-legacy-webview.dark .ai-markdown :deep(.ai-markdown-table-wrap:hover::-
overflow-anchor: none;
}
+.ai-message-scroll :deep([data-ai-user-message-content]) {
+ overflow-wrap: anywhere;
+}
+
.resize-handle {
position: absolute;
top: -4px;
diff --git a/apps/desktop/src/components/editor/__tests__/AiAssistant.messageWrap.spec.ts b/apps/desktop/src/components/editor/__tests__/AiAssistant.messageWrap.spec.ts
new file mode 100644
index 0000000000..fce498305a
--- /dev/null
+++ b/apps/desktop/src/components/editor/__tests__/AiAssistant.messageWrap.spec.ts
@@ -0,0 +1,16 @@
+import { readFileSync } from "node:fs";
+import { describe, expect, it } from "vitest";
+
+const source = readFileSync(new URL("../AiAssistant.vue", import.meta.url), "utf8");
+
+describe("AI assistant message wrapping", () => {
+ it("allows long unbroken user text such as comma-separated SQL arrays to wrap", () => {
+ expect(source).toContain('data-ai-user-message-content class="whitespace-pre-wrap">{{ msg.content }}
');
+ expect(source).toContain(".ai-message-scroll :deep([data-ai-user-message-content])");
+ expect(source).toContain("overflow-wrap: anywhere;");
+ });
+
+ it("allows long unbroken fenced code to wrap inside the message bubble", () => {
+ expect(source).toContain('class="ai-code-block whitespace-pre-wrap break-words [overflow-wrap:anywhere]');
+ });
+});