You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(native-chat): wrap long background task summaries instead of widening the chat - #47359
Sometimes a background task finishes with a summary that is one very long "word" with no spaces, such as a long id or a line of JSON. The chat tried to fit that whole word on one line, so the conversation got wider than the window and a sideways scrollbar appeared. Now the long word wraps onto several lines and the chat stays the width of the window.
What Changed
Before: the result sentence under a background task row (summary, or error when there is no summary) never broke inside a long token. A 1,600-character token stretched the transcript to about 11,000px and put a horizontal scrollbar across the whole chat.
After: the sentence wraps inside the message column and the transcript has no horizontal overflow. Text with normal spaces still wraps at the spaces, as before.
Mechanism: the result <p> in NativeChatBackgroundTaskRun used the default overflow-wrap: normal, so an unbroken token set the paragraph's min-content width. That width passed up through the transcript's flex/grid ancestors, and the row's own min-w-0 did not stop it. Adding [overflow-wrap:anywhere] lowers the min-content width. break-words would not have worked, because it does not change min-content. The same utility is already used elsewhere in native chat (notice rows, event rows, wrapped code blocks, markdown). Both places that render this component get the fix: the transcript tool run and WorkerDockProviderDetailsDialog.
Why
This fixes the element that causes the overflow, and nothing else. Two alternatives were rejected. overflow-x: hidden on the scroller would hide the scrollbar but clip the text. Adding min-w-0 up the ancestor chain would touch many components to fix one leaf.
Headless component fixture (NativeChatMessageList, dark theme, run with pnpm fixtures:shot). The yellow bar reports the transcript scroller's overflow.
1,600-character unbroken summary at 720px
Before
After
Before, maxScrollerOverflow is 16028. After, it is 0.
Long URL in a narrow 360px pane
Before
After
Normal spaced sentence (no regression)
Before
After
This text wraps at the same word boundaries in both, and the row is 32px tall in both.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Reproduced with a scratch fixture on origin/main, then compared with this branch. The fixture was not committed. Worst scroller overflow, main vs this PR:
long token at 720px: 16,028px vs 0
blocked row with only an error: 16,028px vs 0
spaced sentence containing one 900-character token: 5,640px vs 0
long URL in a 360px pane: 1,836px vs 0
dialog-sized box: 16,669px vs 0
normal spaced text: 0 on both
Blocked rows still render in red. The sibling output row already uses truncate; a 1,600-character outputFile gets an ellipsis and does not overflow.
The existing tests in native-chat/tools/tasks/ pass (5 files, 14 tests). oxlint, oxfmt, anti-slop, ast-grep and the changed-code quality gate are all clean.
No unit test added: this is a one-class styling change, and the repo's test guidance says not to unit-test UI styling. The fixture comparison above is the evidence.
Tested on macOS (headless fixture renderer). The change is renderer CSS only, so the platform, SSH and remote setup do not affect it.
Performance
This adds one CSS property to a per-task row in the renderer. It adds no JS, I/O, polling or subprocess work. Forced layout in the headless fixture, median of 15 runs, 600px box:
Typical case, 500 rows of spaced text: 4.10 ms vs 4.10 ms. No change.
Adversarial case, 200 rows that each hold a 1,600-character unbroken token: 14.1 ms vs 19.4 ms. That is about 0.1 ms per row, because each row now lays out about 20 wrapped lines instead of one 11,000px line. The transcript is virtualized, so only rows on screen are laid out. A real chat has at most a few such rows, which keeps it far below 16 ms.
Risk
The only behavior change: when a single token is wider than the column, a background task's result sentence now breaks mid-token. Text with normal spaces wraps exactly as before. This affects the desktop renderer only; on mobile, React Native Text already wraps this sentence. To back it out, revert this commit.
Level: Low
Review
Reviewed by maintainers. The root cause is confirmed, and the fix reuses an existing utility. Nothing is blocking.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
No actionable comments were generated in the recent review.
Walkthrough
The task sentence paragraph now applies overflow-wrap:anywhere. This allows long unbroken text to wrap. Existing spacing, padding, text size, and blocked-state coloring remain unchanged.
Severity of issue fixed: Low
Merge Risk: Minimal · up to 22417
Long unbroken background task summaries now wrap within the chat column instead of widening the transcript. This is a one-class styling change in the desktop renderer with a low chance of regression and is ready to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Linked Issues check
[#47358] The issue requires a background command's long unbroken result to wrap inside the message column instead of widening the transcript. The whole-PR diff (merge base cd8a94d to head 224176d) cha…
Out of Scope Changes check
The whole-PR diff touches one file and one JSX element. The only edit adds [overflow-wrap:anywhere] to the background task result paragraph, and the className is reformatted across lines. This directl…
Title check
The title names the main change: long background task summaries now wrap in the native chat instead of widening it. It uses the fix(native-chat) convention and matches the raw summary, which adds over…
Description check
The description follows the template closely. It covers ELI5, What Changed with before and after, the mechanism, Why with rejected alternatives, a linked issue (Fixes #47358), visual proof tables, tes…
Full details: Linked Issues check
Explanation
[#47358] The issue requires a background command's long unbroken result to wrap inside the message column instead of widening the transcript. The whole-PR diff (merge base cd8a94d to head 224176d) changes one element in src/renderer/src/components/native-chat/tools/tasks/NativeChatBackgroundTaskRun.tsx. The result <p> gains the Tailwind arbitrary utility [overflow-wrap:anywhere], which lets the browser break inside a long token, so the paragraph's min-content width no longer forces the transcript wider. The existing classes, the blocked-state text-destructive styling, and the rendered sentence are unchanged. The author reports before and after fixture measurements (horizontal overflow 9,899px before, 0px after). I did not re-run the fixture, so the measurement rests on the author's report and the code change. The issue states no automated test requirement. No coding requirement is left unmet.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff touches one file and one JSX element. The only edit adds [overflow-wrap:anywhere] to the background task result paragraph, and the className is reformatted across lines. This directly implements #47358. The PR description cites reuse of the same utility in other native-chat components, but the diff does not change those files. No unrelated, refactoring, or unexplained changes appear in the reviewed diff.
Full details: Title check
Explanation
The title names the main change: long background task summaries now wrap in the native chat instead of widening it. It uses the fix(native-chat) convention and matches the raw summary, which adds overflow-wrap:anywhere to the task result paragraph. The title is 82 characters, slightly long but still clear.
Full details: Description check
Explanation
The description follows the template closely. It covers ELI5, What Changed with before and after, the mechanism, Why with rejected alternatives, a linked issue (Fixes #47358), visual proof tables, testing, a performance line with measurements, a risk section with a Low level and a revert path, and the checklists. The Linked Issue cites #47358, which matches the objectives. The Fixes # reference is filled in. The AI Disclosure section is left blank, which the template allows for internal contributors. The description is complete, so it passes.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
…ning the chat
A background task's result sentence (for example the JSON line that
`orca orchestration worker-start` prints) had no break opportunity, so one
unbroken token set the transcript's min-content width and pushed a
horizontal scrollbar across the whole chat. overflow-wrap:anywhere lets it
wrap inside the column, matching the markdown body and code blocks.
Fixesstablyai#47358
nwparker
changed the title
fix(native-chat): wrap a background task's long summary instead of widening the chat
fix(native-chat): wrap long background task summaries instead of widening the chat
Nov 23, 2026
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
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.
ELI5
Sometimes a background task finishes with a summary that is one very long "word" with no spaces, such as a long id or a line of JSON. The chat tried to fit that whole word on one line, so the conversation got wider than the window and a sideways scrollbar appeared. Now the long word wraps onto several lines and the chat stays the width of the window.
What Changed
summary, orerrorwhen there is no summary) never broke inside a long token. A 1,600-character token stretched the transcript to about 11,000px and put a horizontal scrollbar across the whole chat.<p>inNativeChatBackgroundTaskRunused the defaultoverflow-wrap: normal, so an unbroken token set the paragraph's min-content width. That width passed up through the transcript's flex/grid ancestors, and the row's ownmin-w-0did not stop it. Adding[overflow-wrap:anywhere]lowers the min-content width.break-wordswould not have worked, because it does not change min-content. The same utility is already used elsewhere in native chat (notice rows, event rows, wrapped code blocks, markdown). Both places that render this component get the fix: the transcript tool run andWorkerDockProviderDetailsDialog.Why
This fixes the element that causes the overflow, and nothing else. Two alternatives were rejected.
overflow-x: hiddenon the scroller would hide the scrollbar but clip the text. Addingmin-w-0up the ancestor chain would touch many components to fix one leaf.Linked Issue
Fixes #47358
Visual Proof
Headless component fixture (
NativeChatMessageList, dark theme, run withpnpm fixtures:shot). The yellow bar reports the transcript scroller's overflow.1,600-character unbroken summary at 720px
Before,
maxScrollerOverflowis 16028. After, it is 0.Long URL in a narrow 360px pane
Normal spaced sentence (no regression)
This text wraps at the same word boundaries in both, and the row is 32px tall in both.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Reproduced with a scratch fixture on
origin/main, then compared with this branch. The fixture was not committed. Worst scroller overflow, main vs this PR:Blocked rows still render in red. The sibling output row already uses
truncate; a 1,600-characteroutputFilegets an ellipsis and does not overflow.The existing tests in
native-chat/tools/tasks/pass (5 files, 14 tests). oxlint, oxfmt, anti-slop, ast-grep and the changed-code quality gate are all clean.No unit test added: this is a one-class styling change, and the repo's test guidance says not to unit-test UI styling. The fixture comparison above is the evidence.
Tested on macOS (headless fixture renderer). The change is renderer CSS only, so the platform, SSH and remote setup do not affect it.
Performance
This adds one CSS property to a per-task row in the renderer. It adds no JS, I/O, polling or subprocess work. Forced layout in the headless fixture, median of 15 runs, 600px box:
Risk
The only behavior change: when a single token is wider than the column, a background task's result sentence now breaks mid-token. Text with normal spaces wraps exactly as before. This affects the desktop renderer only; on mobile, React Native
Textalready wraps this sentence. To back it out, revert this commit.Level: Low
Review
Reviewed by maintainers. The root cause is confirmed, and the fix reuses an existing utility. Nothing is blocking.
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Original fix by @A0150315 in #47359.