Skip to content

fix(transcript): stop list items crashing the transcript on scroll - #261

Open
Tarquinen wants to merge 2 commits into
devfrom
baseline-rows-crash
Open

Tarquinen wants to merge 2 commits into
devfrom
baseline-rows-crash

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

The transcript crashes with "LayoutNode N not found in RectList" while scrolling. In Play's 28-day data, 48 of the 51 readable groups for this crash share one layout chain: a full-width padded Row aligned by baseline, inside a lazy transcript item. Their per-group user counts add up to about 250; that double-counts people who hit several groups.

Compose UI 1.12.1 throws when a Row reads its children's baselines during measure while a lazy item swaps their content (b/549552303). The markdown list item is the likely trigger: it is the only Row in the transcript whose marker and body used alignByBaseline() on that chain. I couldn't reproduce the crash with the real list item, so this is likely rather than confirmed.

Now both sides align by the first baseline their text reports in onTextLayout, so the Row never queries alignment lines.

Moving to Compose 1.13 is the full fix, but it needs compileSdk 37.1, which we don't have yet. The composer's fold layout (#248) has the same cause and still waits on that upgrade.

Before (dev) on the left, after on the right:

font 1.0 light
font 1.0 dark
font 2.0 light
font 2.0 dark

  • Before and after screenshots of bulleted, numbered, nested and task lists (light and dark, font scale 1.0 and 2.0) match pixel for pixel, apart from the animating spinner.
  • Streamed the session-lab showcase (replies with lists) while scrolling: logcat -b crash stayed empty.
  • No regression test: Robolectric reproduces the crash only with a synthetic layout, not with the real list item.
  • scripts/check.sh passes.

Part of #242, #243, #250 and #254.

The app crashed with "LayoutNode N not found in RectList" while the
transcript scrolled (Play: about 250 users across ~48 groups on 0.7.0
and 0.8.0). Compose UI 1.12.1 throws when a Row reads its children's
baselines during measure while a lazy item swaps their content
(b/549552303, fixed in 1.13.0). The markdown list item Row was that
Row: its marker and body Boxes used alignByBaseline().

Both sides now align by the first baseline their Text reports in
onTextLayout, so the Row no longer queries alignment lines and the
marker still sits on the text's first baseline.

Verified: scripts/check.sh passes; on the emulator with session-lab,
before/after screenshots of bulleted, numbered, nested and task lists
(light and dark, font scale 1.0 and 2.0) are pixel-identical apart
from an animating spinner; streaming the showcase replies with lists
while scrolling left logcat -b crash empty.
From review: a one-line comment so the list item isn't put back on
alignByBaseline() before Compose 1.13, the parity row for the
Android-only alignment, and a nullable onTextLayout so other text
doesn't call an empty callback.

The baselines stay in snapshot state. A throwaway Robolectric test
showed a plain holder misaligns the marker when the body's baseline
moves without the Row being remeasured (marker 13 px, text 33 px);
state keeps them aligned for one extra Row measure.

Verified: scripts/check.sh passes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant