diff --git a/apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx b/apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx index 76dba69eceee..5249fe37401a 100644 --- a/apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx +++ b/apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx @@ -12,6 +12,10 @@ import { } from "react"; import { BrowserSurfaceSlot } from "~/browser/BrowserSurfaceSlot"; +import { + findActiveBrowserRecordingRuntimeTabId, + useActiveBrowserRecordingTabIds, +} from "~/browser/browserRecording"; import { useBrowserSurfaceStore } from "~/browser/browserSurfaceStore"; import type { BrowserViewportResizeDirection } from "~/browser/browserViewportLayout"; import { previewRuntimeTabId } from "~/browser/previewRuntimeTabId"; @@ -151,6 +155,10 @@ function BrowserMiniPlayer({ const previewState = useThreadPreviewState(threadRef); const snapshot = previewState.sessions[tabId] ?? null; const runtimeTabId = previewRuntimeTabId(threadRef, previewState.serverEpoch, tabId); + const recordingTabIds = useActiveBrowserRecordingTabIds(); + const recording = + recordingTabIds.has(runtimeTabId) || + findActiveBrowserRecordingRuntimeTabId(threadRef, tabId) !== null; const desktopOverlay = previewState.desktopByTabId[tabId] ?? null; const fittedSourceContent = useBrowserSurfaceStore( (state) => state.byTabId[runtimeTabId]?.fittedSourceContent ?? null, @@ -189,6 +197,7 @@ function BrowserMiniPlayer({ sourceSize={sourceSize} composerOverlayElement={composerOverlayElement} label="Floating browser preview" + recording={recording} onOpenInPanel={openInPanel} pillActions={ @@ -314,6 +323,7 @@ function MiniPlayerShell({ label, onOpenInPanel, pillActions, + recording = false, cornerRadius = frameCornerRadius, children, }: { @@ -324,6 +334,7 @@ function MiniPlayerShell({ readonly label: string; readonly onOpenInPanel: () => void; readonly pillActions?: ReactNode; + readonly recording?: boolean; /** The clip radius for a given frame; the pill stays inside the curve. */ readonly cornerRadius?: (frame: PreviewMiniPlayerSize) => number; readonly children: (frame: PreviewMiniPlayerFrame) => ReactNode; @@ -443,9 +454,18 @@ function MiniPlayerShell({ style={{ right: pillInset, top: pillInset }} >
beginGesture(event, null)} @@ -453,6 +473,11 @@ function MiniPlayerShell({ onPointerUp={endGesture} onPointerCancel={endGesture} > + {recording ? ( + + + + ) : null}