From 68a836ce34d421890ad687506efaae14520f36ed Mon Sep 17 00:00:00 2001 From: Dan Smolsky Date: Tue, 17 Nov 2026 02:07:16 -0500 Subject: [PATCH] Animate the call failure and Call Ended cards in and out The Couldn't Start Call and Call Ended cards above the composer were plain ifs: a card appeared in one frame over the transcript, then the transcript jumped up by its height, and Close cut it out so the transcript dropped. Now the cards use the server pill's presence transition (ServerConnectionPillTransition: expand + fade in, shrink + fade out, with Reduce Motion). The leaving card stays drawn as it last read, even after the call store is gone. The Connecting caption also hides when the call store goes away, so it fades out instead of being cut. Verified: vm.sh check :feature:session passes. On the VM emulator with the voice demo and a forced failure, before/after recordings at real speed and 5x animator scale, light and dark: the card grows in and the transcript rises with it; Close shrinks and fades it while the transcript slides down. Not checked on a phone. --- docs/parity/session.md | 2 +- .../feature/session/SessionViewCall.kt | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/docs/parity/session.md b/docs/parity/session.md index 76ce29f7d..8fb755ce7 100644 --- a/docs/parity/session.md +++ b/docs/parity/session.md @@ -65,7 +65,7 @@ Status values: `todo`, `partial: `, `done`, `n/a: ⌄"`; “Choose model” + value) f0670c5d: sections, the current ID and favourites computed once per redraw and passed to rows. Its sheet: `OpenCodeBottomSheet`; `OpenCodeSheetHost` in Home draws `BottomSheet` + `Scrim` above Home's chrome without allocating a Dialog/ViewRoot on open; captures presenting composition locals, hides covered semantics, saves/restores focus and blocks background keyboard traversal. The covered screen sees the keyboard only down to the lowest point it has reached since the sheet opened (`KeyboardLeavingInsets`): a keyboard leaving as the sheet opens is followed to its end, so the composer rides down with it (iOS order: keyboard and composer leave together, sheet rises over them), and a keyboard raised by the sheet's own Search is never seen. Before, the covered screen consumed all of `WindowInsets.ime` the moment a sheet showed, so the composer dropped behind the still-visible keyboard and left an empty band (QA A-02). Back during entrance is consumed while M3's own predictive Back handler is still disabled (`currentValue == Hidden`); visible sheets retain native Back behavior. Embedded composers without that host retain `ModalBottomSheet`. Sync b1c67259 (ea61212b): `restoreFocusAfterModelList` no longer checks the tray; Android never had that term. Sync e5c22780: `canPresentOnePickerMorph = !isAnsweringRequest`; restoring focus no longer checks the call. Android-ify: system back folds an open One Picker away (`BackHandler` → `closeOnePicker`); iOS has no back. Sync 03adf07a (d0b24aaa): One Picker is the only picker: the Today sheet, `usesOnePicker` and the switch reads are gone; the sheet route (`ModelPickerDetents`) is `OnePickerSheetHost`; closing freezes `onePicker.catalogCache.shownSections`, the rows already built.A hardware Escape hides the sheet as the scrim does (composer `EscapeHandler`, on the window's callback since the host holds no focus; iOS sheets close on Esc; QA L-04). | | `OpenCode/Session/SessionView+PhotoSheet.swift` | 889 | `SessionAttachmentMenuState.kt` | partial: the photo sheet; only the + menu's state (`attachmentMenu`, `attachmentMenuRestoresFocus`, `closeAttachmentMenu`) is ported | Android uses the system photo picker, so the in-app photo sheet is not ported. | -| `OpenCode/Session/SessionView.swift` | 663 | `SessionView.kt`, `SessionViewLifecycle.kt`, `SessionViewChrome.kt`, `SessionViewCall.kt`, `SessionBrowserPage.kt`, `SessionVoiceLabTriggers.kt` | done | iOS 26's soft scroll edge under the composer is `SessionBottomScrollEdge`, a canvas gradient over the composer surface's corner radius. `ComposerKeyboardStepHold` (0969ae66): composer's `Modifier.composerKeyboardStepHold()` on the composer column inside its IME padding, before its height report. Home (`:feature:drawer`'s `HomeView`) hosts it in `SessionPageStack`: pushed subagents get `onBack` and the root's call as `hostedCall` (wired); the browser page is pushed over the screen that opened it (`sessionBrowserStackPage`/`SessionBrowserPage`, Back → `.browser(.closeTapped)`); Catch Up's preview card is an inert `SessionView` on a store that only takes `.firstContentFrameRendered`/`.previewStateReplaced`. Call (`SessionViewCall.kt`): `callStore` (own `voice` or `hostedCall`), `.startIfNeeded` once per call, Raise to Talk via `RaiseToEarClient.monitor` while the setting is on, Voice available and the app resumed, the GPT-Live `LiveSocketWarmerClient` loop (`maxAge / 2`, cooled unless a call took it), `VoiceCallFailure`/`VoiceCallEnded` cards above the composer (plus `VoiceConnectingCaption` while a call connects through a server, iOS `SessionView`; the failure card's Open Settings goes through voice's `VoiceCallFixClient`), `LocalDotScopeCovered` while covered, `DotScopeRenderer.prepare()`; `rememberFloatsCall` is iOS `floatsCall` (Living Orb on). Floating Call/Living Orb keep the composer and report its frame (`floatingCallComposer`) and the call button (`floatingCallButton`, `breakoutFrom`, phone.fill) for Home's `FloatingCallOverlay`. `ProviderIcon` moved down to `:core` (`ui/ProviderIcon.kt`, icons in `core/src/main/assets/provider-icons`). `markVisibleSession` → `SessionNotificationsClient.setVisibleSession` on scene, visibility, cover and session changes, false on dispose. Decoded images through `:feature:media` `DecodedImageCache`; `ModelProviderGroup` is `:server`'s. + menu: composer's `AttachmentMenuMeasure` + `plusmenu/PlusMenuGlassSurface` + `AttachmentMenuDismissArea` (system Back closes); rows as iOS `attachmentMenuItems` (Camera when `FEATURE_CAMERA_ANY`, Photos, Files, Location, Paste while `PasteboardClient.hasImages()` as the menu opens). Camera: `SessionAttachmentCamera` (composer's `AttachmentCameraView` in a full-screen black dialog; the photo imports via `captureCameraPhoto`, then the keyboard returns). Paste (tap only): `pasteClipboardImages` reads `PasteboardClient.imageURIs` into the image importer and the menu closes, restoring focus. `.requests` → composer's `RequestReviewSheet`. The screen registers the `LocationPermissionPrompt` launcher while it's on top; the microphone (dictation and calls, asked as they start like iOS `requestRecordPermission()`) is asked through the requesters `MainActivity` registers. `VoiceLabTriggers` (DEBUG) → `SessionVoiceLabTriggers`: broadcasts named `OpenCodeLab.` while `VoiceLabDemo` runs. Media viewers: the app's `MediaView` when one hosts the screen, else the session mounts its own. Browser: media's `BrowserPage` with the session's peek, Working indicator and Back (`browserBackAction`). Sync to f657969b: Since You Left removed (cd6be7c6); the Server Flow pill's `onConnectionAction` and held working line (d8a311bd); Motion Watch's sheet hook (76c03735) n/a (no Motion Watch). One Picker: its backdrop sits under the composer column and the composer takes `Modifier.modelPanelsComposer`. Sync fc25a553 (voice): ported only the Living Orb hunks: `SessionFloatingCallCoverage` beside the lifecycle (d1b1af4e) and `floatingCallComposerColumn()` on the composer column while floating and uncovered (90ba43e2). Sync 8705cdb4: `holdsClientToolCard` clears what's over the composer (keyboard, + menu, background work, model panels); `SessionVoiceLabTriggers.kt` takes `playAudio` plus Android's `requestScreen`/`openLink` lab triggers (session-lab has no client MCP socket). Sync orb-default (iOS e1da9389..ad33c3a7): Orb clearance: the composer area pads its top by `FloatingCallRestArea.clearance` while a live call floats there, on the follow spring (0.2 s ease under Reduce Motion). Sync timeline-motion (iOS 812b9ab5..1793b4bd): the pill row joining or leaving animates the composer’s top (no bounce, none under Reduce Motion), so the transcript moves with it. Sync b1c67259 (iOS 569e6f30, p217): Plus Menu always on: the + always opens the composer's menu over the composer, Photos opens the photo sheet, the peek and flight canvas always mount; `AttachmentMenuSheet` removed. Sync b1c67259 (iOS 35055c3f): the resting Plus Menu surface is `clearAndSetSemantics` (iOS `accessibilityHidden(plusMenuRests)`). Sync b1c67259 (0fbb99f8): no `ModelPickerAnchors`; `SessionModelPickerOverlays(store, headerHeight)` resets One Picker when its switch goes off and only settles it when the scene goes inactive; the model list haptic, glass trace and search keyboard hold went with Grow. Sync b1c67259 (ea61212b): the `callTray` parameter and Tray style are gone; the call floats with Living Orb on, else the composer holds the call bar. Sync b1c67259 (9972785b): `SessionLifecycle` moved to `SessionViewLifecycle.kt`; `DrawerGlyph`, `RequestBarSwap` and `ComposerSwap` to `SessionViewChrome.kt`. Sync e5c22780: no `floatsCall`; the orb's composer modifiers always apply; `showsCallTranscript` gone. QA S-01 (system Photo Picker): Photos without library access asks the picker for `maxPhotoSelection(plusMenu = true)` (8, iOS `AttachmentPicker.swift:23`), and `importPickedMedia` and `startImageImport` keep that many, not main's 4. 70Sync dccec82e (dccec82e, 52ae8547): the raise monitor passes `callIsLive = { voice != null }`; the root records window touches for the composer double tap. Android fix: in a Catch Up card the header band, request panel room, transcript padding, One Picker ceiling and photo sheet read the keyboard and bars through `inContainer()` (`:core` `ui/ContainerInsets.kt`), the card's edges as iOS's safe area gives them. Sync 71e84d71 (d1a9e59f): `composerSideMargin`/`composerKeyboardSideMargin` live in `ComposerAreaContent`; a Catch Up card keeps its 12 dp clearance at rest and with the keys up (Android used the 20 dp margin in cards before; now as iOS). `CATCH_UP_COMPOSER_CLEARANCE` is internal. Sync 440b77f0 (1385761f):QA A-04: `isImportingAttachments` is read from the importers in composition and only handed to the host in the `SideEffect` (reads there aren't observed), so the + menu mounts `AttachmentMenuMeasure` (the dead overlay is gone) before `PlusMenuGlassSurface`. Sync 03adf07a (d0b24aaa, 8bd26820): orb clearance reads its geometry only in leaves: `OrbClearanceGeometry` (written by `onGloballyPositioned`)comes back as soon as an import lands, as iOS observes `imageImporter.isLoading | fileImporter.isLoading` directly. TalkBack reads the header, then the transcript, then the composer, as VoiceOver reads iOS's top header overlay first: the screen is a traversal group and the header, drawn over the transcript, comes first in it (QA P-06). The transcript is composed while the screen measures, after the composer and the `OrbClearance` composable compute the room only during a live call, and `Modifier.orbClearancePadding` reads it at layout,header (`ComposedAfterComposer`, a `matchParentSize` `SubcomposeLayout`), so its first frame has both measured heights in its insets, as iOS lays the composer out before the list (K-02/F-44). QA F-09: only an image import holds Send, the dictation Send and Ctrl+Enter (`isImportingImages`, iOS `imageImporter.isLoading`, SessionView+ComposerControls.swift:465/513, SessionView+Composer.swift:824); a file import only spins the +, so a moving composer doesn't recompose the session screen. Glass touch handoff (8bd26820) n/a. Sync 01eef583 (0f24fbf3): `OrbClearance` on `layout`;send during it goes and the file lands in the draft after. background-work capsule, then the and the rest by place is `BackgroundWorkPresentation`'s (around the screen and the capsule drawn over it),). The capsule is ordered by its place in the pill row above the composer (iOS `SessionView+Composer.swift:209-241`, its button `BackgroundWorkPanel.swift:518-526`), not after the composer column on `layout` (in `SessionViewComposer.kt`).as when only the screen was the group (QA AB-02QA W-06: `isInertPreview` skips interactive sheet/picker/flight overlays and `SessionPhotoSheetEnvironment` / `PlusPhotoSheet` prewarm on Catch Up's non-interactive preview card (`CatchUpChrome.swift:129-150`). Android-only (anomalyco/opencode#63019): the composer rests on `bottomSafeArea`, the navigation bar but at least 8 dp, since HyperOS with the gesture hint hidden reports a 0 navigation bar; the transcript, request panel room and photo sheet read the same floor. iOS PR #335 (561854a, not on iOS main yet): `presentImage`/`presentFile` pass `drawingHandler` (Android: `SessionTranscriptView.handle`'s `PreviewImage` and `OpenFile`). Android divergence (AGENTS.md): no send flight or shrink-on-send; the sent bubble arrives in the bottom-anchored list while the composer card resets (`ComposerSendReset`: the old content fades out quickly as the card's top edge slides down on `animateContentSize(alignment = BottomStart)`). Sync 911ab132 (1735b12e): `SessionCallTasks` warms GPT-Live for one `warmWindow` and not on a covered screen or a Catch Up card. Sync 911ab132 (c056c55c): Raise to Talk listens only on the front screen or the call's own screen, and `RaisedToEar` is ignored while covered. iOS's `ProximityMonitoring` holder count isn't needed: each `RaiseToEarDetector` unregisters only its own listener. | +| `OpenCode/Session/SessionView.swift` | 663 | `SessionView.kt`, `SessionViewLifecycle.kt`, `SessionViewChrome.kt`, `SessionViewCall.kt`, `SessionBrowserPage.kt`, `SessionVoiceLabTriggers.kt` | done | iOS 26's soft scroll edge under the composer is `SessionBottomScrollEdge`, a canvas gradient over the composer surface's corner radius. `ComposerKeyboardStepHold` (0969ae66): composer's `Modifier.composerKeyboardStepHold()` on the composer column inside its IME padding, before its height report. Home (`:feature:drawer`'s `HomeView`) hosts it in `SessionPageStack`: pushed subagents get `onBack` and the root's call as `hostedCall` (wired); the browser page is pushed over the screen that opened it (`sessionBrowserStackPage`/`SessionBrowserPage`, Back → `.browser(.closeTapped)`); Catch Up's preview card is an inert `SessionView` on a store that only takes `.firstContentFrameRendered`/`.previewStateReplaced`. Call (`SessionViewCall.kt`): `callStore` (own `voice` or `hostedCall`), `.startIfNeeded` once per call, Raise to Talk via `RaiseToEarClient.monitor` while the setting is on, Voice available and the app resumed, the GPT-Live `LiveSocketWarmerClient` loop (`maxAge / 2`, cooled unless a call took it), `VoiceCallFailure`/`VoiceCallEnded` cards above the composer (arriving and leaving through `OpenCodeNoticePresence`, as the connection pill does; plus `VoiceConnectingCaption` while a call connects through a server, iOS `SessionView`; the failure card's Open Settings goes through voice's `VoiceCallFixClient`), `LocalDotScopeCovered` while covered, `DotScopeRenderer.prepare()`; `rememberFloatsCall` is iOS `floatsCall` (Living Orb on). Floating Call/Living Orb keep the composer and report its frame (`floatingCallComposer`) and the call button (`floatingCallButton`, `breakoutFrom`, phone.fill) for Home's `FloatingCallOverlay`. `ProviderIcon` moved down to `:core` (`ui/ProviderIcon.kt`, icons in `core/src/main/assets/provider-icons`). `markVisibleSession` → `SessionNotificationsClient.setVisibleSession` on scene, visibility, cover and session changes, false on dispose. Decoded images through `:feature:media` `DecodedImageCache`; `ModelProviderGroup` is `:server`'s. + menu: composer's `AttachmentMenuMeasure` + `plusmenu/PlusMenuGlassSurface` + `AttachmentMenuDismissArea` (system Back closes); rows as iOS `attachmentMenuItems` (Camera when `FEATURE_CAMERA_ANY`, Photos, Files, Location, Paste while `PasteboardClient.hasImages()` as the menu opens). Camera: `SessionAttachmentCamera` (composer's `AttachmentCameraView` in a full-screen black dialog; the photo imports via `captureCameraPhoto`, then the keyboard returns). Paste (tap only): `pasteClipboardImages` reads `PasteboardClient.imageURIs` into the image importer and the menu closes, restoring focus. `.requests` → composer's `RequestReviewSheet`. The screen registers the `LocationPermissionPrompt` launcher while it's on top; the microphone (dictation and calls, asked as they start like iOS `requestRecordPermission()`) is asked through the requesters `MainActivity` registers. `VoiceLabTriggers` (DEBUG) → `SessionVoiceLabTriggers`: broadcasts named `OpenCodeLab.` while `VoiceLabDemo` runs. Media viewers: the app's `MediaView` when one hosts the screen, else the session mounts its own. Browser: media's `BrowserPage` with the session's peek, Working indicator and Back (`browserBackAction`). Sync to f657969b: Since You Left removed (cd6be7c6); the Server Flow pill's `onConnectionAction` and held working line (d8a311bd); Motion Watch's sheet hook (76c03735) n/a (no Motion Watch). One Picker: its backdrop sits under the composer column and the composer takes `Modifier.modelPanelsComposer`. Sync fc25a553 (voice): ported only the Living Orb hunks: `SessionFloatingCallCoverage` beside the lifecycle (d1b1af4e) and `floatingCallComposerColumn()` on the composer column while floating and uncovered (90ba43e2). Sync 8705cdb4: `holdsClientToolCard` clears what's over the composer (keyboard, + menu, background work, model panels); `SessionVoiceLabTriggers.kt` takes `playAudio` plus Android's `requestScreen`/`openLink` lab triggers (session-lab has no client MCP socket). Sync orb-default (iOS e1da9389..ad33c3a7): Orb clearance: the composer area pads its top by `FloatingCallRestArea.clearance` while a live call floats there, on the follow spring (0.2 s ease under Reduce Motion). Sync timeline-motion (iOS 812b9ab5..1793b4bd): the pill row joining or leaving animates the composer’s top (no bounce, none under Reduce Motion), so the transcript moves with it. Sync b1c67259 (iOS 569e6f30, p217): Plus Menu always on: the + always opens the composer's menu over the composer, Photos opens the photo sheet, the peek and flight canvas always mount; `AttachmentMenuSheet` removed. Sync b1c67259 (iOS 35055c3f): the resting Plus Menu surface is `clearAndSetSemantics` (iOS `accessibilityHidden(plusMenuRests)`). Sync b1c67259 (0fbb99f8): no `ModelPickerAnchors`; `SessionModelPickerOverlays(store, headerHeight)` resets One Picker when its switch goes off and only settles it when the scene goes inactive; the model list haptic, glass trace and search keyboard hold went with Grow. Sync b1c67259 (ea61212b): the `callTray` parameter and Tray style are gone; the call floats with Living Orb on, else the composer holds the call bar. Sync b1c67259 (9972785b): `SessionLifecycle` moved to `SessionViewLifecycle.kt`; `DrawerGlyph`, `RequestBarSwap` and `ComposerSwap` to `SessionViewChrome.kt`. Sync e5c22780: no `floatsCall`; the orb's composer modifiers always apply; `showsCallTranscript` gone. QA S-01 (system Photo Picker): Photos without library access asks the picker for `maxPhotoSelection(plusMenu = true)` (8, iOS `AttachmentPicker.swift:23`), and `importPickedMedia` and `startImageImport` keep that many, not main's 4. 70Sync dccec82e (dccec82e, 52ae8547): the raise monitor passes `callIsLive = { voice != null }`; the root records window touches for the composer double tap. Android fix: in a Catch Up card the header band, request panel room, transcript padding, One Picker ceiling and photo sheet read the keyboard and bars through `inContainer()` (`:core` `ui/ContainerInsets.kt`), the card's edges as iOS's safe area gives them. Sync 71e84d71 (d1a9e59f): `composerSideMargin`/`composerKeyboardSideMargin` live in `ComposerAreaContent`; a Catch Up card keeps its 12 dp clearance at rest and with the keys up (Android used the 20 dp margin in cards before; now as iOS). `CATCH_UP_COMPOSER_CLEARANCE` is internal. Sync 440b77f0 (1385761f):QA A-04: `isImportingAttachments` is read from the importers in composition and only handed to the host in the `SideEffect` (reads there aren't observed), so the + menu mounts `AttachmentMenuMeasure` (the dead overlay is gone) before `PlusMenuGlassSurface`. Sync 03adf07a (d0b24aaa, 8bd26820): orb clearance reads its geometry only in leaves: `OrbClearanceGeometry` (written by `onGloballyPositioned`)comes back as soon as an import lands, as iOS observes `imageImporter.isLoading | fileImporter.isLoading` directly. TalkBack reads the header, then the transcript, then the composer, as VoiceOver reads iOS's top header overlay first: the screen is a traversal group and the header, drawn over the transcript, comes first in it (QA P-06). The transcript is composed while the screen measures, after the composer and the `OrbClearance` composable compute the room only during a live call, and `Modifier.orbClearancePadding` reads it at layout,header (`ComposedAfterComposer`, a `matchParentSize` `SubcomposeLayout`), so its first frame has both measured heights in its insets, as iOS lays the composer out before the list (K-02/F-44). QA F-09: only an image import holds Send, the dictation Send and Ctrl+Enter (`isImportingImages`, iOS `imageImporter.isLoading`, SessionView+ComposerControls.swift:465/513, SessionView+Composer.swift:824); a file import only spins the +, so a moving composer doesn't recompose the session screen. Glass touch handoff (8bd26820) n/a. Sync 01eef583 (0f24fbf3): `OrbClearance` on `layout`;send during it goes and the file lands in the draft after. background-work capsule, then the and the rest by place is `BackgroundWorkPresentation`'s (around the screen and the capsule drawn over it),). The capsule is ordered by its place in the pill row above the composer (iOS `SessionView+Composer.swift:209-241`, its button `BackgroundWorkPanel.swift:518-526`), not after the composer column on `layout` (in `SessionViewComposer.kt`).as when only the screen was the group (QA AB-02QA W-06: `isInertPreview` skips interactive sheet/picker/flight overlays and `SessionPhotoSheetEnvironment` / `PlusPhotoSheet` prewarm on Catch Up's non-interactive preview card (`CatchUpChrome.swift:129-150`). Android-only (anomalyco/opencode#63019): the composer rests on `bottomSafeArea`, the navigation bar but at least 8 dp, since HyperOS with the gesture hint hidden reports a 0 navigation bar; the transcript, request panel room and photo sheet read the same floor. iOS PR #335 (561854a, not on iOS main yet): `presentImage`/`presentFile` pass `drawingHandler` (Android: `SessionTranscriptView.handle`'s `PreviewImage` and `OpenFile`). Android divergence (AGENTS.md): no send flight or shrink-on-send; the sent bubble arrives in the bottom-anchored list while the composer card resets (`ComposerSendReset`: the old content fades out quickly as the card's top edge slides down on `animateContentSize(alignment = BottomStart)`). Sync 911ab132 (1735b12e): `SessionCallTasks` warms GPT-Live for one `warmWindow` and not on a covered screen or a Catch Up card. Sync 911ab132 (c056c55c): Raise to Talk listens only on the front screen or the call's own screen, and `RaisedToEar` is ignored while covered. iOS's `ProximityMonitoring` holder count isn't needed: each `RaiseToEarDetector` unregisters only its own listener. | | `OpenCode/Session/ShellOutputFeature.swift` | 283 | `ShellOutputFeature.kt` | done | Adds TaskEnded/ShareOutputTapped actions (Android lifecycle/share). Sync 3f473f75 (f261300b): a failing server is backed off (`retryDelay`: 3, 6, 12, 24, 30 s). | | `OpenCode/Session/ShellOutputView.swift` | 370 | `ShellOutputView.kt` | done | UITextView → LazyColumn keyed by byte offset; 32dp follow rule. Lines are re-split only from the last line on when output grows. The status bar stays at the visible foot (`safeAreaBar(edge: .bottom)` at `.medium`): while the sheet moves, only the output box takes the new height (bars keep constant constraints), and a following reader is anchored to the bottom in the same layout pass (`requestScrollToItem`, never during the reader's own drag). Footer placement reads same-frame window coordinates, avoiding a one-frame lag when M3 consumes the top safe inset during a drag. The session uses `OpenCodeBottomSheet` (in-window M3 `BottomSheet` + `Scrim`, medium/full anchors) to avoid allocating a new Dialog/ViewRoot for each presentation. Sync 01eef583 (0f24fbf3): the jump-to-latest button on `MotionTransition.micro`. | | `OpenCode/Session/SessionFeature+Undo.swift` | 104 | `SessionFeatureUndo.kt` | done | New (706638fe): split out of SessionFeature+Send; holds `returnToComposer`, `stageRevert`, `hydrated`, `reportRevertError` and `fillComposerDraft`. | diff --git a/feature/session/src/main/kotlin/ai/opencode/feature/session/SessionViewCall.kt b/feature/session/src/main/kotlin/ai/opencode/feature/session/SessionViewCall.kt index 21e4474cd..8b88d35bf 100644 --- a/feature/session/src/main/kotlin/ai/opencode/feature/session/SessionViewCall.kt +++ b/feature/session/src/main/kotlin/ai/opencode/feature/session/SessionViewCall.kt @@ -6,6 +6,7 @@ import ai.opencode.core.sharing.shared import ai.opencode.core.experiments.key import ai.opencode.core.store.StoreOf import ai.opencode.core.store.observe +import ai.opencode.core.ui.OpenCodeNoticePresence import ai.opencode.feature.session.SessionFeature.Action import ai.opencode.feature.session.SessionFeature.State import ai.opencode.feature.voice.LiveSocketWarmer @@ -110,20 +111,25 @@ internal fun SessionCallTasks(store: StoreOf, callStore: VoiceSto */ @Composable internal fun SessionCallCards(callStore: VoiceStoreOf?) { - val call = callStore ?: return + var shownCall by remember { mutableStateOf(callStore) } + if (callStore != null) shownCall = callStore + val call = shownCall ?: return val phase by call.observe { it.phase } val place by call.observe { it.callPlace } val statusText by call.observe { it.statusText } - when (val current = phase) { - is VoiceFeature.State.Phase.Failed -> VoiceCallFailure( - store = call, - message = current.message, - modifier = Modifier.padding(start = 12.dp, end = 12.dp, bottom = 6.dp), - ) - VoiceFeature.State.Phase.Dropped -> VoiceCallEnded(call, Modifier.padding(start = 12.dp, end = 12.dp, bottom = 6.dp)) - else -> Unit + val card = phase.takeIf { callStore != null && (it is VoiceFeature.State.Phase.Failed || it == VoiceFeature.State.Phase.Dropped) } + OpenCodeNoticePresence(card) { current -> + when (current) { + is VoiceFeature.State.Phase.Failed -> VoiceCallFailure( + store = call, + message = current.message, + modifier = Modifier.padding(start = 12.dp, end = 12.dp, bottom = 6.dp), + ) + VoiceFeature.State.Phase.Dropped -> VoiceCallEnded(call, Modifier.padding(start = 12.dp, end = 12.dp, bottom = 6.dp)) + else -> Unit + } } - val connecting = place?.takeIf { phase == VoiceFeature.State.Phase.Connecting }?.let { it to statusText } + val connecting = place?.takeIf { callStore != null && phase == VoiceFeature.State.Phase.Connecting }?.let { it to statusText } // The caption fades out as it last read, not as the next phase. var shown by remember { mutableStateOf(connecting) } if (connecting != null && connecting != shown) shown = connecting