Skip to content

fix(chat): wrap long unbroken strings inside chat bubble (#457) - #535

Closed
dolho wants to merge 1 commit into
mainfrom
feature/457-chat-long-string-wrap
Closed

fix(chat): wrap long unbroken strings inside chat bubble (#457)#535
dolho wants to merge 1 commit into
mainfrom
feature/457-chat-long-string-wrap

Conversation

@dolho

@dolho dolho commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Long URLs, base64 blobs, and inline code in chat responses pushed the agent detail page horizontally because text containers did not break unbreakable strings and <pre> blocks grew to their intrinsic width.
  • Added Tailwind utilities on all three ChatBubble variants (user / assistant / self-task) so unbreakable strings wrap, <pre> blocks scroll inside the bubble, and inline code/links break at character boundaries.

Closes #457.

Changes

src/frontend/src/components/chat/ChatBubble.vue:

  • [overflow-wrap:anywhere] on text containers — wraps long strings (URLs, base64, paths).
  • min-w-0 on bubble wrappers — so max-w-[85%] actually clamps width when nested in flex parents.
  • prose-pre:max-w-full prose-pre:overflow-x-auto prose-pre:whitespace-pre<pre> blocks scroll horizontally inside the bubble instead of pushing layout.
  • prose-code:break-all prose-a:break-all — inline code and links break at character boundaries.

Pure CSS / template change. No logic changes, no markdown sanitization changes.

Test plan

Verified end-to-end via Playwright (UI agent) against http://localhost:8001:

  • Long URL + base64 in user bubble wraps inside indigo bubble
  • Pure unbroken base64 string wraps to multiple lines
  • Long URL in assistant prose breaks via word-break: break-all on <a>
  • <pre> block (2703px content) scrolls inside bubble (overflowX:auto); wrapper scrollWidth == clientWidth
  • Inline <code> wraps via word-break: break-all
  • No page horizontal scroll in any test (docScrollWidth == docClientWidth == 1280)
  • No console errors from ChatBubble.vue compilation
  • Normal short messages and markdown rendering unchanged

Manual visual verification: open agent detail → Chat tab on a running agent, paste a long URL + 200-char base64 string, confirm the page does not scroll horizontally and the bubble stays inside its column.

🤖 Generated with Claude Code

Long URLs, base64 blobs, and inline code in chat responses pushed
the agent detail page horizontally because text containers did not
break unbreakable strings and `<pre>` blocks grew to intrinsic width.

Add Tailwind classes on all three ChatBubble variants:
- `[overflow-wrap:anywhere]` on text containers (wraps long strings)
- `min-w-0` on bubble wrappers (so percent max-width clamps correctly)
- `prose-pre:max-w-full prose-pre:overflow-x-auto prose-pre:whitespace-pre`
  (pre blocks scroll inside the bubble instead of pushing layout)
- `prose-code:break-all prose-a:break-all`
  (inline code and links break at character boundaries)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dolho

dolho commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

Duplicates

#502

@dolho dolho closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: long strings in chat responses break layout in chat tab

1 participant