Turn meetings into live agent loops. Record, transcribe, and analyze meetings with real-time AI intelligence — before, during, and after calls.
feat: new recorder UI and visual indexing
Om Gate64ff2cc9dc53
diff --git a/src/main/ipc/capture.ts b/src/main/ipc/capture.tsindex 0675192..1d7972e 100644--- a/src/main/ipc/capture.ts+++ b/src/main/ipc/capture.ts@@ -3,7 +3,7 @@ import { CaptureClient } from 'videodb/capture';import { connect } from 'videodb';import type { WebSocketConnection, WebSocketMessage } from 'videodb';import type { Channel } from '../../shared/schemas/capture.schema';-import type { RecorderEvent, TranscriptEvent, StartRecordingParams } from '../../shared/types/ipc.types';+import type { RecorderEvent, TranscriptEvent, VisualIndexEvent, StartRecordingParams } from '../../shared/types/ipc.types';import { setupSessionWebSocket, cleanupSessionWebSocket } from '../services/session-events.service';import { startExportPoller, stopExportPoller, stopAllExportPollers } from '../services/export-poller.service';import { createChildLogger } from '../lib/logger';@@ -28,7 +28,9 @@ const captureEventHandlers: {let micWebSocket: WebSocketConnection | null = null;let sysAudioWebSocket: WebSocketConnection | null = null;+let screenWebSocket: WebSocketConnection | null = null;let transcriptListenerActive = false;+let visualIndexListenerActive = false;// Track current session for export pollinglet currentSessionId: string | null = null;@@ -162,6 +164,91 @@ async function cleanupTranscriptWebSockets(): Promise<void> {}}+async function setupVisualIndexWebSocket(+ sessionToken: string,+ apiUrl?: string+): Promise<string | null> {+ try {+ if (!sessionToken) {+ logger.warn('[WS] No session token for visual index');+ return null;+ }++ const connectOptions: { sessionToken: string; baseUrl?: string } = { sessionToken };+ if (apiUrl) {+ connectOptions.baseUrl = apiUrl;+ }+ const videodbConnection = connect(connectOptions);++ try {+ const wsConnection = await videodbConnection.connectWebsocket();+ screenWebSocket = await wsConnection.connect();+ logger.info({ connectionId: screenWebSocket.connectionId }, '[WS] Screen WebSocket connected for visual indexing');++ visualIndexListenerActive = true;+ listenForVisualIndexMessages(screenWebSocket);++ return screenWebSocket.connectionId || null;+ } catch (err) {+ logger.error({ error: err }, '[WS] Failed to create screen WebSocket');+ return null;+ }+ } catch (err) {+ logger.error({ error: err }, '[WS] Error setting up visual index WebSocket');+ return null;+ }+}++async function listenForVisualIndexMessages(ws: WebSocketConnection): Promise<void> {+ try {+ for await (const msg of ws.receive()) {+ if (!visualIndexListenerActive) break;++ const channel = (msg.channel || msg.type || msg.event_type || 'event') as string;++ // Listen for scene_index or visual_index events+ if (channel === 'scene_index' || channel === 'visual_index') {+ const msgData = msg.data as Record<string, unknown>;+ const text = (msgData.text || msg.text || '') as string;+ const start = (msgData.start ?? msg.start) as number;+ const end = (msgData.end ?? msg.end) as number;++ const visualIndexEvent: VisualIndexEvent = {+ text,+ start,+ end,+ rtstreamId: (msg.rtstream_id || msg.rtstreamId) as string | undefined,+ rtstreamName: (msg.rtstream_name || msg.rtstreamName) as string | undefined,+ };++ logger.info({ text: text.substring(0, 50) }, '[WS] Visual index event received');++ sendRecorderEvent({+ event: 'visual_index',+ data: visualIndexEvent,+ });+ }+ }+ } catch (err) {+ if (visualIndexListenerActive) {+ logger.error({ error: err }, '[WS] Error in visual index listener');+ }+ }+}++async function cleanupVisualIndexWebSocket(): Promise<void> {+ visualIndexListenerActive = false;++ if (screenWebSocket) {+ try {+ await screenWebSocket.close();+ } catch (e) {+ // Ignore close errors+ }+ screenWebSocket = null;+ }+}+export function setMainWindow(window: BrowserWindow): void {mainWindow = window;}@@ -265,8 +352,9 @@ export function setupCaptureHandlers(): void {error?: string;micWsConnectionId?: string;sysAudioWsConnectionId?: string;+ screenWsConnectionId?: string;}> => {- const { config, sessionToken, accessToken, apiUrl, enableTranscription } = params;+ const { config, sessionToken, accessToken, apiUrl, enableTranscription, enableVisualIndex } = params;logger.info({ sessionId: config.sessionId, enableTranscription }, 'Starting recording - IPC handler called');@@ -288,6 +376,15 @@ export function setupCaptureHandlers(): void {}}+ // Set up visual index WebSocket for screen capture+ let screenWsConnectionId: string | null = null;+ if (enableVisualIndex && config.streams?.screen !== false) {+ screenWsConnectionId = await setupVisualIndexWebSocket(sessionToken, apiUrl);+ if (screenWsConnectionId) {+ logger.info({ screenWsId: screenWsConnectionId }, '[WS] Visual index WebSocket established');+ }+ }+// Create fresh CaptureClient each time (Python pattern)if (captureClient) {logger.info('Cleaning up existing CaptureClient before creating new one');@@ -403,12 +500,14 @@ export function setupCaptureHandlers(): void {sessionId: config.sessionId,micWsConnectionId: wsConnectionIds?.micWsId || undefined,sysAudioWsConnectionId: wsConnectionIds?.sysAudioWsId || undefined,+ screenWsConnectionId: screenWsConnectionId || undefined,};} catch (error) {const errorMessage = error instanceof Error ? error.message : 'Unknown error';const errorStack = error instanceof Error ? error.stack : undefined;logger.error({ err: error, errorMessage, errorStack }, 'Failed to start recording');await cleanupTranscriptWebSockets();+ await cleanupVisualIndexWebSocket();await cleanupSessionWebSocket();cleanupCapture();return {@@ -458,6 +557,7 @@ export function setupCaptureHandlers(): void {}await cleanupTranscriptWebSockets();+ await cleanupVisualIndexWebSocket();await cleanupSessionWebSocket();// Start export poller to detect when video is ready@@ -484,6 +584,7 @@ export function setupCaptureHandlers(): void {} catch (error) {logger.error({ error }, 'Failed to stop recording');await cleanupTranscriptWebSockets();+ await cleanupVisualIndexWebSocket();await cleanupSessionWebSocket();cleanupCapture();@@ -624,6 +725,7 @@ export async function cleanupCaptureAsync(): Promise<void> {export async function shutdownCaptureClient(): Promise<void> {await cleanupTranscriptWebSockets();+ await cleanupVisualIndexWebSocket();await cleanupSessionWebSocket();// Stop all export pollersdiff --git a/src/main/server/trpc/procedures/transcription.ts b/src/main/server/trpc/procedures/transcription.tsindex d0724c5..9013d3b 100644--- a/src/main/server/trpc/procedures/transcription.ts+++ b/src/main/server/trpc/procedures/transcription.ts@@ -33,11 +33,12 @@ async function startRealtimeTranscriptionWithWs(apiKey: string,micWsConnectionId?: string,sysAudioWsConnectionId?: string,+ screenWsConnectionId?: string,apiUrl?: string): Promise<void> {try {logger.info(- { sessionId: captureSessionId, micWsConnectionId, sysAudioWsConnectionId },+ { sessionId: captureSessionId, micWsConnectionId, sysAudioWsConnectionId, screenWsConnectionId },'[Transcript] Starting transcription for session');@@ -50,8 +51,10 @@ async function startRealtimeTranscriptionWithWs(let mics: RTStream[] = [];let systemAudios: RTStream[] = [];+ let screens: RTStream[] = [];const needsMic = Boolean(micWsConnectionId);const needsSystemAudio = Boolean(sysAudioWsConnectionId);+ const needsScreen = Boolean(screenWsConnectionId);for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {try {@@ -98,16 +101,34 @@ async function startRealtimeTranscriptionWithWs(});}+ // Find screen/display RTStreams+ screens = session.getRTStream('screen');+ if (screens.length === 0) {+ screens = (session.rtstreams || []).filter((stream) => {+ const name = (stream.name || '').toLowerCase();+ const channelId = (stream.channelId || '').toLowerCase();+ return (+ name.includes('display') ||+ name.includes('screen') ||+ channelId.includes('display') ||+ channelId.includes('screen')+ );+ });+ }+const hasRequiredMic = !needsMic || mics.length > 0;const hasRequiredSystemAudio = !needsSystemAudio || systemAudios.length > 0;+ const hasRequiredScreen = !needsScreen || screens.length > 0;- if (hasRequiredMic && hasRequiredSystemAudio) {+ if (hasRequiredMic && hasRequiredSystemAudio && hasRequiredScreen) {logger.info({mics: mics.length,systemAudios: systemAudios.length,+ screens: screens.length,needsMic,needsSystemAudio,+ needsScreen,},'[Transcript] Found required RTStreams');@@ -118,8 +139,10 @@ async function startRealtimeTranscriptionWithWs(attempt: attempt + 1,mics: mics.length,systemAudios: systemAudios.length,+ screens: screens.length,needsMic,needsSystemAudio,+ needsScreen,},'[Transcript] Required RTStreams not ready yet, waiting...');@@ -134,14 +157,16 @@ async function startRealtimeTranscriptionWithWs(}}- if ((needsMic && mics.length === 0) || (needsSystemAudio && systemAudios.length === 0)) {+ if ((needsMic && mics.length === 0) || (needsSystemAudio && systemAudios.length === 0) || (needsScreen && screens.length === 0)) {logger.error({maxRetries: MAX_RETRIES,mics: mics.length,systemAudios: systemAudios.length,+ screens: screens.length,needsMic,needsSystemAudio,+ needsScreen,},'[Transcript] Failed to find required RTStreams after max retries');@@ -173,6 +198,15 @@ async function startRealtimeTranscriptionWithWs(} else if (systemAudios.length > 0) {logger.info('[Transcript] System audio stream found but no ws_connection_id provided, skipping');}++ // Visual indexing is now controlled by user toggle via visualIndex.start procedure+ // The screenWsConnectionId is passed to the renderer for on-demand activation+ if (screens.length > 0) {+ logger.info(+ { rtstreamId: screens[0].id, screenWsConnectionId },+ '[VisualIndex] Screen stream ready for visual indexing (user-controlled)'+ );+ }} catch (error) {logger.error({ error, sessionId: captureSessionId },@@ -186,20 +220,20 @@ export const transcriptionRouter = router({.input(StartTranscriptionInputSchema).output(StartTranscriptionOutputSchema).mutation(async ({ input, ctx }) => {- const { sessionId, micWsConnectionId, sysAudioWsConnectionId } = input;+ const { sessionId, micWsConnectionId, sysAudioWsConnectionId, screenWsConnectionId } = input;logger.info(- { sessionId, micWsConnectionId, sysAudioWsConnectionId },- 'Starting transcription'+ { sessionId, micWsConnectionId, sysAudioWsConnectionId, screenWsConnectionId },+ 'Starting transcription and visual indexing');// Validate that at least one WebSocket connection ID is provided- if (!micWsConnectionId && !sysAudioWsConnectionId) {+ if (!micWsConnectionId && !sysAudioWsConnectionId && !screenWsConnectionId) {logger.warn({ sessionId }, 'No WebSocket connection IDs provided');return {status: 'skipped',sessionId,- message: 'No WebSocket connection IDs provided, skipping transcription setup',+ message: 'No WebSocket connection IDs provided, skipping transcription/visual setup',};}@@ -225,6 +259,7 @@ export const transcriptionRouter = router({apiKey,micWsConnectionId,sysAudioWsConnectionId,+ screenWsConnectionId,apiUrl).catch((error) => {logger.error({ error, sessionId }, 'Background transcription task failed');@@ -233,7 +268,7 @@ export const transcriptionRouter = router({return {status: 'started',sessionId,- message: 'Transcription startup initiated. Will poll for RTStreams and start when ready.',+ message: 'Transcription and visual indexing startup initiated. Will poll for RTStreams and start when ready.',};}),});diff --git a/src/main/server/trpc/procedures/visual-index.ts b/src/main/server/trpc/procedures/visual-index.tsnew file mode 100644index 0000000..359d185--- /dev/null+++ b/src/main/server/trpc/procedures/visual-index.ts@@ -0,0 +1,293 @@+import { z } from 'zod';+import { router, protectedProcedure } from '../trpc';+import { createChildLogger } from '../../../lib/logger';+import { loadRuntimeConfig } from '../../../lib/config';+import { connect } from 'videodb';+import type { CaptureSessionFull, RTStream } from 'videodb';++const logger = createChildLogger('visual-index-procedure');++// Store active scene indexes by session ID+const activeSceneIndexes = new Map<string, {+ sceneIndexId: string;+ rtstreamId: string;+ apiKey: string;+ apiUrl?: string;+}>();++const MAX_RETRIES = 60;+const RETRY_DELAY_MS = 2000;++function sleep(ms: number): Promise<void> {+ return new Promise((resolve) => setTimeout(resolve, ms));+}++async function findScreenRTStream(+ sessionId: string,+ apiKey: string,+ apiUrl?: string+): Promise<RTStream | null> {+ const connectOptions: { apiKey: string; baseUrl?: string } = { apiKey };+ if (apiUrl) {+ connectOptions.baseUrl = apiUrl;+ }+ const conn = connect(connectOptions);++ for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {+ try {+ const session: CaptureSessionFull = await conn.getCaptureSession(sessionId);+ if (!session) {+ await sleep(RETRY_DELAY_MS);+ continue;+ }++ await session.refresh();++ let screens = session.getRTStream('screen');+ if (screens.length === 0) {+ screens = (session.rtstreams || []).filter((stream) => {+ const name = (stream.name || '').toLowerCase();+ const channelId = (stream.channelId || '').toLowerCase();+ return (+ name.includes('display') ||+ name.includes('screen') ||+ channelId.includes('display') ||+ channelId.includes('screen')+ );+ });+ }++ if (screens.length > 0) {+ return screens[0];+ }++ logger.info({ attempt: attempt + 1 }, '[VisualIndex] Screen RTStream not ready, waiting...');+ await sleep(RETRY_DELAY_MS);+ } catch (error) {+ logger.warn({ attempt: attempt + 1, error }, '[VisualIndex] Attempt error');+ await sleep(RETRY_DELAY_MS);+ }+ }++ return null;+}++export const visualIndexRouter = router({+ /**+ * Start visual indexing for a session.+ * Creates a new scene index and begins indexing.+ */+ start: protectedProcedure+ .input(z.object({+ sessionId: z.string(),+ screenWsConnectionId: z.string(),+ }))+ .output(z.object({+ success: z.boolean(),+ sceneIndexId: z.string().optional(),+ message: z.string(),+ }))+ .mutation(async ({ input, ctx }) => {+ const { sessionId, screenWsConnectionId } = input;++ logger.info({ sessionId, screenWsConnectionId }, '[VisualIndex] Starting visual indexing');++ const apiKey = ctx.user?.apiKey;+ if (!apiKey) {+ return { success: false, message: 'No API key available' };+ }++ const runtimeConfig = loadRuntimeConfig();+ const apiUrl = runtimeConfig.apiUrl;++ // Check if already have an active scene index for this session+ const existing = activeSceneIndexes.get(sessionId);+ if (existing) {+ logger.info({ sessionId, sceneIndexId: existing.sceneIndexId }, '[VisualIndex] Scene index already exists, resuming');+ // Resume the existing one+ try {+ const connectOptions: { apiKey: string; baseUrl?: string } = { apiKey };+ if (apiUrl) connectOptions.baseUrl = apiUrl;+ const conn = connect(connectOptions);+ const session = await conn.getCaptureSession(sessionId);+ await session.refresh();++ const screens = (session.rtstreams || []).filter(s => s.id === existing.rtstreamId);+ if (screens.length > 0) {+ const sceneIndexes = await screens[0].listSceneIndexes();+ const sceneIndex = sceneIndexes.find(si => si.rtstreamIndexId === existing.sceneIndexId);+ if (sceneIndex) {+ await sceneIndex.start();+ return { success: true, sceneIndexId: existing.sceneIndexId, message: 'Visual indexing resumed' };+ }+ }+ } catch (err) {+ logger.warn({ error: err }, '[VisualIndex] Failed to resume existing, creating new');+ }+ }++ // Find screen RTStream+ const screenStream = await findScreenRTStream(sessionId, apiKey, apiUrl);+ if (!screenStream) {+ return { success: false, message: 'Screen RTStream not found' };+ }++ try {+ const sceneIndex = await screenStream.indexVisuals({+ batchConfig: {+ type: 'time',+ value: 5,+ frameCount: 3,+ },+ prompt: 'Describe what is visible on the screen. Focus on any presentations, documents, charts, dashboards, or important visual content. Be concise.',+ socketId: screenWsConnectionId,+ });++ if (!sceneIndex) {+ return { success: false, message: 'Failed to create scene index' };+ }++ const sceneIndexId = sceneIndex.rtstreamIndexId;++ // Store for later pause/resume+ activeSceneIndexes.set(sessionId, {+ sceneIndexId,+ rtstreamId: screenStream.id,+ apiKey,+ apiUrl,+ });++ logger.info({ sessionId, sceneIndexId }, '[VisualIndex] Visual indexing started');++ return { success: true, sceneIndexId, message: 'Visual indexing started' };+ } catch (error) {+ logger.error({ error }, '[VisualIndex] Failed to start visual indexing');+ return { success: false, message: 'Failed to start visual indexing' };+ }+ }),++ /**+ * Pause visual indexing for a session.+ */+ pause: protectedProcedure+ .input(z.object({+ sessionId: z.string(),+ }))+ .output(z.object({+ success: z.boolean(),+ message: z.string(),+ }))+ .mutation(async ({ input, ctx }) => {+ const { sessionId } = input;++ logger.info({ sessionId }, '[VisualIndex] Pausing visual indexing');++ const stored = activeSceneIndexes.get(sessionId);+ if (!stored) {+ return { success: false, message: 'No active scene index found' };+ }++ const apiKey = ctx.user?.apiKey || stored.apiKey;+ const apiUrl = stored.apiUrl;++ try {+ const connectOptions: { apiKey: string; baseUrl?: string } = { apiKey };+ if (apiUrl) connectOptions.baseUrl = apiUrl;+ const conn = connect(connectOptions);++ const session = await conn.getCaptureSession(sessionId);+ await session.refresh();++ const screens = (session.rtstreams || []).filter(s => s.id === stored.rtstreamId);+ if (screens.length === 0) {+ return { success: false, message: 'Screen RTStream not found' };+ }++ const sceneIndexes = await screens[0].listSceneIndexes();+ const sceneIndex = sceneIndexes.find(si => si.rtstreamIndexId === stored.sceneIndexId);++ if (!sceneIndex) {+ return { success: false, message: 'Scene index not found' };+ }++ await sceneIndex.stop();++ logger.info({ sessionId, sceneIndexId: stored.sceneIndexId }, '[VisualIndex] Visual indexing paused');++ return { success: true, message: 'Visual indexing paused' };+ } catch (error) {+ logger.error({ error }, '[VisualIndex] Failed to pause visual indexing');+ return { success: false, message: 'Failed to pause visual indexing' };+ }+ }),++ /**+ * Resume visual indexing for a session.+ */+ resume: protectedProcedure+ .input(z.object({+ sessionId: z.string(),+ }))+ .output(z.object({+ success: z.boolean(),+ message: z.string(),+ }))+ .mutation(async ({ input, ctx }) => {+ const { sessionId } = input;++ logger.info({ sessionId }, '[VisualIndex] Resuming visual indexing');++ const stored = activeSceneIndexes.get(sessionId);+ if (!stored) {+ return { success: false, message: 'No active scene index found' };+ }++ const apiKey = ctx.user?.apiKey || stored.apiKey;+ const apiUrl = stored.apiUrl;++ try {+ const connectOptions: { apiKey: string; baseUrl?: string } = { apiKey };+ if (apiUrl) connectOptions.baseUrl = apiUrl;+ const conn = connect(connectOptions);++ const session = await conn.getCaptureSession(sessionId);+ await session.refresh();++ const screens = (session.rtstreams || []).filter(s => s.id === stored.rtstreamId);+ if (screens.length === 0) {+ return { success: false, message: 'Screen RTStream not found' };+ }++ const sceneIndexes = await screens[0].listSceneIndexes();+ const sceneIndex = sceneIndexes.find(si => si.rtstreamIndexId === stored.sceneIndexId);++ if (!sceneIndex) {+ return { success: false, message: 'Scene index not found' };+ }++ await sceneIndex.start();++ logger.info({ sessionId, sceneIndexId: stored.sceneIndexId }, '[VisualIndex] Visual indexing resumed');++ return { success: true, message: 'Visual indexing resumed' };+ } catch (error) {+ logger.error({ error }, '[VisualIndex] Failed to resume visual indexing');+ return { success: false, message: 'Failed to resume visual indexing' };+ }+ }),++ /**+ * Clear stored scene index when session ends.+ */+ clear: protectedProcedure+ .input(z.object({+ sessionId: z.string(),+ }))+ .output(z.object({+ success: z.boolean(),+ }))+ .mutation(async ({ input }) => {+ activeSceneIndexes.delete(input.sessionId);+ return { success: true };+ }),+});diff --git a/src/main/server/trpc/router.ts b/src/main/server/trpc/router.tsindex 8d51679..0ee2071 100644--- a/src/main/server/trpc/router.ts+++ b/src/main/server/trpc/router.ts@@ -5,6 +5,7 @@ import { tokenRouter } from './procedures/token';import { captureRouter } from './procedures/capture';import { recordingsRouter } from './procedures/recordings';import { transcriptionRouter } from './procedures/transcription';+import { visualIndexRouter } from './procedures/visual-index';import { settingsRouter } from './procedures/settings';import { meetingSetupRouter } from './procedures/meeting-setup';@@ -15,6 +16,7 @@ export const appRouter = router({capture: captureRouter,recordings: recordingsRouter,transcription: transcriptionRouter,+ visualIndex: visualIndexRouter,settings: settingsRouter,meetingSetup: meetingSetupRouter,});diff --git a/src/renderer/App.tsx b/src/renderer/App.tsxindex 706883a..640fe48 100644--- a/src/renderer/App.tsx+++ b/src/renderer/App.tsx@@ -1,4 +1,4 @@-import { useState } from 'react';+import React, { useState } from 'react';import { NewSidebar } from './components/layout/NewSidebar';import { AuthView } from './components/auth/AuthView';import { TopStatusBar } from './components/recording/TopStatusBar';@@ -11,7 +11,7 @@ import { useSessionStore } from './stores/session.store';import { usePermissions } from './hooks/usePermissions';import { useGlobalRecorderEvents } from './hooks/useGlobalRecorderEvents';import { useCopilot } from './hooks/useCopilot';-import { Card, CardContent, CardHeader, CardTitle, CardDescription } from './components/ui/card';+import { Card, CardContent, CardHeader, CardTitle } from './components/ui/card';import { Button } from './components/ui/button';import { ErrorToast } from './components/ui/error-toast';import { AlertCircle, Loader2 } from 'lucide-react';@@ -24,10 +24,11 @@ import { useMeetingSetupStore } from './stores/meeting-setup.store';import { MCPServersPanel } from './components/settings/MCPServersPanel';import { CalendarPanel } from './components/settings/CalendarPanel';import { CalendarAuthBanner } from './components/calendar';-import { MeetingSetupFlow, MeetingInfoPanel } from './components/meeting-setup';+import { MeetingSetupFlow } from './components/meeting-setup';import { StepIndicators } from './components/auth/AuthView';import { CalendarSetupView } from './components/auth/CalendarSetupView';import { RecordingPreferencesView } from './components/auth/RecordingPreferencesView';+import { RecordingHeader, MetricsBar, LiveAssistPanel, MeetingAgendaPanel } from './components/recording';type Tab = 'home' | 'history' | 'settings';@@ -181,7 +182,7 @@ interface RecordingViewProps {}function RecordingView({ onBack }: RecordingViewProps) {- const { isCallActive, callSummary } = useCopilotStore();+ const { isCallActive, callSummary, nudgeHistory } = useCopilotStore();const { status } = useSession();const meetingSetupStore = useMeetingSetupStore();@@ -189,6 +190,19 @@ function RecordingView({ onBack }: RecordingViewProps) {const isProcessing = status === 'processing' || status === 'stopping';const isIdle = status === 'idle';+ // Get checklist from meeting setup+ const { checklist } = meetingSetupStore;+ const hasChecklist = checklist.length > 0;++ // Get insights from nudge history (for Live Assist panel)+ const insights = nudgeHistory+ .filter((n) => n.type === 'suggestion' || n.type === 'question')+ .map((n) => n.message)+ .slice(-5); // Last 5 insights++ // MCP findings placeholder - will be populated from MCP store+ const mcpFindings = ''; // TODO: Connect to MCP results+useCopilot();// Reset meeting setup when starting a new call@@ -234,16 +248,15 @@ function RecordingView({ onBack }: RecordingViewProps) {// Show processing state while generating summary (only after recording stopped)if (isProcessing) {return (- <div className="flex flex-col h-full overflow-hidden">- <TopStatusBar />+ <div className="flex flex-col h-full overflow-hidden bg-[#f7f7f7]"><div className="flex-1 flex items-center justify-center"><div className="text-center space-y-4">- <div className="w-16 h-16 mx-auto rounded-full bg-primary/10 flex items-center justify-center">- <Loader2 className="w-8 h-8 text-primary animate-spin" />+ <div className="w-16 h-16 mx-auto rounded-full bg-[#fff5ec] flex items-center justify-center">+ <Loader2 className="w-8 h-8 text-[#ec5b16] animate-spin" /></div><div>- <h2 className="text-lg font-semibold">Generating Call Summary</h2>- <p className="text-sm text-muted-foreground mt-1">+ <h2 className="text-lg font-semibold text-black">Generating Call Summary</h2>+ <p className="text-sm text-[#464646] mt-1">Analyzing your conversation and preparing insights...</p></div>@@ -255,30 +268,36 @@ function RecordingView({ onBack }: RecordingViewProps) {// If idle, go back to home (user shouldn't see RecordingView when idle)if (isIdle) {- // This shouldn't happen often since App.tsx checks isActivelyRecording- // but if we end up here, just go backonBack?.();return null;}- // Show recording view with transcription and meeting info+ // Show recording view with new Figma designreturn (- <div className="flex flex-col h-full bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-950 dark:to-slate-900">- {/* Top Status Bar */}- <TopStatusBar />-- {/* Main Content Area */}- <div className="flex-1 flex gap-4 p-4 overflow-hidden">- {/* Left Column - Transcription */}- <div className="flex-1 flex flex-col min-w-0">- <div className="flex-1 min-h-0">- <TranscriptionPanel />- </div>+ <div className="flex flex-col h-full bg-[#f7f7f7]">+ {/* Header */}+ <RecordingHeader />++ {/* Main Container */}+ <div className="flex-1 bg-white border border-[#efefef] rounded-t-[20px] mx-[10px] p-[20px] flex gap-[30px] overflow-hidden">+ {/* Left Column - Transcript Section */}+ <div className="flex-1 flex flex-col min-w-0 overflow-hidden">+ <TranscriptionPanel /></div>- {/* Right Column - Meeting Info Panel */}- <div className="w-80 flex flex-col shrink-0 overflow-hidden">- <MeetingInfoPanel />+ {/* Right Column - Metrics, Agenda, Live Assist */}+ <div className="w-[460px] shrink-0 flex flex-col gap-[30px] h-full">+ {/* Metrics Bar */}+ <MetricsBar />++ {/* Right Panel with scrollable content */}+ <div className="flex-1 bg-[#f7f7f7] border border-[#efefef] rounded-[16px] p-[12px] flex flex-col gap-[16px] overflow-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]">+ {/* Meeting Agenda - only show if checklist exists */}+ {hasChecklist && <MeetingAgendaPanel checklist={checklist} />}++ {/* Live Assist Panel */}+ <LiveAssistPanel insights={insights} mcpFindings={mcpFindings} />+ </div></div></div></div>@@ -386,6 +405,12 @@ export function App() {// Check if actively recording or processingconst isActivelyRecording = sessionStatus === 'recording' || sessionStatus === 'processing' || sessionStatus === 'stopping' || sessionStatus === 'starting';+ React.useEffect(() => {+ if (isActivelyRecording && showMeetingSetup) {+ setShowMeetingSetup(false);+ }+ }, [isActivelyRecording, showMeetingSetup]);+// Handle start recording button from HomeView - show MeetingSetupFlowconst handleStartRecording = () => {setShowMeetingSetup(true);diff --git a/src/renderer/components/icons/SentimentIcons.tsx b/src/renderer/components/icons/SentimentIcons.tsxnew file mode 100644index 0000000..625965f--- /dev/null+++ b/src/renderer/components/icons/SentimentIcons.tsx@@ -0,0 +1,152 @@+/**+ * Sentiment Icons for Meeting Analysis+ *+ * Five sentiment states:+ * - Positive/Happy (green)+ * - Neutral (gray)+ * - Negative/Sad (red)+ * - Negative/Angry (red)+ * - Confused (yellow/orange)+ */++import React from 'react';++interface IconProps {+ size?: number;+ className?: string;+}++export function HappyIcon({ size = 22, className }: IconProps) {+ return (+ <svg+ width={size}+ height={size}+ viewBox="0 0 32 32"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ className={className}+ >+ <circle cx="16" cy="16" r="14" stroke="#22c55e" strokeWidth="2" fill="none" />+ <circle cx="11" cy="13" r="2" fill="#22c55e" />+ <circle cx="21" cy="13" r="2" fill="#22c55e" />+ <path+ d="M10 20C10 20 12.5 24 16 24C19.5 24 22 20 22 20"+ stroke="#22c55e"+ strokeWidth="2"+ strokeLinecap="round"+ />+ </svg>+ );+}++export function NeutralIcon({ size = 22, className }: IconProps) {+ return (+ <svg+ width={size}+ height={size}+ viewBox="0 0 32 32"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ className={className}+ >+ <circle cx="16" cy="16" r="14" stroke="#9ca3af" strokeWidth="2" fill="none" />+ <circle cx="11" cy="13" r="2" fill="#9ca3af" />+ <circle cx="21" cy="13" r="2" fill="#9ca3af" />+ <line x1="10" y1="21" x2="22" y2="21" stroke="#9ca3af" strokeWidth="2" strokeLinecap="round" />+ </svg>+ );+}++export function SadIcon({ size = 22, className }: IconProps) {+ return (+ <svg+ width={size}+ height={size}+ viewBox="0 0 32 32"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ className={className}+ >+ <circle cx="16" cy="16" r="14" stroke="#ef4444" strokeWidth="2" fill="none" />+ <circle cx="11" cy="13" r="2" fill="#ef4444" />+ <circle cx="21" cy="13" r="2" fill="#ef4444" />+ <path+ d="M10 24C10 24 12.5 20 16 20C19.5 20 22 24 22 24"+ stroke="#ef4444"+ strokeWidth="2"+ strokeLinecap="round"+ />+ </svg>+ );+}++export function AngryIcon({ size = 22, className }: IconProps) {+ return (+ <svg+ width={size}+ height={size}+ viewBox="0 0 32 32"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ className={className}+ >+ <circle cx="16" cy="16" r="14" stroke="#ef4444" strokeWidth="2" fill="none" />+ <circle cx="11" cy="14" r="2" fill="#ef4444" />+ <circle cx="21" cy="14" r="2" fill="#ef4444" />+ <line x1="8" y1="10" x2="14" y2="12" stroke="#ef4444" strokeWidth="2" strokeLinecap="round" />+ <line x1="24" y1="10" x2="18" y2="12" stroke="#ef4444" strokeWidth="2" strokeLinecap="round" />+ <path+ d="M10 24C10 24 12.5 20 16 20C19.5 20 22 24 22 24"+ stroke="#ef4444"+ strokeWidth="2"+ strokeLinecap="round"+ />+ </svg>+ );+}++export function ConfusedIcon({ size = 22, className }: IconProps) {+ return (+ <svg+ width={size}+ height={size}+ viewBox="0 0 32 32"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ className={className}+ >+ <circle cx="16" cy="16" r="14" stroke="#eab308" strokeWidth="2" fill="none" />+ <circle cx="11" cy="13" r="2" fill="#eab308" />+ <circle cx="21" cy="13" r="2" fill="#eab308" />+ <path+ d="M11 22C11 22 13 19 16 21C19 23 21 20 21 20"+ stroke="#eab308"+ strokeWidth="2"+ strokeLinecap="round"+ />+ </svg>+ );+}++export type SentimentType = 'happy' | 'neutral' | 'sad' | 'angry' | 'confused';++interface SentimentIconProps extends IconProps {+ sentiment: SentimentType;+}++export function SentimentIcon({ sentiment, ...props }: SentimentIconProps) {+ switch (sentiment) {+ case 'happy':+ return <HappyIcon {...props} />;+ case 'neutral':+ return <NeutralIcon {...props} />;+ case 'sad':+ return <SadIcon {...props} />;+ case 'angry':+ return <AngryIcon {...props} />;+ case 'confused':+ return <ConfusedIcon {...props} />;+ default:+ return <NeutralIcon {...props} />;+ }+}diff --git a/src/renderer/components/recording/LiveAssistPanel.tsx b/src/renderer/components/recording/LiveAssistPanel.tsxnew file mode 100644index 0000000..23f5d01--- /dev/null+++ b/src/renderer/components/recording/LiveAssistPanel.tsx@@ -0,0 +1,121 @@+/**+ * Live Assist Panel Component+ *+ * Shows live AI insights and MCP findings during recording:+ * - Bullet list of insights/suggestions+ * - MCP Findings section with markdown content+ */++import React from 'react';+import { Zap } from 'lucide-react';+import ReactMarkdown from 'react-markdown';++// Lightning bolt icon for Live Assist+function LightbulbIcon() {+ return (+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ d="M10 2.5C6.54822 2.5 3.75 5.29822 3.75 8.75C3.75 10.9196 4.86607 12.8304 6.5625 13.9062V15.625C6.5625 16.3154 7.12214 16.875 7.8125 16.875H12.1875C12.8779 16.875 13.4375 16.3154 13.4375 15.625V13.9062C15.1339 12.8304 16.25 10.9196 16.25 8.75C16.25 5.29822 13.4518 2.5 10 2.5Z"+ stroke="#EC5B16"+ strokeWidth="1.5"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ <path d="M7.5 17.5H12.5" stroke="#EC5B16" strokeWidth="1.5" strokeLinecap="round" />+ </svg>+ );+}++// Empty state icon+function EmptyInsightsIcon() {+ return (+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ d="M18 6L8 18H15L14 26L24 14H17L18 6Z"+ stroke="#969696"+ strokeWidth="1.5"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ );+}++interface LiveAssistPanelProps {+ insights: string[];+ mcpFindings: string;+}++export function LiveAssistPanel({ insights, mcpFindings }: LiveAssistPanelProps) {+ const hasContent = insights.length > 0 || mcpFindings.length > 0;++ return (+ <div className="bg-white border border-[#e4e4ec] rounded-[12px] shadow-[0px_1px_3px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.02)] p-[17px] flex flex-col gap-[20px] max-h-[520px]">+ {/* Header */}+ <div className="flex items-center gap-[6px]">+ <LightbulbIcon />+ <span className="font-medium text-[16px] text-black">Live Assist</span>+ </div>++ {/* Insights List */}+ {insights.length > 0 && (+ <div className="flex flex-col gap-[6px]">+ {insights.map((insight, idx) => (+ <div key={idx} className="flex items-start">+ <span className="text-[14px] text-black leading-[22px]">+ <span className="mr-2">•</span>+ {insight}+ </span>+ </div>+ ))}+ </div>+ )}++ {/* MCP Findings Section */}+ <div className="border border-[#efefef] rounded-[12px] overflow-hidden">+ {/* MCP Findings Header */}+ <div className="bg-[#f7f7f7] border-b border-[#efefef] px-[16px] py-[12px]">+ <span className="font-medium text-[14px] text-black tracking-[0.07px]">+ MCP Findings+ </span>+ </div>++ {/* MCP Findings Content */}+ <div className="bg-white p-[16px]">+ {mcpFindings ? (+ <div className="prose prose-sm max-w-none text-[14px] text-black leading-[22px]">+ <ReactMarkdown+ components={{+ p: ({ children }) => <p className="mb-2 last:mb-0">{children}</p>,+ a: ({ href, children }) => (+ <a+ href={href}+ className="text-[#ec5b16] underline decoration-solid"+ target="_blank"+ rel="noopener noreferrer"+ >+ {children}+ </a>+ ),+ ul: ({ children }) => <ul className="list-disc ml-5 mb-2">{children}</ul>,+ li: ({ children }) => <li className="mb-1">{children}</li>,+ }}+ >+ {mcpFindings}+ </ReactMarkdown>+ </div>+ ) : (+ <div className="flex flex-col items-center gap-[16px] py-[14px]">+ <EmptyInsightsIcon />+ <p className="text-[13px] text-[#969696] text-center leading-[18.75px]">+ See live results triggered by conversation keywords+ </p>+ </div>+ )}+ </div>+ </div>+ </div>+ );+}++export default LiveAssistPanel;diff --git a/src/renderer/components/recording/MeetingAgendaPanel.tsx b/src/renderer/components/recording/MeetingAgendaPanel.tsxnew file mode 100644index 0000000..a06950c--- /dev/null+++ b/src/renderer/components/recording/MeetingAgendaPanel.tsx@@ -0,0 +1,149 @@+/**+ * Meeting Agenda Panel Component+ *+ * Shows meeting checklist items during recording:+ * - Collapsible header with chevron+ * - Checkbox items with orange accent+ */++import React, { useState } from 'react';+import { ChevronDown, ChevronUp, Check } from 'lucide-react';++// Clipboard check icon+function ClipboardCheckIcon() {+ return (+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ d="M13.333 3.333H15a1.667 1.667 0 011.667 1.667v11.667A1.667 1.667 0 0115 18.333H5a1.667 1.667 0 01-1.667-1.666V5a1.667 1.667 0 011.667-1.667h1.667"+ stroke="#EC5B16"+ strokeWidth="1.5"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ <path+ d="M12.5 1.667h-5A.833.833 0 006.667 2.5v1.667c0 .46.373.833.833.833h5c.46 0 .833-.373.833-.833V2.5a.833.833 0 00-.833-.833z"+ stroke="#EC5B16"+ strokeWidth="1.5"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ <path+ d="M7.5 10l1.667 1.667L12.5 8.333"+ stroke="#EC5B16"+ strokeWidth="1.5"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ );+}++interface ChecklistItemProps {+ text: string;+ checked: boolean;+ onToggle: () => void;+}++function ChecklistItem({ text, checked, onToggle }: ChecklistItemProps) {+ return (+ <div+ className="bg-[#fff5ec] border border-[rgba(236,91,22,0.2)] rounded-[10px] px-[13px] py-[9px] flex items-center gap-[12px] cursor-pointer hover:bg-[#ffeddb] transition-colors w-full"+ onClick={onToggle}+ >+ {/* Checkbox */}+ <div+ className={`w-[16px] h-[16px] rounded-[4px] flex items-center justify-center shrink-0 transition-colors ${+ checked+ ? 'bg-[#ec5b16] border border-[#ec5b16]'+ : 'bg-white border border-[#efefef]'+ }`}+ >+ {checked && <Check className="w-[14px] h-[14px] text-white" strokeWidth={3} />}+ </div>++ {/* Text */}+ <p+ className={`flex-1 text-[14px] leading-[24px] tracking-[0.07px] ${+ checked ? 'line-through text-[#969696]' : 'text-black'+ }`}+ >+ {text}+ </p>+ </div>+ );+}++interface MeetingAgendaPanelProps {+ checklist: string[];+ checkedItems?: Set<number>;+ onToggleItem?: (index: number) => void;+ defaultExpanded?: boolean;+}++export function MeetingAgendaPanel({+ checklist,+ checkedItems = new Set(),+ onToggleItem,+ defaultExpanded = true,+}: MeetingAgendaPanelProps) {+ const [isExpanded, setIsExpanded] = useState(defaultExpanded);+ const [localCheckedItems, setLocalCheckedItems] = useState<Set<number>>(checkedItems);++ const handleToggle = (index: number) => {+ if (onToggleItem) {+ onToggleItem(index);+ } else {+ setLocalCheckedItems((prev) => {+ const newSet = new Set(prev);+ if (newSet.has(index)) {+ newSet.delete(index);+ } else {+ newSet.add(index);+ }+ return newSet;+ });+ }+ };++ const effectiveCheckedItems = onToggleItem ? checkedItems : localCheckedItems;++ if (checklist.length === 0) {+ return null;+ }++ return (+ <div className="bg-white border border-[#efefef] rounded-[16px] p-[16px] flex flex-col gap-[20px]">+ {/* Header */}+ <div+ className="flex items-center gap-[6px] cursor-pointer"+ onClick={() => setIsExpanded(!isExpanded)}+ >+ <div className="flex-1 flex items-center gap-[4px]">+ <ClipboardCheckIcon />+ <span className="font-medium text-[16px] text-black">Meeting Agenda</span>+ </div>+ {isExpanded ? (+ <ChevronUp className="w-[24px] h-[24px] text-[#464646]" />+ ) : (+ <ChevronDown className="w-[24px] h-[24px] text-[#464646]" />+ )}+ </div>++ {/* Content */}+ {isExpanded && (+ <div className="flex flex-col gap-[10px]">+ {checklist.map((item, idx) => (+ <ChecklistItem+ key={idx}+ text={item}+ checked={effectiveCheckedItems.has(idx)}+ onToggle={() => handleToggle(idx)}+ />+ ))}+ </div>+ )}+ </div>+ );+}++export default MeetingAgendaPanel;diff --git a/src/renderer/components/recording/MetricsBar.tsx b/src/renderer/components/recording/MetricsBar.tsxnew file mode 100644index 0000000..6f1d0c3--- /dev/null+++ b/src/renderer/components/recording/MetricsBar.tsx@@ -0,0 +1,78 @@+/**+ * Metrics Bar Component+ *+ * Shows recording metrics:+ * - Talk ratio (You vs Them with progress bar)+ * - Health score with colored border+ * - Sentiment indicator+ */++import React from 'react';+import { useCopilotStore } from '../../stores/copilot.store';+import { SentimentIcon, type SentimentType } from '../icons/SentimentIcons';++export function MetricsBar() {+ const { metrics, healthScore, isCallActive } = useCopilotStore();++ const mePercent = metrics ? Math.round(metrics.talkRatio.me * 100) : 50;+ const themPercent = metrics ? Math.round(metrics.talkRatio.them * 100) : 50;++ // Determine health color (Figma colors)+ const getHealthBorderColor = () => {+ if (healthScore >= 70) return 'border-[#559e58]';+ if (healthScore >= 50) return 'border-[#eab308]';+ return 'border-[#ef4444]';+ };++ // Map health score to sentiment type+ const getSentimentType = (): SentimentType => {+ if (healthScore >= 70) return 'happy';+ if (healthScore >= 50) return 'neutral';+ if (healthScore >= 30) return 'sad';+ return 'angry';+ };++ return (+ <div className="flex items-center gap-[16px] h-[35px]">+ {/* Talk Ratio Pill */}+ <div className="bg-white border border-[#efefef] rounded-[40px] h-full px-[16px] py-[4px] flex items-center">+ <div className="flex items-center gap-[12px]">+ <span className="text-[14px] text-[#464646] tracking-[0.07px] whitespace-nowrap">+ You: {mePercent}%+ </span>+ {/* Progress bar */}+ <div className="w-[106px] h-[7px] bg-[#f0f0f5] rounded-[4px] overflow-hidden relative">+ {/* Me portion (orange) */}+ <div+ className="absolute top-0 left-0 h-full bg-[#ec5b16] rounded-l-[4px]"+ style={{ width: `${mePercent}%` }}+ />+ {/* Them portion (blue) */}+ <div+ className="absolute top-0 right-0 h-full bg-[#3b82f6] rounded-r-[4px]"+ style={{ width: `${themPercent}%` }}+ />+ </div>+ <span className="text-[14px] text-[#464646] tracking-[0.07px] whitespace-nowrap">+ Them: {themPercent}%+ </span>+ </div>+ </div>++ {/* Health Score Pill */}+ {isCallActive && (+ <div+ className={`bg-white border ${getHealthBorderColor()} rounded-[40px] px-[11px] py-[9px] flex items-center gap-[6px] w-[91px]`}+ >+ <span className="text-[14px] text-black tracking-[0.07px]">Health</span>+ <span className="font-semibold text-[14px] text-black text-right">{healthScore}</span>+ </div>+ )}++ {/* Sentiment Indicator */}+ {isCallActive && <SentimentIcon sentiment={getSentimentType()} size={22} />}+ </div>+ );+}++export default MetricsBar;diff --git a/src/renderer/components/recording/RecordingHeader.tsx b/src/renderer/components/recording/RecordingHeader.tsxnew file mode 100644index 0000000..caeb127--- /dev/null+++ b/src/renderer/components/recording/RecordingHeader.tsx@@ -0,0 +1,166 @@+/**+ * Recording Header Component+ *+ * Header for recording view with:+ * - Meeting name and time+ * - Recording timer with red dot+ * - Pause/Stop buttons+ */++import React from 'react';+import { Pause, Square, Loader2 } from 'lucide-react';+import { useSession } from '../../hooks/useSession';+import { useMeetingSetupStore } from '../../stores/meeting-setup.store';++// Clock icon+function ClockIcon() {+ return (+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">+ <circle cx="8" cy="8" r="6" stroke="#464646" strokeWidth="1.25" />+ <path+ d="M8 4.5v4l2.5 1.5"+ stroke="#464646"+ strokeWidth="1.25"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ );+}++// Pause icon+function PauseIcon() {+ return (+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+ <rect x="5" y="4" width="3" height="12" rx="1" fill="currentColor" />+ <rect x="12" y="4" width="3" height="12" rx="1" fill="currentColor" />+ </svg>+ );+}++// Stop icon+function StopIcon() {+ return (+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+ <rect x="5" y="5" width="10" height="10" rx="1" fill="white" />+ </svg>+ );+}++// Play icon (for resume)+function PlayIcon() {+ return (+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path d="M6 4L16 10L6 16V4Z" fill="currentColor" />+ </svg>+ );+}++function formatTime(seconds: number): string {+ const mins = Math.floor(seconds / 60);+ const secs = seconds % 60;+ return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;+}++function formatTimeRange(): string {+ const now = new Date();+ const endTime = new Date(now.getTime() + 45 * 60 * 1000); // 45 min meeting+ const formatTime = (date: Date) =>+ date.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true });+ return `${formatTime(now)} - ${formatTime(endTime)}`;+}++export function RecordingHeader() {+ const { status, elapsedTime, isRecording, isStopping, isPaused, stopRecording, pauseRecording, resumeRecording } = useSession();+ const { name } = useMeetingSetupStore();++ const meetingName = name || 'Meeting';++ return (+ <div className="flex items-center gap-[12px] p-[20px]">+ {/* Title section */}+ <div className="flex-1 flex flex-col gap-[10px]">+ <h1 className="font-semibold text-[24px] text-black tracking-[0.12px]">{meetingName}</h1>+ <div className="flex items-center gap-[4px]">+ <ClockIcon />+ <span className="text-[14px] text-[#464646] tracking-[0.07px]">{formatTimeRange()}</span>+ </div>+ </div>++ {/* Controls section */}+ <div className="flex items-center gap-[12px]">+ {/* Timer */}+ <div className="flex items-center gap-[10px]">+ {/* Recording indicator dot */}+ <div+ className={`w-[8px] h-[8px] rounded-[4px] ${+ isPaused+ ? 'bg-[#eab308]'+ : isRecording+ ? 'bg-[#d1242f] animate-pulse'+ : 'bg-[#969696]'+ }`}+ />+ {/* Time display */}+ <span className="font-mono font-medium text-[24px] text-black tracking-[0.12px]">+ {formatTime(elapsedTime)}+ </span>+ </div>++ {/* Pause/Resume Recording button */}+ {isRecording && !isStopping && (+ <button+ onClick={isPaused ? resumeRecording : pauseRecording}+ className={`flex items-center gap-[6px] bg-white border rounded-[12px] pl-[16px] pr-[20px] py-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)] hover:bg-[#f7f7f7] transition-colors ${+ isPaused ? 'border-[#ec5b16]' : 'border-[#efefef]'+ }`}+ >+ {isPaused ? <PlayIcon /> : <PauseIcon />}+ <span className={`font-semibold text-[14px] tracking-[-0.28px] ${isPaused ? 'text-[#ec5b16]' : 'text-black'}`}>+ {isPaused ? 'Resume Recording' : 'Pause Recording'}+ </span>+ </button>+ )}++ {/* Stop button */}+ {isRecording && !isStopping && (+ <button+ onClick={stopRecording}+ className="flex items-center gap-[4px] bg-[#ef4444] rounded-[12px] px-[20px] py-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)] hover:bg-[#dc2626] transition-colors"+ >+ <StopIcon />+ <span className="font-semibold text-[14px] text-white tracking-[-0.28px]">Stop</span>+ </button>+ )}++ {/* Stopping state */}+ {isStopping && (+ <button+ disabled+ className="flex items-center gap-[4px] bg-[#f7f7f7] border border-[#efefef] rounded-[12px] px-[20px] py-[12px] cursor-not-allowed"+ >+ <Loader2 className="w-[20px] h-[20px] animate-spin text-[#969696]" />+ <span className="font-semibold text-[14px] text-[#969696] tracking-[-0.28px]">+ Stopping...+ </span>+ </button>+ )}++ {/* Starting state */}+ {status === 'starting' && (+ <button+ disabled+ className="flex items-center gap-[4px] bg-[#f7f7f7] border border-[#efefef] rounded-[12px] px-[20px] py-[12px] cursor-not-allowed"+ >+ <Loader2 className="w-[20px] h-[20px] animate-spin text-[#969696]" />+ <span className="font-semibold text-[14px] text-[#969696] tracking-[-0.28px]">+ Starting...+ </span>+ </button>+ )}+ </div>+ </div>+ );+}++export default RecordingHeader;diff --git a/src/renderer/components/recording/index.ts b/src/renderer/components/recording/index.tsnew file mode 100644index 0000000..1f79510--- /dev/null+++ b/src/renderer/components/recording/index.ts@@ -0,0 +1,7 @@+export { RecordingHeader } from './RecordingHeader';+export { MetricsBar } from './MetricsBar';+export { LiveAssistPanel } from './LiveAssistPanel';+export { MeetingAgendaPanel } from './MeetingAgendaPanel';+export { SessionControls } from './SessionControls';+export { StreamToggles } from './StreamToggles';+export { TopStatusBar } from './TopStatusBar';diff --git a/src/renderer/components/transcription/TranscriptionPanel.tsx b/src/renderer/components/transcription/TranscriptionPanel.tsxindex bc24909..0dcde79 100644--- a/src/renderer/components/transcription/TranscriptionPanel.tsx+++ b/src/renderer/components/transcription/TranscriptionPanel.tsx@@ -1,213 +1,312 @@/*** Transcription Panel Component*- * Modern chat-like interface for live transcription:- * - Avatar indicators (Me/Them)- * - Timestamp badges- * - Styled message bubbles- * - Auto-scroll to latest+ * Design matching Figma:+ * - Header with transcript icon and Visual Analysis toggle+ * - Timestamp badges (orange for You, blue for Them)+ * - Visual Analysis entries with blue styling+ * - Gradient overlays at top and bottom*/-import React, { useEffect, useRef } from 'react';-import { Mic, Volume2 } from 'lucide-react';-import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';-import { ScrollArea } from '../ui/scroll-area';-import { Switch } from '../ui/switch';-import { Badge } from '../ui/badge';+import React, { useEffect, useRef, useCallback } from 'react';+import ReactMarkdown from 'react-markdown';import { useTranscriptionStore, TranscriptItem } from '../../stores/transcription.store';+import { useVisualIndexStore, VisualIndexItem } from '../../stores/visual-index.store';import { useSessionStore } from '../../stores/session.store';-import { cn } from '../../lib/utils';+import { trpc } from '../../api/trpc';++// Sparkle icon for Meeting Transcript+function SparkleIcon() {+ return (+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ d="M10 2.5L11.5 7L16.25 8.125L12.5 11.25L13.125 16.25L10 13.75L6.875 16.25L7.5 11.25L3.75 8.125L8.5 7L10 2.5Z"+ stroke="#EC5B16"+ strokeWidth="1.5"+ strokeLinecap="round"+ strokeLinejoin="round"+ fill="rgba(236, 91, 22, 0.1)"+ />+ </svg>+ );+}++interface ToggleProps {+ enabled: boolean;+ onChange: (enabled: boolean) => void;+}++function Toggle({ enabled, onChange }: ToggleProps) {+ return (+ <button+ onClick={() => onChange(!enabled)}+ className={`w-[28.8px] h-[16px] rounded-[16px] relative transition-colors ${+ enabled ? 'bg-[#ec5b16]' : 'bg-[#e4e4ec]'+ }`}+ >+ <div+ className={`absolute w-[12px] h-[12px] bg-white rounded-[6px] top-[2px] shadow-[0px_1px_3px_0px_rgba(0,0,0,0.15)] transition-all ${+ enabled ? 'left-[14.8px]' : 'left-[2px]'+ }`}+ />+ </button>+ );+}interface TranscriptMessageProps {item: TranscriptItem;- isLive?: boolean;}-function TranscriptMessage({ item, isLive }: TranscriptMessageProps) {+function TranscriptMessage({ item }: TranscriptMessageProps) {const isMe = item.source === 'mic';- // Format timestamp from epoch to MM:SS relative to recording start- const formatTime = (timestamp: number) => {- // For now, just show time since we don't have recording start time here- const date = new Date(timestamp);- return date.toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit' });+ // Format relative timestamp (MM:SS from recording start)+ const formatRelativeTime = (timestamp: number) => {+ const startTime = useSessionStore.getState().startTime;+ if (!startTime) return '0:00';+ const relativeMs = timestamp - startTime;+ const totalSeconds = Math.max(0, Math.floor(relativeMs / 1000));+ const minutes = Math.floor(totalSeconds / 60);+ const seconds = totalSeconds % 60;+ return `${minutes}:${seconds.toString().padStart(2, '0')}`;};return (- <div- className={cn(- 'animate-in slide-in-from-bottom-2 duration-300',- isLive && 'opacity-90'- )}- >- <div className="flex gap-3">- {/* Avatar */}+ <div className="flex flex-col gap-[8px]">+ {/* Speaker row */}+ <div className="bg-[#f9fafb] rounded-[10px] px-[8px] py-[6px] flex items-center gap-[12px]">+ {/* Timestamp badge */}<div- className={cn(- 'w-8 h-8 rounded-full flex items-center justify-center text-xs font-semibold shrink-0 mt-1',- isMe- ? 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300'- : 'bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300'- )}+ className={`px-[8px] py-[4px] rounded-[7px] ${+ isMe ? 'bg-[#ffe9d3]' : 'bg-[rgba(45,140,255,0.2)]'+ }`}>- {isMe ? (- <Mic className="w-4 h-4" />- ) : (- <Volume2 className="w-4 h-4" />- )}+ <span+ className={`font-semibold text-[13px] leading-[16px] ${+ isMe ? 'text-[#ec5b16]' : 'text-[#2d8cff]'+ }`}+ >+ {formatRelativeTime(item.timestamp)}+ </span></div>+ {/* Speaker name */}+ <span className="font-medium text-[13px] text-black leading-[16px]">+ {isMe ? 'You' : 'Them'}+ </span>+ </div>+ {/* Text content */}+ <p className="text-[14px] text-black leading-[22px]">{item.text}</p>+ </div>+ );+}- {/* Content */}- <div className="flex-1 max-w-3xl">- <div className="flex items-center gap-2 mb-1">- <span- className={cn(- 'text-xs font-medium',- isMe ? 'text-blue-600 dark:text-blue-400' : 'text-purple-600 dark:text-purple-400'- )}- >- {isMe ? 'You' : 'Them'}- </span>- <span className="text-xs text-slate-400">{formatTime(item.timestamp)}</span>- {isLive && (- <Badge variant="secondary" className="text-xs px-1.5 py-0 h-4">- LIVE- </Badge>- )}- </div>+interface VisualAnalysisEntryProps {+ item: VisualIndexItem;+}- <div- className={cn(- 'rounded-2xl px-4 py-3 text-sm leading-relaxed',- isMe- ? 'bg-blue-50 dark:bg-blue-950/30 text-slate-900 dark:text-slate-100'- : 'bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 text-slate-900 dark:text-slate-100',- isLive && 'italic opacity-80'- )}- >- {item.text}- </div>+function VisualAnalysisEntry({ item }: VisualAnalysisEntryProps) {+ // Format relative timestamp using when the item was received (same as transcripts)+ const formatRelativeTime = () => {+ const startTime = useSessionStore.getState().startTime;+ if (!startTime) return '0:00';+ const relativeMs = item.timestamp - startTime;+ const totalSeconds = Math.max(0, Math.floor(relativeMs / 1000));+ const minutes = Math.floor(totalSeconds / 60);+ const seconds = totalSeconds % 60;+ return `${minutes}:${seconds.toString().padStart(2, '0')}`;+ };++ return (+ <div className="bg-[#eff6ff] border border-[#5095fb] rounded-[10px] p-[12px] flex flex-col gap-[12px]">+ {/* Header row */}+ <div className="flex items-center gap-[12px]">+ <div className="bg-white px-[8px] py-[4px] rounded-[7px]">+ <span className="font-semibold text-[13px] text-[#5095fb] leading-[16px]">+ {formatRelativeTime()}+ </span></div>+ <span className="font-medium text-[13px] text-black leading-[16px]">Visual Analysis</span>+ </div>+ {/* Content with markdown rendering */}+ <div className="text-[14px] text-black leading-[24px] prose prose-sm max-w-none prose-p:my-1 prose-ul:my-1 prose-ol:my-1 prose-li:my-0">+ <ReactMarkdown>{item.text}</ReactMarkdown></div></div>);}-function PendingMessage({ text, source }: { text: string; source: 'mic' | 'system_audio' }) {+interface PendingMessageProps {+ text: string;+ source: 'mic' | 'system_audio';+}++function PendingMessage({ text, source }: PendingMessageProps) {const isMe = source === 'mic';return (- <div className="flex gap-3 opacity-60">- <div- className={cn(- 'w-8 h-8 rounded-full flex items-center justify-center text-xs font-semibold shrink-0 mt-1',- isMe- ? 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300'- : 'bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300'- )}- >- {isMe ? <Mic className="w-4 h-4" /> : <Volume2 className="w-4 h-4" />}- </div>- <div className="flex-1 max-w-3xl">- <div className="flex items-center gap-2 mb-1">+ <div className="flex flex-col gap-[8px] opacity-70">+ {/* Speaker row */}+ <div className="bg-[#f9fafb] rounded-[10px] px-[8px] py-[6px] flex items-center gap-[12px]">+ <div+ className={`px-[8px] py-[4px] rounded-[7px] animate-pulse ${+ isMe ? 'bg-[#ffe9d3]' : 'bg-[rgba(45,140,255,0.2)]'+ }`}+ ><span- className={cn(- 'text-xs font-medium',- isMe ? 'text-blue-600 dark:text-blue-400' : 'text-purple-600 dark:text-purple-400'- )}+ className={`font-semibold text-[13px] leading-[16px] ${+ isMe ? 'text-[#ec5b16]' : 'text-[#2d8cff]'+ }`}>- {isMe ? 'You' : 'Customer'}+ ...</span>- <Badge variant="outline" className="text-xs px-1.5 py-0 h-4 animate-pulse">- Speaking...- </Badge>- </div>- <div- className={cn(- 'rounded-2xl px-4 py-3 text-sm leading-relaxed italic',- isMe- ? 'bg-blue-50/50 dark:bg-blue-950/20'- : 'bg-slate-50 dark:bg-slate-800/50 border border-slate-200/50 dark:border-slate-700/50'- )}- >- {text}</div>+ <span className="font-medium text-[13px] text-black leading-[16px]">+ {isMe ? 'You' : 'Them'}+ </span></div>+ {/* Text content */}+ <p className="text-[14px] text-black leading-[22px] italic">{text}</p></div>);}export function TranscriptionPanel() {- const { items, enabled, pendingMic, pendingSystemAudio, setEnabled } = useTranscriptionStore();- const { status } = useSessionStore();+ const { items, enabled, pendingMic, pendingSystemAudio } = useTranscriptionStore();+ const visualIndexStore = useVisualIndexStore();+ const { items: visualItems, enabled: visualAnalysisEnabled, isRunning, sceneIndexId } = visualIndexStore;+ const { status, sessionId, screenWsConnectionId } = useSessionStore();const scrollRef = useRef<HTMLDivElement>(null);const isRecording = status === 'recording';+ // tRPC mutations for visual index control+ const startVisualIndexMutation = trpc.visualIndex.start.useMutation();+ const pauseVisualIndexMutation = trpc.visualIndex.pause.useMutation();+ const resumeVisualIndexMutation = trpc.visualIndex.resume.useMutation();++ // Handle visual analysis toggle - starts/pauses indexing+ const handleVisualAnalysisToggle = useCallback(async (newEnabled: boolean) => {+ if (!isRecording || !sessionId || !screenWsConnectionId) {+ // Just toggle visibility if not recording or no screen ws+ visualIndexStore.setEnabled(newEnabled);+ return;+ }++ visualIndexStore.setEnabled(newEnabled);++ if (newEnabled) {+ // Turning ON - start or resume visual indexing+ if (!sceneIndexId) {+ // First time - start visual indexing+ try {+ const result = await startVisualIndexMutation.mutateAsync({+ sessionId,+ screenWsConnectionId,+ });+ if (result.success && result.sceneIndexId) {+ visualIndexStore.setSceneIndexId(result.sceneIndexId);+ visualIndexStore.setRunning(true);+ }+ } catch (error) {+ console.error('[VisualIndex] Failed to start:', error);+ }+ } else {+ // Resume existing scene index+ try {+ const result = await resumeVisualIndexMutation.mutateAsync({ sessionId });+ if (result.success) {+ visualIndexStore.setRunning(true);+ }+ } catch (error) {+ console.error('[VisualIndex] Failed to resume:', error);+ }+ }+ } else {+ // Turning OFF - pause visual indexing+ if (sceneIndexId && isRunning) {+ try {+ const result = await pauseVisualIndexMutation.mutateAsync({ sessionId });+ if (result.success) {+ visualIndexStore.setRunning(false);+ }+ } catch (error) {+ console.error('[VisualIndex] Failed to pause:', error);+ }+ }+ }+ }, [isRecording, sessionId, screenWsConnectionId, sceneIndexId, isRunning, visualIndexStore, startVisualIndexMutation, pauseVisualIndexMutation, resumeVisualIndexMutation]);+// Auto-scroll to bottom when new items arriveuseEffect(() => {if (scrollRef.current) {- const scrollElement = scrollRef.current.querySelector('[data-radix-scroll-area-viewport]');- if (scrollElement) {- scrollElement.scrollTop = scrollElement.scrollHeight;- }+ scrollRef.current.scrollTop = scrollRef.current.scrollHeight;}- }, [items, pendingMic, pendingSystemAudio]);+ }, [items, visualItems, pendingMic, pendingSystemAudio]);return (- <Card className="h-full flex flex-col overflow-hidden">- <CardHeader className="pb-3 flex-shrink-0 border-b">- <div className="flex items-center justify-between">- <div>- <CardTitle className="text-base font-semibold">Live Transcription</CardTitle>- <p className="text-xs text-slate-500 mt-0.5">Real-time conversation feed</p>- </div>- <div className="flex items-center gap-2">- <span className="text-xs text-muted-foreground">- {enabled ? 'Enabled' : 'Disabled'}+ <div className="flex flex-col h-full gap-[20px] pt-[8px]">+ {/* Header */}+ <div className="flex items-center gap-[4px] shrink-0">+ <SparkleIcon />+ <h2 className="flex-1 font-semibold text-[18px] text-black tracking-[0.09px]">+ Meeting Transcript+ </h2>+ {/* Visual Analysis Toggle - only show during recording with screen enabled */}+ {isRecording && screenWsConnectionId && (+ <div className="flex items-center gap-[6px]">+ <span className="font-medium text-[14px] text-[#464646] leading-[18px]">+ Visual Analysis</span>- <Switch checked={enabled} onCheckedChange={setEnabled} disabled={isRecording} />+ <Toggle enabled={visualAnalysisEnabled} onChange={handleVisualAnalysisToggle} /></div>- </div>- </CardHeader>-- <CardContent className="flex-1 overflow-hidden p-0">- <ScrollArea className="h-full" ref={scrollRef}>- <div className="p-6 space-y-4">- {items.length === 0 && !pendingMic && !pendingSystemAudio ? (- <div className="flex flex-col items-center justify-center h-64 text-center">- <div className="w-16 h-16 rounded-full bg-slate-100 dark:bg-slate-800 flex items-center justify-center mb-4">- <Mic className="w-8 h-8 text-slate-400" />- </div>- <p className="text-slate-500 dark:text-slate-400 font-medium">- {enabled- ? isRecording- ? 'Waiting for speech...'- : 'Start recording to see transcription'- : 'Enable transcription to see live text'}- </p>- <p className="text-xs text-slate-400 mt-1">- {enabled && !isRecording && 'Click the Start Recording button above'}- </p>+ )}+ </div>++ {/* Transcript Container */}+ <div className="flex-1 min-h-0 border border-[rgba(4,4,4,0.1)] rounded-[16px] relative overflow-hidden">+ {/* Top gradient overlay */}+ <div className="absolute top-0 left-0 right-0 h-[52px] rounded-t-[15px] bg-gradient-to-b from-white to-transparent pointer-events-none z-10" />++ {/* Scrollable content */}+ <div+ ref={scrollRef}+ className="h-full overflow-y-auto px-[20px] py-[20px] flex flex-col gap-[10px] [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]"+ >+ {items.length === 0 && !pendingMic && !pendingSystemAudio ? (+ <div className="flex flex-col items-center justify-center h-full text-center py-16">+ <div className="w-[64px] h-[64px] rounded-full bg-[#f7f7f7] flex items-center justify-center mb-4">+ <SparkleIcon /></div>- ) : (- <>- {items.map((item) => (- <TranscriptMessage- key={item.id}- item={item}- />- ))}-- {/* Pending transcripts */}- {pendingMic && <PendingMessage text={pendingMic} source="mic" />}- {pendingSystemAudio && <PendingMessage text={pendingSystemAudio} source="system_audio" />}- </>- )}- </div>- </ScrollArea>- </CardContent>- </Card>+ <p className="text-[#464646] font-medium text-[14px]">+ {enabled+ ? isRecording+ ? 'Waiting for speech...'+ : 'Start recording to see transcription'+ : 'Enable transcription to see live text'}+ </p>+ </div>+ ) : (+ <>+ {items.map((item) => (+ <TranscriptMessage key={item.id} item={item} />+ ))}++ {/* Visual Analysis entries */}+ {visualAnalysisEnabled && visualItems.map((item) => (+ <VisualAnalysisEntry key={item.id} item={item} />+ ))}++ {/* Pending transcripts */}+ {pendingMic && <PendingMessage text={pendingMic} source="mic" />}+ {pendingSystemAudio && <PendingMessage text={pendingSystemAudio} source="system_audio" />}+ </>+ )}+ </div>++ {/* Bottom gradient overlay */}+ <div className="absolute bottom-0 left-0 right-0 h-[51px] rounded-b-[15px] bg-gradient-to-t from-white to-transparent pointer-events-none z-10" />+ </div>+ </div>);}diff --git a/src/renderer/hooks/useGlobalRecorderEvents.ts b/src/renderer/hooks/useGlobalRecorderEvents.tsindex b954f9f..cf86e35 100644--- a/src/renderer/hooks/useGlobalRecorderEvents.ts+++ b/src/renderer/hooks/useGlobalRecorderEvents.ts@@ -1,9 +1,10 @@import { useEffect, useRef } from 'react';import { useSessionStore } from '../stores/session.store';import { useTranscriptionStore } from '../stores/transcription.store';+import { useVisualIndexStore } from '../stores/visual-index.store';import { useCopilotStore } from '../stores/copilot.store';import { getElectronAPI } from '../api/ipc';-import type { RecorderEvent, TranscriptEvent } from '../../shared/types/ipc.types';+import type { RecorderEvent, TranscriptEvent, VisualIndexEvent } from '../../shared/types/ipc.types';/*** Global hook to listen for recorder events from the main process.@@ -13,10 +14,12 @@ import type { RecorderEvent, TranscriptEvent } from '../../shared/types/ipc.typeexport function useGlobalRecorderEvents() {const sessionStore = useSessionStore();const transcriptionStore = useTranscriptionStore();+ const visualIndexStore = useVisualIndexStore();// Use refs to avoid re-subscribing when stores changeconst sessionStoreRef = useRef(sessionStore);const transcriptionStoreRef = useRef(transcriptionStore);+ const visualIndexStoreRef = useRef(visualIndexStore);// Keep refs updateduseEffect(() => {@@ -27,6 +30,10 @@ export function useGlobalRecorderEvents() {transcriptionStoreRef.current = transcriptionStore;}, [transcriptionStore]);+ useEffect(() => {+ visualIndexStoreRef.current = visualIndexStore;+ }, [visualIndexStore]);+useEffect(() => {const api = getElectronAPI();if (!api) return;@@ -36,6 +43,7 @@ export function useGlobalRecorderEvents() {const unsubscribe = api.on.recorderEvent((event: RecorderEvent) => {const session = sessionStoreRef.current;const transcription = transcriptionStoreRef.current;+ const visualIndex = visualIndexStoreRef.current;console.log('[GlobalRecorderEvents] Event received:', event.event, event.data);@@ -83,6 +91,19 @@ export function useGlobalRecorderEvents() {}break;+ case 'visual_index':+ if (event.data && visualIndex.enabled) {+ const visualData = event.data as VisualIndexEvent;+ visualIndex.addItem({+ text: visualData.text,+ start: visualData.start,+ end: visualData.end,+ rtstreamId: visualData.rtstreamId,+ rtstreamName: visualData.rtstreamName,+ });+ }+ break;+case 'upload:progress':console.log('[GlobalRecorderEvents] Upload progress:', event.data);break;diff --git a/src/renderer/hooks/useSession.ts b/src/renderer/hooks/useSession.tsindex cc94830..21790f1 100644--- a/src/renderer/hooks/useSession.ts+++ b/src/renderer/hooks/useSession.ts@@ -1,6 +1,7 @@import { useEffect, useCallback, useRef } from 'react';import { useSessionStore } from '../stores/session.store';import { useTranscriptionStore } from '../stores/transcription.store';+import { useVisualIndexStore } from '../stores/visual-index.store';import { useConfigStore } from '../stores/config.store';import { useCopilotStore } from '../stores/copilot.store';import { useMCPStore } from '../stores/mcp.store';@@ -60,6 +61,7 @@ export function useSession() {sessionStore.setStatus('starting');transcriptionStore.clear();+ useVisualIndexStore.getState().clear();useMCPStore.getState().clearResults();try {@@ -105,6 +107,8 @@ export function useSession() {accessToken,apiUrl: apiUrl || undefined,enableTranscription: transcriptionStore.enabled,+ // Always create screen WebSocket when screen is enabled - user controls indexing via toggle+ enableVisualIndex: streamsConfig.screen,});if (!result.success) {@@ -120,11 +124,15 @@ export function useSession() {meetingChecklist: meetingSetup?.checklist,});- if (transcriptionStore.enabled && (result.micWsConnectionId || result.sysAudioWsConnectionId)) {+ const hasTranscription = transcriptionStore.enabled && (result.micWsConnectionId || result.sysAudioWsConnectionId);+ const hasVisualIndex = useVisualIndexStore.getState().enabled && result.screenWsConnectionId;++ if (hasTranscription || hasVisualIndex) {await startTranscriptionMutation.mutateAsync({sessionId: captureSession.sessionId,- micWsConnectionId: result.micWsConnectionId,- sysAudioWsConnectionId: result.sysAudioWsConnectionId,+ micWsConnectionId: transcriptionStore.enabled ? result.micWsConnectionId : undefined,+ sysAudioWsConnectionId: transcriptionStore.enabled ? result.sysAudioWsConnectionId : undefined,+ screenWsConnectionId: hasVisualIndex ? result.screenWsConnectionId : undefined,});}@@ -142,7 +150,7 @@ export function useSession() {}}- sessionStore.startSession(captureSession.sessionId, sessionToken!, tokenExpiresAt!);+ sessionStore.startSession(captureSession.sessionId, sessionToken!, tokenExpiresAt!, result.screenWsConnectionId);} catch (error) {sessionStore.setError(error instanceof Error ? error.message : 'Failed to start recording');sessionStore.setStatus('idle');@@ -191,6 +199,7 @@ export function useSession() {}transcriptionStore.clear();+ useVisualIndexStore.getState().clear();const copilotState = useCopilotStore.getState();if (!copilotState.callSummary) {@@ -207,6 +216,7 @@ export function useSession() {sessionStore.stopSession();transcriptionStore.clear();+ useVisualIndexStore.getState().clear();useCopilotStore.getState().reset();}}, [sessionStore, transcriptionStore, stopRecordingMutation]);@@ -239,11 +249,29 @@ export function useSession() {[sessionStore]);+ const pauseRecording = useCallback(async () => {+ const api = getElectronAPI();+ if (!api || sessionStore.status !== 'recording') return;++ await api.capture.pauseTracks(['mic', 'system_audio', 'screen']);+ sessionStore.setPaused(true);+ }, [sessionStore]);++ const resumeRecording = useCallback(async () => {+ const api = getElectronAPI();+ if (!api || sessionStore.status !== 'recording') return;++ await api.capture.resumeTracks(['mic', 'system_audio', 'screen']);+ sessionStore.setPaused(false);+ }, [sessionStore]);+return {...sessionStore,startRecording,stopRecording,toggleStream,+ pauseRecording,+ resumeRecording,isRecording: sessionStore.status === 'recording',isStarting: sessionStore.status === 'starting',isStopping: sessionStore.status === 'stopping',diff --git a/src/renderer/stores/session.store.ts b/src/renderer/stores/session.store.tsindex 3babbee..1947c0a 100644--- a/src/renderer/stores/session.store.ts+++ b/src/renderer/stores/session.store.ts@@ -16,17 +16,21 @@ interface SessionState {startTime: number | null;elapsedTime: number;streams: StreamState;+ isPaused: boolean;error: string | null;+ screenWsConnectionId: string | null; // For visual indexing// ActionssetStatus: (status: SessionStatus) => void;- startSession: (sessionId: string, sessionToken: string, expiresAt: number) => void;+ startSession: (sessionId: string, sessionToken: string, expiresAt: number, screenWsConnectionId?: string) => void;stopSession: () => void;setSessionToken: (token: string, expiresAt: number) => void;setElapsedTime: (time: number) => void;toggleStream: (stream: keyof StreamState) => void;setStreams: (streams: Partial<StreamState>) => void;+ setPaused: (paused: boolean) => void;setError: (error: string | null) => void;+ setScreenWsConnectionId: (id: string | null) => void;reset: () => void;isTokenExpired: () => boolean;}@@ -45,11 +49,13 @@ export const useSessionStore = create<SessionState>((set, get) => ({startTime: null,elapsedTime: 0,streams: initialStreams,+ isPaused: false,error: null,+ screenWsConnectionId: null,setStatus: (status) => set({ status }),- startSession: (sessionId, sessionToken, expiresAt) => {+ startSession: (sessionId, sessionToken, expiresAt, screenWsConnectionId) => {set({status: 'recording',sessionId,@@ -57,7 +63,9 @@ export const useSessionStore = create<SessionState>((set, get) => ({tokenExpiresAt: expiresAt,startTime: Date.now(),elapsedTime: 0,+ isPaused: false,error: null,+ screenWsConnectionId: screenWsConnectionId || null,});},@@ -67,6 +75,8 @@ export const useSessionStore = create<SessionState>((set, get) => ({sessionId: null,startTime: null,elapsedTime: 0,+ isPaused: false,+ screenWsConnectionId: null,});},@@ -98,8 +108,12 @@ export const useSessionStore = create<SessionState>((set, get) => ({});},+ setPaused: (paused) => set({ isPaused: paused }),+setError: (error) => set({ error }),+ setScreenWsConnectionId: (id) => set({ screenWsConnectionId: id }),+reset: () => {set({status: 'idle',@@ -107,6 +121,7 @@ export const useSessionStore = create<SessionState>((set, get) => ({startTime: null,elapsedTime: 0,streams: initialStreams,+ isPaused: false,error: null,});},diff --git a/src/renderer/stores/visual-index.store.ts b/src/renderer/stores/visual-index.store.tsnew file mode 100644index 0000000..e2c8f25--- /dev/null+++ b/src/renderer/stores/visual-index.store.ts@@ -0,0 +1,54 @@+import { create } from 'zustand';++export interface VisualIndexItem {+ id: string;+ text: string;+ start: number; // epoch ms from server+ end: number; // epoch ms from server+ timestamp: number; // when received (Date.now())+ rtstreamId?: string;+ rtstreamName?: string;+}++interface VisualIndexState {+ items: VisualIndexItem[];+ enabled: boolean;+ isRunning: boolean; // Whether indexing is actively running+ sceneIndexId: string | null; // ID of the created scene index++ // Actions+ addItem: (item: Omit<VisualIndexItem, 'id' | 'timestamp'>) => void;+ setEnabled: (enabled: boolean) => void;+ setRunning: (isRunning: boolean) => void;+ setSceneIndexId: (id: string | null) => void;+ clear: () => void;+}++let itemIdCounter = 0;++export const useVisualIndexStore = create<VisualIndexState>((set) => ({+ items: [],+ enabled: false, // Off by default, user toggles on to start+ isRunning: false,+ sceneIndexId: null,++ addItem: (item) => {+ const newItem: VisualIndexItem = {+ ...item,+ id: `visual-${++itemIdCounter}`,+ timestamp: Date.now(),+ };++ set((state) => ({+ items: [...state.items.slice(-50), newItem], // Keep last 50+ }));+ },++ setEnabled: (enabled) => set({ enabled }),+ setRunning: (isRunning) => set({ isRunning }),+ setSceneIndexId: (sceneIndexId) => set({ sceneIndexId }),++ clear: () => {+ set({ items: [], sceneIndexId: null, isRunning: false });+ },+}));diff --git a/src/shared/schemas/capture.schema.ts b/src/shared/schemas/capture.schema.tsindex bf34c5f..59cdba8 100644--- a/src/shared/schemas/capture.schema.ts+++ b/src/shared/schemas/capture.schema.ts@@ -15,6 +15,7 @@ export const StartTranscriptionInputSchema = z.object({sessionId: z.string(),micWsConnectionId: z.string().optional(),sysAudioWsConnectionId: z.string().optional(),+ screenWsConnectionId: z.string().optional(),});export const StartTranscriptionOutputSchema = z.object({diff --git a/src/shared/types/ipc.types.ts b/src/shared/types/ipc.types.tsindex 3df54cf..ae1ff8e 100644--- a/src/shared/types/ipc.types.ts+++ b/src/shared/types/ipc.types.ts@@ -11,6 +11,7 @@ export interface StartRecordingParams {accessToken: string;apiUrl?: string;enableTranscription?: boolean;+ enableVisualIndex?: boolean;}export interface RecorderEvent {@@ -19,6 +20,7 @@ export interface RecorderEvent {| 'recording:stopped'| 'recording:error'| 'transcript'+ | 'visual_index'| 'upload:progress'| 'upload:complete'| 'error';@@ -33,6 +35,14 @@ export interface TranscriptEvent {end: number; // epoch seconds from WebSocket}+export interface VisualIndexEvent {+ text: string;+ start: number; // epoch ms from WebSocket+ end: number; // epoch ms from WebSocket+ rtstreamId?: string;+ rtstreamName?: string;+}+export interface UploadProgressEvent {progress: number;total: number;@@ -51,6 +61,8 @@ export interface StartRecordingResult {// WebSocket connection IDs for real-time transcription (like Python meeting-copilot)micWsConnectionId?: string;sysAudioWsConnectionId?: string;+ // WebSocket connection ID for visual indexing (screen)+ screenWsConnectionId?: string;}export interface StopRecordingResult {diff --git a/src/types/videodb.d.ts b/src/types/videodb.d.tsindex fa7b6b3..cc7dc86 100644--- a/src/types/videodb.d.ts+++ b/src/types/videodb.d.ts@@ -73,6 +73,32 @@ declare module 'videodb' {| 'system_audio'| 'cameras';+ export interface IndexVisualsConfig {+ batchConfig?: {+ type: 'time';+ value: number;+ frameCount?: number;+ };+ prompt?: string;+ modelName?: string;+ modelConfig?: Record<string, unknown>;+ name?: string;+ socketId?: string;+ }++ export class RTStreamSceneIndex {+ rtstreamIndexId: string;+ rtstreamId: string;+ extractionType?: string;+ extractionConfig?: Record<string, unknown>;+ prompt?: string;+ name?: string;+ status?: string;+ start(): Promise<void>;+ stop(): Promise<void>;+ getScenes(start?: number, end?: number, page?: number, pageSize?: number): Promise<{ scenes: unknown[]; nextPage: boolean } | null>;+ }+export class RTStream {id: string;name?: string;@@ -89,6 +115,8 @@ declare module 'videodb' {since?: number;engine?: string;}): Promise<Record<string, unknown>>;+ indexVisuals(config?: Partial<IndexVisualsConfig>): Promise<RTStreamSceneIndex | null>;+ listSceneIndexes(): Promise<RTStreamSceneIndex[]>;}export class CaptureSessionFull {