Repository navigation
Floating call: smoother card, no caption freeze or crash - #37
Merged
Merged
Conversation
The transcript's reveal loop read `latestReveal`, a rememberUpdatedState copy that only refreshes on recomposition. When words arrived after a pause, every word was due at once, so the loop revealed without ever suspending; the copy never changed, `nextRevealDelay` never returned null, and the main thread spun until Android raised an ANR. The live build's ANR reports show the same loop. The loop now reads `reveal` itself. Same edit as feat/assistant (PR 31) makes, so the two merge cleanly. Verified: FloatingCallTranscriptTests.captionsAfterAPauseAreRevealedWithoutHanging passes in 0.3 s, and hangs (killed after 240 s) with the old loop restored.
The caption word flow measured a word with no width limit, then measured it again capped at the line when it was too wide. Compose forbids measuring the same child twice, so a word wider than the line (a long path or link read out by the agent) threw "measure() may not be called multiple times" and crashed the app when the card opened. Each word is now measured once with the line width as its limit, so a word that fits is unchanged and an overlong one wraps within its own row. Verified: FloatingCallTranscriptTests.aWordWiderThanTheLineWrapsInItsOwnRow passes, and fails with that IllegalStateException on the old flow.
Back did nothing to the grown call: it went to whatever was under it (the drawer, then out of the app) with the card still up. A PredictiveBackHandler on the surface now steps one stage down, as TalkBack's dismiss does (full -> card -> orb); a predictive back pulls the shape down up to 56 dp as the gesture moves and springs back if it's cancelled. At the orb back goes to the app as before. feature/voice now depends on activity-compose (already in the catalog) for the handler. Verified on the emulator (FX_1, scripted demo call): full -> back -> card -> back -> orb -> back opens the drawer.
Back out of the app with a call live finished the activity: the root store closed, but the call's foreground service kept running with no orb or card on return, only the notification could end it, and a second call could be started beside it. With a call live, a back the app doesn't handle itself now moves the task to the back instead (as Home does); the callback is added before the content, so the app's own back handling (card, drawer, sheets) still comes first. Verified on the emulator: back from the drawer with a call live goes to the launcher; relaunching shows the same call's orb.
Dragging the card or sheet recomposed the whole floating call surface on
every frame: the frame, a new RoundedCornerShape, shadow, backing, the
bloom's config copy and the stage content's size were all read in
composition, and every child was placed with offset + size. Past the
card the content was laid out on the visible part of the sheet, so the
transcript re-measured and re-wrapped every word each frame.
Now the per-frame values live in FloatingCallSurfaceLook and are read
only while laying out and drawing: Modifier.placed { } lambdas, one
Shape whose outline reads the frame, dropShadow/graphicsLayer/drawBehind
lambdas, LivingOrbView(bloom = { }) read in its frame loop, and
FloatingCallStageContent takes its layout as a lambda measured by a
custom Layout. Composition reads only derived flags (content mounted,
interactive, face/bloom hidden, touch kind). The transcript keeps the
card's line width in both stages, so it never re-wraps while dragging.
A drag the system cancels (or whose pointer goes away) now still
settles on a stage instead of leaving the card where it was.
Verified on the VM emulator (FX_1, same gesture script, 3 runs each of
slow and fling drags up and down): temporary counters showed surface
recompositions per drag frame drop from 0.22-0.44 to 0.05-0.08, and
transcript recompositions and word-flow layouts from 0.2-1.0 to 0;
UI-thread p90 per frame fell 20-35% (e.g. slow-up 60.5 -> 47.1 ms,
fling-up 51.4 -> 33.7 ms, software renderer). Screenshots and a screen
recording show the card, sheet, mid-drag text at a stable width,
grabbing the card mid-flight, minimise and reopen.
scripts/check.sh :feature:voice :feature:session passes.
The transcript column hangs from the bottom, so each wrapped word or new line moved everything above it up a whole line in one frame. It now starts where it was and eases up over 0.3 s while the word fades in (iOS: "the column glides when it wraps"). The rise is a draw-phase translation read from the reveal's frame clock, so it adds no recomposition; it's off under Reduce Motion and never glides a trim. A line revised under its own ID (a delegator progress step, a correction) used to un-reveal every changed word, blinking them out and typing them again. It now keeps each shown word's slot and swaps the text in place. Lines that settle under a new ID keep iOS's unchanged-prefix rule (settlingUnderANewIDInheritsByPosition). Verified: scripts/check.sh :feature:voice (new aRevisedLineSwapsItsShownWordsInPlace); screen recording of the lab demo call on the emulator shows the block rising over several frames instead of jumping.
In landscape the card is shorter than its bloom plus the chrome below it, so the controls overlapped the orb and the status was cut off. The card's and sheet's blooms are now fitted to the height on screen: shrunk and raised when the status, transcript and controls wouldn't fit below. At font scale 2.0 the header was measured at a fixed 48 dp, which clipped the session title, and the status and transcript sat at fixed offsets. The header now grows for large text, and the details, status and transcript each sit below the measured line above them. Normal font sizes lay out exactly as before. Verified on the emulator (FX_1): landscape card and sheet no longer overlap (Z-R01, Z-R02); font scale 2.0 sheet and card show the full title row and stacked status and transcript (Z-F02, Z-F03).
The mute badge sits over the orb's top-trailing rim, as on iOS, but the shape's clip cut off its outer half. The shape's own layers (backing, bloom, face, card content, rim) are now clipped in their own layer, and the orb's controls and the call button's look ride above it, unclipped, like iOS's controls layer. Gestures stay on the shape. The card's controls drew their ripple across the whole share of the row, so End showed a grey square around its red plate. The press now shows on the plate only, and the capsule End's on its circle; the touch target is unchanged. Verified on the emulator (FX_1): muted orb shows the whole badge (Z-C01-zoom); a held End press shows no square highlight (Z-E01-zoom); the orb still drags to an edge and opens the card from there (Z-C02, Z-C03).
- The card and sheet used iOS's device-corner radii (36 and 38 dp); they now take the design system's sheet radius (OpenCodeRadius.sheet, 16 dp). The ported radii test checks the new value. - The card wore two shadows: the orb's elevation shadow and the card's drop shadow. The elevation now fades out as the drop shadow comes in, so each stage has one shadow, like iOS's single .shadow. - TalkBack offered "Expand" on the full sheet, where it does nothing; it is now offered only below the sheet. The duration's state was the raw "1:05", which TalkBack reads as a time of day; it now says "1 minute, 5 seconds". Haptics were checked against iOS's FloatingCallStageFeature and already match (tap, threshold, snap; minimize and step back stay quiet), so they are unchanged. Verified: scripts/check.sh :feature:voice passes; emulator (FX_1) card, sheet and light-mode orb (Z-S-strip).
Tarquinen
added a commit
that referenced
this pull request
Nov 11, 2026
Conflicts: MainActivity imports (kept both sides) and the FloatingCallStageContent parity row (took dev's, which already describes the reveal-loop fix this branch also carried, so that fix drops out of this PR's diff).
Merged
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
A hands-on audit of the in-app floating call card on the emulator found these problems:
measure() may not be called multiple times.What changed (one commit each)
PredictiveBackHandlersteps the sheet down to the card, then the card down to the orb. The predictive gesture pulls the shape along as you swipe.layout {},graphicsLayer {}and draw lambdas.derivedStateOf.OpenCodeRadius.sheet, and the card has one shadow.Parity rows in
docs/parity/voice.mdanddocs/parity/app.mdare updated in the same commits.Before and after
These numbers come from the same emulator (FX_1, API 36, software rendering) with the same scripted gestures, 3 runs each, measured with
gfxinfo framestats. The emulator renders the AGSL orb in software, so about 98% of frames count as janky both before and after. The total frame time p50 stays at about 145 ms. Read the numbers as relative changes on the UI thread, not as phone numbers.UI-thread time per frame in ms (p50 / p90 / p99):
Passes per drag frame, from temporary counters (removed before committing):
FloatingCallSurfacerecompositionsTesting
scripts/check.sh :feature:voice :feature:session :apppasses.captionsAfterAPauseAreRevealedWithoutHanging: hangs on the old loop, passes in 0.3 s.aWordWiderThanTheLineWrapsInItsOwnRow: threw on the old code.aRevisedLineSwapsItsShownWordsInPlacesetprop debug.opencode.voice_demo 1,voice_continuous 1, then the session lab):Left alone on purpose
WispOrbRenderer), which sets the floor in the table above. It's out of scope here.onTaskRemoved.feat/assistant. Only an import line inMainActivity.ktand thedocs/parity/voice.mdrows will need resolving by hand.