fix(mobile): keep transcript row gaps uniform around blank text parts - #5359
Merged
Conversation
A whitespace-only assistant text part counted as content, so the transcript rendered a zero-height row between two visible rows. That row consumed one `gap-2`, and the visible gap doubled from 8pt to 16pt. The same part alone in a message kept that message in the transcript, adding its own `py-1` wrapper for the same doubling. `partRendersContent` and `TextPartRenderer` now treat whitespace-only text as blank, so every adjacent transcript row pair sits one gap apart. Measured on an iPhone 17 Pro simulator against a seeded CLI session: before, the gap after a blank text part was 42px while every other gap was 21px; after, every gap is 21px.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by grok-4.6 · Input: 96.8K · Output: 6.8K · Cached: 345.7K Review guidance: REVIEW.md from base branch |
eshurakov
approved these changes
Aug 19, 2026
eshurakov
left a comment
Contributor
There was a problem hiding this comment.
Looks correct. Whitespace-only text parts no longer count as content, matching the renderer. Tests cover the cases.
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.
Follow-up to #5318, which did not fix the reported gap.
What changed
A whitespace-only assistant text part no longer counts as transcript content, so the gap between two neighboring transcript rows is always one gap.
User note
The gap above and below a collapsed
THOUGHTrow now matches the gap between two tool rows. Nothing else in the transcript moves.Product note
Row rhythm is uniform again: every adjacent row pair in a session transcript sits 8pt apart, whatever the hidden parts between them are.
Maintainer note
Root cause is not the dashed box that #5318 changed.
partRendersContentaccepted any text part withtext !== '', so a whitespace-only text part (models emit"\n\n"between tool calls) passed as content:gap-2gaps inMessageBubble— the visible gap doubled to 16pt;messageRendersContenttrue, somergeSessionTranscriptkept the message and itspx-4 py-1wrapper added the same 8pt.partRendersContentnow trims, matching the reasoning-part rule next to it, andTextPartRenderertrims its own guard so the two stay in step.Verification
Local e2e on an iPhone 17 Pro simulator (real dev build, local stack, CLI session seeded through
session-ingest), pixel-measured fromsimctlscreenshots:THOUGHTrowpnpm format && pnpm typecheck && pnpm lint && pnpm check:unusedandpnpm test(4916 tests) pass inapps/mobile.Human steps
No human step is needed.