Skip to content

Fix Studio user-message overflow for long unbroken text - #7100

Merged
oobabooga merged 1 commit into
unslothai:mainfrom
Lyxot:fix/studio-long-message-overflow
Jul 13, 2026
Merged

oobabooga merged 1 commit into
unslothai:mainfrom
Lyxot:fix/studio-long-message-overflow

Conversation

@Lyxot

@Lyxot Lyxot commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Cap the Studio user-message bubble at the width of its existing max-w-[80%] wrapper.
  • Preserve intrinsic w-fit sizing for short messages and the existing wrapping behavior for normal prose.
  • Keep assistant Markdown, code-block scrolling, viewport overflow, character limits, and context-window validation unchanged.

This may address one contributing cause of #7068; the broader issue should remain open for further investigation.

Root cause

The user bubble combined w-fit with overflow-wrap: break-word but had no maximum width. break-word does not constrain intrinsic width, so a long unbroken path, URL, hash, or console value could make the right-aligned bubble thousands of pixels wider than its wrapper. Adding max-w-full supplies the missing hard cap while allowing the existing wrapping rule to break the text inside that finite width.

Scope and risk

The change adds one Tailwind class to the user-message content element. Short messages remain content-sized, while long messages cannot exceed the existing wrapper. No assistant-message or thread-viewport classes are touched.

Validation

  • Reproduced the untouched behavior in the real Studio chat path: 5,000 consecutive characters produced a 55,558.97px bubble inside a 595.19px wrapper, while similarly sized spaced prose remained contained.
  • Verified the fixed layout at 1280×900 and 390×844 with short text, multiline prose, 5,000 consecutive characters, long paths and URLs, hashes, and 9,629 characters of multiline console output.
  • Confirmed the bubble and document scroll widths remain contained on desktop and narrow layouts.
  • Completed two independent review passes with no findings.
npm run typecheck
npm run build
python -m pytest tests/studio/test_chat_response_details_ui_contract.py tests/studio/test_composer_rtl_bidi_attribute.py -q
git diff --check origin/main...HEAD

All commands above pass; the focused test run reports 18 passed. npm run lint was also run and reports 449 pre-existing repository diagnostics unrelated to the changed line.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the UserMessage component in thread.tsx by adding the max-w-full class to the user message content container, ensuring that the message bubble does not exceed its parent container's width. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Lyxot
Lyxot marked this pull request as ready for review July 13, 2026 08:09
Copilot AI review requested due to automatic review settings July 13, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Caps Studio user message bubbles so long unbroken strings (paths/URLs/hashes) can’t expand beyond the existing max-w-[80%] wrapper, while preserving w-fit behavior for short messages.

Changes:

  • Add a max-w-full constraint to the user-message content element to prevent intrinsic width overflow for unbroken text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@oobabooga

Copy link
Copy Markdown
Member

Confirmed this live in Studio: pasting 5,000 unbroken characters on main blows the bubble out sideways, and the same paste on your branch wraps inside a normal-width bubble, with short messages still snug. Also measured the compiled CSS in headless Chrome to pin the mechanism: main sizes the bubble to 40,032px inside a 640px wrapper, and max-w-full caps it at exactly 640px.

This bubble is the only w-fit element in the file, so the assistant message and edit composer never had the bug. Mirror CI: oobabooga#49, all green after one Chat UI Tests job wedged at its final shutdown step and passed on rerun (known flake).

Merging now.

@oobabooga
oobabooga merged commit cc85992 into unslothai:main Jul 13, 2026
35 of 36 checks passed
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.

3 participants