[Bug]: iOS code block pane stays empty until the wrap button is tapped or time passes
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.
- In the iOS app, open a completed thread whose assistant message contains a long fenced code block (here: a
jsonblock taller than the screen, the final message of a Claude Sonnet subagent, opened from the parent thread's "Open parent" bar). - Scroll to the code block.
- 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.mdraws the header in the container'sdrawRect:and the code in the innerENRMCodeBlockContentView(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:callssetNeedsLayoutand[_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 skipsapplyCodeBlockNode, 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.