mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-03 19:25:19 +02:00
show recording status in sidebar
This commit is contained in:
parent
78c5ad2e6f
commit
daff21481a
1 changed files with 25 additions and 12 deletions
|
|
@ -691,10 +691,20 @@ export function SidebarContentPanel({
|
||||||
// Single preview shown as a sublabel on the Email / Meetings nav buttons.
|
// Single preview shown as a sublabel on the Email / Meetings nav buttons.
|
||||||
const previewEmail = emailThreads[0]
|
const previewEmail = emailThreads[0]
|
||||||
const previewMeeting = meetings[0]
|
const previewMeeting = meetings[0]
|
||||||
const meetingIsRecording = previewMeeting != null
|
// Drive the recording indicator off the global recording state — there is only
|
||||||
&& recordingMeetingSource === previewMeeting.source
|
// one active recording, so it must show even for ad-hoc recordings or meetings
|
||||||
&& (meetingRecordingState === 'recording' || meetingRecordingState === 'connecting' || meetingRecordingState === 'stopping')
|
// that aren't the upcoming one previewed here.
|
||||||
const meetingIsBusy = meetingIsRecording && (meetingRecordingState === 'connecting' || meetingRecordingState === 'stopping')
|
const meetingIsRecording = meetingRecordingState === 'recording'
|
||||||
|
|| meetingRecordingState === 'connecting'
|
||||||
|
|| meetingRecordingState === 'stopping'
|
||||||
|
const meetingIsBusy = meetingRecordingState === 'connecting' || meetingRecordingState === 'stopping'
|
||||||
|
// Title of the meeting being recorded, when it's the upcoming one we preview.
|
||||||
|
const recordingMeeting = previewMeeting != null && recordingMeetingSource === previewMeeting.source
|
||||||
|
? previewMeeting
|
||||||
|
: null
|
||||||
|
const meetingSublabel = meetingIsRecording
|
||||||
|
? (recordingMeeting?.summary ?? 'Recording…')
|
||||||
|
: (previewMeeting ? `${previewMeeting.summary} · ${formatMeetingTime(previewMeeting)}` : null)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Sidebar className="rowboat-sidebar border-r-0" {...props}>
|
<Sidebar className="rowboat-sidebar border-r-0" {...props}>
|
||||||
|
|
@ -750,19 +760,22 @@ export function SidebarContentPanel({
|
||||||
<SidebarMenuButton
|
<SidebarMenuButton
|
||||||
isActive={activeNav === 'meetings'}
|
isActive={activeNav === 'meetings'}
|
||||||
onClick={onOpenMeetings}
|
onClick={onOpenMeetings}
|
||||||
className={previewMeeting ? 'h-auto py-1.5' : undefined}
|
className={meetingSublabel ? 'h-auto py-1.5' : undefined}
|
||||||
>
|
>
|
||||||
<Mic className="size-4 shrink-0" />
|
<Mic className={cn('size-4 shrink-0', meetingIsRecording && 'text-red-500')} />
|
||||||
<div className="flex min-w-0 flex-1 flex-col">
|
<div className="flex min-w-0 flex-1 flex-col">
|
||||||
<span className="truncate">Meetings</span>
|
<span className="truncate">Meetings</span>
|
||||||
{previewMeeting && (
|
{meetingSublabel && (
|
||||||
<span className="truncate text-[11px] text-muted-foreground">
|
<span className={cn(
|
||||||
{meetingIsRecording ? previewMeeting.summary : `${previewMeeting.summary} · ${formatMeetingTime(previewMeeting)}`}
|
'truncate text-[11px]',
|
||||||
|
meetingIsRecording ? 'text-red-500' : 'text-muted-foreground',
|
||||||
|
)}>
|
||||||
|
{meetingSublabel}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</SidebarMenuButton>
|
</SidebarMenuButton>
|
||||||
{previewMeeting && (meetingIsRecording ? (
|
{meetingIsRecording ? (
|
||||||
<div className="absolute inset-y-0 right-1 flex items-center gap-1.5">
|
<div className="absolute inset-y-0 right-1 flex items-center gap-1.5">
|
||||||
<span className="relative flex size-2">
|
<span className="relative flex size-2">
|
||||||
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-red-500 opacity-75" />
|
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-red-500 opacity-75" />
|
||||||
|
|
@ -786,7 +799,7 @@ export function SidebarContentPanel({
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : previewMeeting ? (
|
||||||
<div className="absolute inset-y-0 right-1 flex items-center gap-0.5 opacity-0 transition-opacity group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100">
|
<div className="absolute inset-y-0 right-1 flex items-center gap-0.5 opacity-0 transition-opacity group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100">
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
|
|
@ -819,7 +832,7 @@ export function SidebarContentPanel({
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
) : null}
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem>
|
||||||
<SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
<SidebarMenuButton
|
<SidebarMenuButton
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue