Skip to content

fix(mobile): keep transcript row gaps uniform around blank text parts - #5359

Merged
iscekic merged 1 commit into
mainfrom
thought-row-height-2b7c
Aug 19, 2026
Merged

fix(mobile): keep transcript row gaps uniform around blank text parts#5359
iscekic merged 1 commit into
mainfrom
thought-row-height-2b7c

Conversation

@iscekic

@iscekic iscekic commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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 THOUGHT row 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. partRendersContent accepted any text part with text !== '', so a whitespace-only text part (models emit "\n\n" between tool calls) passed as content:

  • inside one message it rendered a zero-height markdown row, which consumed one of the gap-2 gaps in MessageBubble — the visible gap doubled to 16pt;
  • alone in a message it kept messageRendersContent true, so mergeSessionTranscript kept the message and its px-4 py-1 wrapper added the same 8pt.

partRendersContent now trims, matching the reasoning-part rule next to it, and TextPartRenderer trims 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 from simctl screenshots:

boundary before after
tool row → tool row 21px 21px
tool row → THOUGHT row 21px 21px
across a blank text part 42px 21px
across a blank-text-only message 42px 21px

pnpm format && pnpm typecheck && pnpm lint && pnpm check:unused and pnpm test (4916 tests) pass in apps/mobile.

Human steps

No human step is needed.

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.
@iscekic iscekic self-assigned this Aug 19, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • apps/mobile/src/components/agents/message-visibility.ts
  • apps/mobile/src/components/agents/text-part-renderer.tsx
  • apps/mobile/src/components/agents/message-visibility.test.ts

Reviewed by grok-4.6 · Input: 96.8K · Output: 6.8K · Cached: 345.7K

Review guidance: REVIEW.md from base branch main

@iscekic iscekic added the human-ready The PR is ready for human review. label Aug 19, 2026

@eshurakov eshurakov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks correct. Whitespace-only text parts no longer count as content, matching the renderer. Tests cover the cases.

@iscekic
iscekic merged commit 3343149 into main Aug 19, 2026
18 checks passed
@iscekic
iscekic deleted the thought-row-height-2b7c branch August 19, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants