Skip to content

fix(transcript): lay out only the shown lines of a folded user bubble - #307

Merged
Tarquinen merged 1 commit into
devfrom
crash-305
Nov 25, 2026
Merged

Tarquinen merged 1 commit into
devfrom
crash-305

Conversation

@Tarquinen

Copy link
Copy Markdown
Member

Fixes #305

Scrolling past a long pasted message (a few thousand lines) froze the app until Android showed "isn't responding". The folded bubble shows 8 lines, but it laid out and drew the whole message on every frame. Clipping doesn't help, because Compose widens a Text's clip and Android then draws every line.

Now a closed fold lays out only 15 lines. Show More, and the animation back to closed, still lay out the whole text, and TalkBack still reads all of it. Nothing visible changes.

  • The 15th line ends in an ellipsis. It sits under the fade, so it never shows, but without it Android still builds every line past maxLines.
  • 15 rather than 13 because the bubble's 24 sp rows are shorter than the fold limit's 25 sp step (23 sp line height + 2 sp spacing), so 13 rows can fall under the limit and stop folding. The new test checks this, and it fails with 13.
  • Session chips past the cut are skipped, so a long message with ses_... links doesn't measure them every frame.

On the emulator (debug build, session-lab user messages of 3,000 and 30,000 lines, tapping the list every second), dev ANRs with Play's stack (TextStringSimpleNode.draw in UserBubbleFoldView). This branch doesn't ANR, scrolls both without janky frames, and still folds with Show More. vm.sh check passes. Opening Show More on a huge message still draws all of it, the same problem as #279.

A folded user bubble laid out and drew its whole message on every frame,
with only 8 lines showing. Compose widens a Text's clip, so Android draws
every line. A pasted log of a few thousand lines froze the main thread in
Layout.draw while scrolling (Play ANR in UserBubbleFoldView).

A closed fold now lays out UserBubbleFold.closedLines (15), ending in an
ellipsis under the fade. Without the ellipsis, StaticLayout still builds
every line past maxLines. Open, or animating, it lays out the whole text
as before. 15 rather than 13 because the bubble's 24 sp rows are shorter
than the fold limit's 25 sp step (23 sp line height + 2 sp spacing), so
13 rows can fall under the limit. Session chips past the cut are skipped.

Verified: on the emulator (debug build), a session-lab user message of
3,000 lines ANRs on dev with Play's stack; on this branch, 3,000- and
30,000-line messages don't ANR and scroll without janky frames, and the
bubble still folds with Show More. vm.sh check passes.

Fixes #305
@Tarquinen
Tarquinen merged commit cab26e5 into dev Nov 25, 2026
3 checks passed
@Tarquinen
Tarquinen deleted the crash-305 branch November 25, 2026 03:36
ClankerGuru pushed a commit to ClankerGuru/opencode-android that referenced this pull request Nov 25, 2026
…ns (anomalyco#227)

* perf(system): stop republishing shortcuts while a session runs

Every session.updated during a run changed the session's updatedAt, which
was part of the published directory entry, so Home republished it: the
quick actions were removed and re-added, the controls refreshed, and the
directory file and AppSearch docs rewritten. Ports iOS anomalyco#307 (464576fa):
entries carry no session times (the list order already says which is
newest), and the publisher drops a publish identical to its last job.
AppSearch documents no longer set a creation time from updatedAt.

Verified: vm.sh check (full) passes; the ported tests
anEntryThatComesOutTheSameIsntPublishedAgain and
aRunOnTheNewestSessionChangesNoEntry fail without the fix.

* fix(system): republish when the app's language changes; review fixes

The publisher dropped a publish identical to its last job, so after an
in-app language change (the activity recreates in the same process) the
quick actions kept their old labels. Publish jobs now carry the locale.

Also from review: the drawer churn test keeps the iOS name and checks
the share targets too; the parity rows note what 464576fa parts Android
skips and list SystemChurnTests.swift.

Verified: vm.sh check (full) passes; the new locale step fails with the
locale left out of the job.
technicalheist pushed a commit to technicalheist/opencode-android that referenced this pull request Nov 28, 2026
* perf(system): send Live Update steps at most every 1.5 s

While an agent worked, the session's ongoing notification was reposted for
every new step. Android drops an app's notification updates that come too
fast, so a later, important one (Needs your input, Done) could be lost.

SessionActivityStepThrottle now sits behind SessionLiveActivityClient.update:
a working run's step-only changes go out at most once per 1.5 s (the latest
wins). A start, rename, Needs your input, Done, Failed or end goes at once in
place of a held step, and a held step goes out when the app leaves the
foreground (ProcessLifecycleOwner pause). Ports iOS anomalyco#307 (464576fa).

Verified: ported iOS SessionActivityStepThrottleTests into
SessionLiveActivityTests (3 of 4 fail with the hold disabled); full
scripts/check.sh on the VM; on an emulator with session-lab and the
session-live-activity experiment, a send posts the session-run notification,
it settles to Done, and going Home doesn't crash.

* refactor(system): keep the step throttle file-private and say when it flushes

Review follow-up. The throttle's shared instance is now a file-private lazy
behind SessionLiveActivityClient.Key, not a module-visible singleton. The KDoc
and parity row now say that ProcessLifecycleOwner reports leaving the
foreground about 0.7 s after the last activity pauses. The system parity Tests
table gets the SessionActivityStepThrottleTests row and the real total (118).

Verified: full scripts/check.sh on the VM.
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.

Freeze: Input dispatching timed out in TranscriptUserBubbleKt.UserBubbleFoldView$lambda$3$0$0

1 participant