t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: iOS code block pane stays empty until the wrap button is tapped or time passes

Open SouthCarpet opened this issue 3 weeks ago • 1 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

Observed on one iPhone; not yet reproduced on a second device.

  1. In the iOS app, open a completed thread whose assistant message contains a long fenced code block (here: a json block taller than the screen, the final message of a Claude Sonnet subagent, opened from the parent thread's "Open parent" bar).
  2. Scroll to the code block.
  3. Wait, or tap the wrap button (text.alignleft) in the code block header.

Expected behavior

The code block shows its text as soon as it is on screen. The header and the code pane appear together.

Actual behavior

The code block shows its header (language label JSON, wrap button, copy button) and reserves the full height of the block, but the code pane is empty. The long press menu (Copy, Copy as Markdown) works on the empty pane. The text appears later on its own, or at once after a tap on the wrap button.

Where this points in the native code (react-native-enriched-markdown fork, 1.2.0-t3.16-29ddd424):

  • ios/segments/ENRMCodeBlockContainerView.m draws the header in the container's drawRect: and the code in the inner ENRMCodeBlockContentView (cached TextKit stack, drawRect: only paints glyphs).
  • The block height is analytic (ENRMCodeBlockCodeHeight), so the reserved height is right even when the pane paints nothing.
  • setWrapped: calls setNeedsLayout and [_codeContentView setNeedsDisplay]. That is exactly what the wrap tap triggers, and it makes the text appear. So the attributed code is there, but the inner pane was not laid out or redrawn after it was set (the reuse path that skips applyCodeBlockNode, or a first layout at zero bounds, are the candidates; not verified).

Impact

Minor bug or occasional failure

Version or commit

iOS app 2.2.0

Environment

iPhone, iOS 27.2 beta. Assistant provider: Claude (Sonnet 5.5 subagent thread). Enriched Markdown tarball react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz as on main 2026-11-02.

Logs or stack traces

none

Screenshots, recordings, or supporting files

Two screenshots follow in a comment: the empty pane with the header, and the same block after the text appeared.

Workaround

Tap the wrap button in the code block header, or wait.

Related reports

  • #24263 (merged): bounds streaming markdown pending renders on iOS; this report is about a settled thread, not streaming.
  • #20080 (merged): added the wrap button that makes the text appear here.
  • Discussion #30931 (Ideas): question card invisible while the model writes it; a different surface.

SouthCarpet avatar Nov 08 '26 11:11 SouthCarpet

Empty code pane with header Context menu on the empty pane Same block after the text appeared

SouthCarpet avatar Nov 08 '26 12:11 SouthCarpet