fix(ui): wrap output at word boundaries, not mid-word#19
Merged
Conversation
The output line (`.sc-line`) used `word-break: break-all`, which broke every over-long line character-by-character — jarring to read for prose / RP text. Replace it with `overflow-wrap: break-word` (with the existing `white-space: pre-wrap`): lines now wrap at word boundaries, and a single token is only broken when it is too long to fit on its own, so an over-wide line still can't overflow the output column. ASCII art is unaffected (it only breaks when it genuinely overflows the width, same as before). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHCRc5CJ6595iMzEgYYdQp
There was a problem hiding this comment.
Pull request overview
Adjusts the output line-wrapping behavior in the web UI so prose/role-play text wraps at word boundaries (improving readability) while still preventing overly-long unbroken tokens from overflowing the output column.
Changes:
- Replaced
.sc-lineword-break: break-allwithoverflow-wrap: break-word. - Added an explanatory comment documenting the rationale and expected behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Output text wrapped character-by-character instead of at word boundaries, which is jarring to read for prose / role-play text.
Cause
.sc-line(the output line) usedword-break: break-all, which breaks every over-long line at any character.Fix
Replace it with
overflow-wrap: break-word(keeping the existingwhite-space: pre-wrap):Before / after
Same RP text, same width:
break-all(before)overflow-wrap: break-word(after)…biting Gapspace wind, white hair…shattered Plate below……biting Gapspacewind, white hair…shatteredPlate below…Verified visually against the running web client (the real
.sc-linerule). One-line CSS change.🤖 Generated with Claude Code