Repository navigation
Commit 5b44d84
fix(mobile): stop Android user bubbles with code blocks from overlapping
On Android a user message containing a fenced code block draws its
paragraphs on top of each other inside a hugely over-tall bubble, and
the overflow paints over the following rows in the feed.
The bubble sizes itself from its content (`maxWidth`, no `width`), so a
child whose intrinsic width is unbounded — the code block's horizontal
ScrollView — forces a clamp. Android positions the bubble's children
during the unclamped intrinsic pass, where the surrounding paragraphs
collapse to a single line, and never repositions them once the width is
clamped back to `maxWidth`.
Measured on a Pixel 8, the paragraph is laid out 612px tall while the
code block that follows it is placed 28px below the paragraph's *top* —
an overlap of 584px.
Pinning the bubble's width removes the intrinsic pass, which is the same
reason review-comment bubbles already carry an explicit width. Applies
to GFM tables too, which use the same horizontally scrollable renderer.
iOS is unaffected: it renders markdown through the native
SelectableMarkdownText view, which has no nested block children.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>1 parent 45d9aa9 commit 5b44d84
3 files changed
Lines changed: 74 additions & 1 deletion
File tree
- apps/mobile/src
- features/threads
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
876 | 877 | | |
877 | 878 | | |
878 | 879 | | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
879 | 886 | | |
880 | 887 | | |
881 | 888 | | |
| |||
898 | 905 | | |
899 | 906 | | |
900 | 907 | | |
901 | | - | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
902 | 913 | | |
903 | 914 | | |
904 | 915 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments