fix(collab-web): align transcript wrapping with TUI#2638
Conversation
c7061f6 to
57b1485
Compare
57b1485 to
8d00896
Compare
roboomp
left a comment
There was a problem hiding this comment.
P0 / lgtm — tight display-only fix in packages/collab-web: Marked.breaks preserves soft line breaks, CSS keeps prose wrapping readable while leaving pre on the horizontal-scroll path, and the changelog/test coverage match the touched package.
No inline findings. I could not rerun the new test locally because this checkout has no node_modules/react, but the diff review found no correctness or convention blockers.
Thanks for the focused fix.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d00896c43
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| - Preserved assistant soft line breaks and paragraph indentation in the collab web transcript Markdown renderer so tree-shaped prose no longer collapses into one paragraph. | ||
| - Changed collab web transcript wrapping to keep Korean/CJK words intact before falling back to emergency breaks for long URLs or identifiers. |
There was a problem hiding this comment.
Move new changelog entries under Unreleased
These new entries are being added inside the existing 15.13.3 release section while ## [Unreleased] remains empty. The repo instructions say new changelog entries must go under [Unreleased] and released sections are immutable, so the next release flow will omit this fix from the pending release notes and retroactively change an already-published section.
Useful? React with 👍 / 👎.
8d00896 to
7006e53
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7006e53928
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| .tr-md p { | ||
| margin: 6px 0; | ||
| white-space: pre-wrap; |
There was a problem hiding this comment.
Apply whitespace preservation to tight list items
This only preserves whitespace for <p> elements, but marked renders tight Markdown lists without paragraph wrappers. When assistant output puts a shaped tree under a bullet, such as - Decision:\n │ └── detail, breaks: true emits <br> inside the <li> while the spaces in │ └── still collapse to a single space, so list-contained trees still lose their nesting and do not match the TUI. Please cover the list-item text path as well while preserving normal nested-list layout.
Useful? React with 👍 / 👎.
fix(collab-web): align transcript wrapping with TUI
Problem
The collab web transcript did not match the terminal transcript for prose-heavy assistant output.
There were two visible transcript-level issues:
Tree-shaped prose collapsed into one paragraph
Assistant messages can contain intentionally shaped text, such as decision trees or logic trees. The terminal transcript preserves those line breaks, but the collab web Markdown renderer treated soft line breaks as normal spaces.
As a result, tree-shaped prose could become a single noisy paragraph.
Korean/CJK prose could wrap inside readable words
The terminal transcript prefers word-boundary wrapping and only falls back to breaking inside a token when the token cannot fit.
The collab web transcript was more aggressive, so Korean/CJK prose could wrap at awkward character-level boundaries. This made otherwise ordinary transcript text harder to scan.
During review, two related edge cases also came up:
Examples
Tree-shaped prose
Before this change, tree-shaped prose could collapse into a single paragraph in the collab web transcript:
Decision: ├── Add examples │ └── Reviewers can understand the rendering bug immediately. ├── Avoid full conversation dumps │ └── They make the PR noisy. └── Keep examples short └── This keeps the fix focused.The same content should remain readable as separate lines, matching the terminal transcript:
Decision:
├── Add examples
│ └── Reviewers can understand the rendering bug immediately.
├── Avoid full conversation dumps
│ └── They make the PR noisy.
└── Keep examples short
└── This keeps the fix focused.
Korean/CJK wrapping
In constrained transcript widths, readable Korean words should stay intact where possible.
Awkward character-level wrapping can split one word across lines:
The preferred wrapping keeps that word intact and breaks at a readable boundary instead:
Long unbroken tokens still need emergency wrapping so narrow transcript content does not overflow:
https://example.com/this/is/a/very/long/url/that/should/wrapsuperLongIdentifierWithoutBreaksThatShouldStillWrapFix
This change stays in the collab web display layer. It does not change the collab protocol, session state, or message content.
keep-allbehavior.Verification
Additional browser checks:
Review
Initial review found two blocking edge cases:
Both were fixed.
Follow-up review status:
Scope
This PR intentionally does not change:
Risk
Expected risk is low.
Known limitation: