From d1deb1be225ef4f15d33e5184a81ce379b6b8c45 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Mon, 13 Jul 2026 00:24:23 +0100 Subject: [PATCH] fix(dashboard): improve AI chat word wrapping readability (#746) Replace break-all on chat message prose with break-words so normal text wraps at word boundaries. Apply overflow-wrap only to inline code and links, and use horizontal scroll for fenced code blocks. Co-authored-by: Cursor Agent Co-authored-by: Rotimi Best --- .../features/ai-assistant/message-bubble.svelte | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/src/lib/features/ai-assistant/message-bubble.svelte b/apps/dashboard/src/lib/features/ai-assistant/message-bubble.svelte index 9e0b65ad..198bce7e 100644 --- a/apps/dashboard/src/lib/features/ai-assistant/message-bubble.svelte +++ b/apps/dashboard/src/lib/features/ai-assistant/message-bubble.svelte @@ -137,7 +137,7 @@ {:else}
{@html renderMentions(renderMarkdown(part.text as string), courseId)} @@ -262,6 +262,17 @@ margin-bottom: 0; } + /* Normal prose wraps at word boundaries; only unbreakable runs (URLs, keys) split mid-token. */ + :global(.ai-chat-prose.prose pre) { + max-width: 100%; + overflow-x: auto; + } + + :global(.ai-chat-prose.prose :not(pre) > code), + :global(.ai-chat-prose.prose a) { + overflow-wrap: anywhere; + } + :global(.mention-link) { display: inline; cursor: pointer;