#9411: Fix: Web UI long message overflow causing unreadable text
app: web-ui
stale
Cluster:
Web UI Enhancements and Fixes
## Summary
Fixes the issue where long messages became unreadable in the Web UI when they exceeded the window size.
## Problem
When messages grew beyond the window size, they would overflow the container and become unreadable, as shown in issue #9399.
## Root Cause
1. The `.chat-bubble` container lacked proper overflow handling - text could overflow horizontally
2. Pre-formatted code blocks (`<pre>` elements) had no max-width constraint, allowing them to expand beyond the viewport
## Solution
Added proper CSS constraints to ensure messages stay within their containers:
1. **ui/src/styles/chat/grouped.css**:
- Added `overflow: hidden` to `.chat-bubble` to prevent content from spilling out
- Added `overflow-wrap: break-word` to ensure long words break properly
2. **ui/src/styles/chat/text.css**:
- Added `max-width: 100%` to `pre` blocks to prevent horizontal overflow
- Code blocks now scroll horizontally within their container when needed
## Testing
The fix ensures that:
- Long continuous text wraps properly within message bubbles
- Code blocks with long lines display with horizontal scroll rather than breaking layout
- Message containers respect their parent's width constraints
Fixes #9399
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adjusts chat CSS to keep long messages readable by adding wrapping/overflow constraints to `.chat-bubble` and ensuring `<pre>` blocks don’t exceed their container.
The changes apply to the grouped chat layout (`ui/src/styles/chat/grouped.css`) and markdown/text rendering styles (`ui/src/styles/chat/text.css`), which are used by the grouped chat renderer (`ui/src/ui/chat/grouped-render.ts`) when it wraps sanitized markdown output inside `.chat-bubble` / `.chat-text`.
<h3>Confidence Score: 4/5</h3>
- Mostly safe to merge, but a CSS overflow change likely breaks code-block scrolling in chat bubbles.
- The PR is small and localized to CSS, but `overflow: hidden` on the bubble is very likely to clip `<pre>` horizontal overflow/scrollbars, which conflicts with the stated fix and can reintroduce unreadable long code blocks.
- ui/src/styles/chat/grouped.css
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#9122: fix(webchat): constrain .chat-new-messages to button size
by ridermw · 2026-02-04
82.5%
#6521: fix: addressed style issue for chat compose and thread on mobile
by spencer-rafada · 2026-02-01
81.3%
#9175: Fix: Constrain webchat 'New messages' icon size to prevent massive ...
by vishaltandale00 · 2026-02-04
79.3%
#9432: fix(ui): improve Firefox/Gecko compatibility for chat layout
by dbottme · 2026-02-05
78.9%
#2716: Fix #2678: markdown horizontal rules not rendering in web chat
by Ambar-13 · 2026-01-27
78.8%
#15204: fix(ui): preserve angle-bracketed text in chat
by bufordtjustice2918 · 2026-02-13
77.3%
#8284: Fix: Webchat images now persist after sending
by vishaltandale00 · 2026-02-03
76.7%
#3721: fix(ui): webchat not displaying chat responses
by maxmaxrouge-rgb · 2026-01-29
76.5%
#22333: Fix webchat inline image rendering and size handling
by AIflow-Labs · 2026-02-21
76.2%
#7316: fix: /chat dashboard performance
by felipcsousa · 2026-02-02
76.2%