File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,8 +141,9 @@ const activeBrowserRecordingTabIdsAtom = Atom.make<ActiveBrowserRecordingIndex>(
141141 tabIds : new Set < string > ( ) ,
142142} ) . pipe ( Atom . keepAlive , Atom . withLabel ( "preview:active-browser-recording-tabs" ) ) ;
143143
144- export function useActiveBrowserRecordingTabIds ( ) : ReadonlySet < string > {
145- return useAtomValue ( activeBrowserRecordingTabIdsAtom ) . tabIds ;
144+ export function useActiveBrowserRecordingTabIds ( threadRef ?: ScopedThreadRef ) : ReadonlySet < string > {
145+ const tabIds = useAtomValue ( activeBrowserRecordingTabIdsAtom ) . tabIds ;
146+ return threadRef ? readActiveBrowserRecordingTabIds ( threadRef ) : tabIds ;
146147}
147148
148149const activeRecordings = new Map < string , ActiveRecording > ( ) ;
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ import {
4747 WorkspaceBreadcrumbSeparator ,
4848} from "../WorkspaceBreadcrumb" ;
4949import { cn } from "~/lib/utils" ;
50+ import { BrowserRecordingIndicator } from "../preview/BrowserRecordingIndicator" ;
5051
5152interface ChatHeaderProps {
5253 activeThreadEnvironmentId : EnvironmentId ;
@@ -347,7 +348,7 @@ export const ChatHeader = memo(function ChatHeader({
347348 < WorkspaceBreadcrumbSeparator />
348349 </ >
349350 ) : null }
350- < WorkspaceBreadcrumbItem current className = "min-w-10 flex-1" >
351+ < WorkspaceBreadcrumbItem current className = "min-w-10 flex-1 gap-2 " >
351352 { renamingTitle !== null ? (
352353 < input
353354 autoFocus
@@ -398,6 +399,9 @@ export const ChatHeader = memo(function ChatHeader({
398399 < TooltipPopup side = "top" > { activeThreadTitle } </ TooltipPopup >
399400 </ Tooltip >
400401 ) }
402+ < BrowserRecordingIndicator
403+ threadRef = { scopeThreadRef ( activeThreadEnvironmentId , activeThreadId ) }
404+ />
401405 </ WorkspaceBreadcrumbItem >
402406 </ WorkspaceBreadcrumb >
403407 < div
Original file line number Diff line number Diff line change 1+ import type { ScopedThreadRef } from "@t3tools/contracts" ;
2+
3+ import { useActiveBrowserRecordingTabIds } from "~/browser/browserRecording" ;
4+
5+ export function BrowserRecordingIndicator ( { threadRef } : { threadRef : ScopedThreadRef } ) {
6+ const recordingTabIds = useActiveBrowserRecordingTabIds ( threadRef ) ;
7+
8+ if ( recordingTabIds . size === 0 ) return null ;
9+
10+ return (
11+ < span
12+ role = "status"
13+ aria-label = "Preview recording in progress"
14+ className = "inline-flex shrink-0 items-center gap-1.5 text-xs font-normal text-muted-foreground"
15+ >
16+ < span
17+ aria-hidden
18+ className = "size-2 shrink-0 rounded-full bg-red-500 motion-safe:animate-status-pulse"
19+ />
20+ Recording
21+ </ span >
22+ ) ;
23+ }
You can’t perform that action at this time.
0 commit comments