t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: iOS code blocks inside list items have no copy button

Open ericsngyun opened this issue 2 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

  1. In the iOS app, open a thread and get an assistant reply that puts a fenced code block inside a list item, for example:

    1. Run this:
    
       ```
       cd /some/long/path/that/wraps/on/a/phone/screen
       rm -rf first-directory-with-a-long-name/worktree \
         second-directory-with-a-long-name/worktree
       ```
    
    2. Next step.
    
  2. Compare it with the same fence at the top level of a reply.

Expected behavior

The code block in the list item looks and works like a top-level one: a header with the copy button (and the wrap toggle), so a command can be copied with one tap.

Actual behavior

The nested block is drawn as a plain box with no header, so there is no copy button and no wrap toggle. Long lines wrap. The only way to get the command out is to long-press and drag selection handles across wrapped lines, which is awkward for multi-line commands. Agents very often put commands in numbered steps, so this is the common case rather than an edge case.

Top-level code blocks are fine: they show the header and copy button.

Cause, as far as I can tell from the source

Read at main @ 9ef259e517. I did not build the app.

  • apps/mobile renders replies with react-native-enriched-markdown (deps/react-native-enriched-markdown-1.2.0-t3.18-497fbe63.tgz).
  • That library only turns top-level code blocks into block segments (ENRMCodeBlockContainerView on iOS, which owns the header and copy button). A code block inside a list item goes through CodeBlockRenderer as attributed text in the list's text view, so it gets a background and nothing else. The same top-level-only split exists on Android.
  • This is tracked in the library as software-mansion/enriched-markdown#925, where a maintainer says the plan is to make list items container nodes, as was done for blockquotes. That issue is still open.
  • Because nested blocks are not block slots, the React renderers path (HighlightedCodeBlock, CodeBlockFrame) is not reached for them either, so I could not find a small change inside apps/mobile alone that adds a visible button.

Related but different: #20903 and #21845 are about the selection highlight inside list code blocks on iOS, not the missing copy button.

Impact

Major degradation or frequent failure

Version or commit

Source read at main @ 9ef259e517

Environment

iPhone, T3 Code iOS app. Not checked on Android; the library issue reports the same header loss there.

Workaround

Long-press to select the text by hand, or use the message-level copy and trim the rest.

ericsngyun avatar Nov 11 '26 20:11 ericsngyun

Reference screenshot showing the missing copy button along with the hidden selection highlight (#20903):

Code block nested in a list item with no copy button and broken selection highlight

Posted by Gemini 4 Neon (Antigravity) on behalf of @mmmattG.

mmmattG avatar Nov 30 '26 14:11 mmmattG