fix(web/chat): wrap long unbreakable strings in chat message bubbles (fixes #1738)#1742
Conversation
…ixes coleam00#1738) User-bubble <p> and the .chat-markdown typography rules had no overflow-wrap, so long URLs and tokens broke out of the max-w-[70%] container. - MessageBubble: add break-words + min-w-0 to the flex-1 paragraph so it can shrink below intrinsic content width. - index.css: add overflow-wrap: break-word to .chat-markdown p, li, td, and a. Code blocks already use overflow-x-auto and are excluded.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR fixes chat message text overflow by adding word-breaking rules at both the component and global CSS levels. MessageBubble's message paragraph adds ChangesChat message text wrapping fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@truffle-dev this PR appears to fully address #1738. Consider adding |
|
It is in the body under |
Review SummaryVerdict: ready-to-merge Clean CSS fix for issue #1738. Long unbreakable strings (URLs, tokens) in chat bubbles now wrap properly without horizontal overflow. Two targeted changes: Blocking issuesNone. Suggested fixesNone. Minor / nice-to-haveNone. Compliments
Reviewed via maintainer-review-pr workflow (Pi/Minimax). Aspects run: code-review. |
Summary
max-w-[70%]and assistant content lives inside achat-markdownblock, but neither path setsoverflow-wrap: break-word, so a single long word punches through the layout.<p>getsbreak-words+min-w-0(so the flex child can shrink below intrinsic width). The hand-rolled.chat-markdowntypography rules now declareoverflow-wrap: break-wordonp,li,td, anda.<pre>) still useoverflow-x-autoand are deliberately excluded — horizontal scroll is the right behavior for code. No layout, color, spacing, or component structure changes.UX Journey
Before
After
Same fix applied to assistant markdown content via
.chat-markdownrules.Architecture Diagram
Before
After
Connection inventory:
<p>break-words min-w-0so flex child can wrap.chat-markdown poverflow-wrap: break-word.chat-markdown li, td, a.chat-markdown preoverflow-x-auto(intentional)Label Snapshot
risk: lowsize: XSwebweb:chatChange Metadata
bugwebLinked Issue
Validation Evidence
Manual verification: pasted a 200-char URL (
https://example.com/foo/bar/baz?+ 150 random chars) into a chat message and confirmed it now wraps inside the user bubble instead of overflowing. Repeated with a long markdown link in an assistant response — wraps inside.chat-markdown. Code blocks still scroll horizontally as before.Security Impact
Compatibility / Migration
Human Verification
[text](very-long-url), mixed text + long URL, table cell with long token.overflow-wrap: break-wordis supported in all evergreen browsers per MDN.Side Effects / Blast Radius
packages/web/src/components/chat/MessageBubble.tsx+.chat-markdownrules inindex.css).Rollback Plan
git revert <commit>— pure CSS revert, no state or schema impact.Risks and Mitigations
.chat-markdownoutside the chat surface expected text not to wrap.chat-markdown— only used inMessageBubble.tsx. No other call sites.Summary by CodeRabbit