Skip to content

fix(message): wrap long words instead of clipping them - #516

Open
HardMax71 wants to merge 1 commit into
vercel:mainfrom
HardMax71:fix/message-response-wrap-long-tokens
Open

HardMax71 wants to merge 1 commit into
vercel:mainfrom
HardMax71:fix/message-response-wrap-long-tokens

Conversation

@HardMax71

Copy link
Copy Markdown

Adds break-words (overflow-wrap: break-word) to MessageResponse and ReasoningContent. A word that doesn't fit on a line now breaks inside the message; text that fits is unchanged. Queue and Terminal already use break-words.

I chose it over wrap-anywhere because anywhere also lowers the min-content width, which changes how tables are sized: in the same check, a 7-column table shrank from 617 px to 588 px, and narrow columns would break words mid-word instead of scrolling. With break-words the table stays at 617 px and scrolls as before. Code blocks scroll either way.

The test setup doesn't load Tailwind CSS, so the two new tests in message.test.tsx and reasoning.test.tsx check that the class is there; both fail on main and pass here. To check the layout, I compiled the Tailwind 4.1.18 CSS for the package and rendered the repro from the issue in Chromium: inline code that ran 850 px (assistant), 866 px (user) and 832 px (reasoning) past the edge now ends inside it. The full @repo/elements suite passes (960 tests). No docs change, since props and usage stay the same.

Closes #515

@vercel

vercel Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@HardMax71 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

MessageResponse cuts off long words (IDs, hashes, paths) at the message edge

1 participant