fix(composer): keep message input visible after dictation (#2194)

The voice overlay transition could retain stale native opacity after the app was backgrounded, leaving the mounted composer transparent. Derive both surfaces directly from voice state so they cannot disagree after resume.
This commit is contained in:
Mohamed Boudra
2026-07-18 15:15:25 +02:00
committed by GitHub
parent c97f823236
commit 05d1f838d8
3 changed files with 64 additions and 26 deletions
+26
View File
@@ -3,6 +3,32 @@ import type { MessagePayload } from "@/composer/types";
export type SendBehavior = "interrupt" | "queue";
interface ComposerSurfaceState {
opacity: 0 | 1;
pointerEvents: "auto" | "none";
}
export interface ComposerSurfacePresentation {
input: ComposerSurfaceState;
overlay: ComposerSurfaceState;
}
const INPUT_PRESENTATION: ComposerSurfacePresentation = {
input: { opacity: 1, pointerEvents: "auto" },
overlay: { opacity: 0, pointerEvents: "none" },
};
const OVERLAY_PRESENTATION: ComposerSurfacePresentation = {
input: { opacity: 0, pointerEvents: "none" },
overlay: { opacity: 1, pointerEvents: "auto" },
};
export function resolveComposerSurfacePresentation(
showOverlay: boolean,
): ComposerSurfacePresentation {
return showOverlay ? OVERLAY_PRESENTATION : INPUT_PRESENTATION;
}
interface StopRealtimeVoiceContext {
voice: { stopVoice: () => Promise<unknown> } | null | undefined;
isRealtimeVoiceForCurrentAgent: boolean;