Skip to content

fix(ui): wrap output at word boundaries, not mid-word#19

Merged
HarryCordewener merged 1 commit into
masterfrom
fix/output-word-wrap
Jul 1, 2026
Merged

fix(ui): wrap output at word boundaries, not mid-word#19
HarryCordewener merged 1 commit into
masterfrom
fix/output-word-wrap

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

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) used word-break: break-all, which breaks every over-long line at any character.

Fix

Replace it with overflow-wrap: break-word (keeping the existing white-space: pre-wrap):

  • normal text wraps at word boundaries;
  • a single token is broken only when it's too long to fit on its own line, so an over-wide line still can't overflow the output column;
  • ASCII art / aligned output is unaffected — it only breaks when it genuinely overflows the width, exactly as before.

Before / after

Same RP text, same width:

break-all (before) overflow-wrap: break-word (after)
…biting Gapspace wi
nd, white hair… shattered P
late below…
…biting Gapspace
wind, white hair… shattered
Plate below…

Verified visually against the running web client (the real .sc-line rule). One-line CSS change.

🤖 Generated with Claude Code

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
Copilot AI review requested due to automatic review settings July 1, 2026 07:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-line word-break: break-all with overflow-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.

@HarryCordewener
HarryCordewener merged commit bd28633 into master Jul 1, 2026
3 checks passed
@HarryCordewener
HarryCordewener deleted the fix/output-word-wrap branch July 1, 2026 07:59
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.

2 participants