Turn meetings into live agent loops. Record, transcribe, and analyze meetings with real-time AI intelligence — before, during, and after calls.
feat: new startup and recording history flow
Om Gatee4e77c94cfa6
diff --git a/src/main/db/index.ts b/src/main/db/index.tsindex d0d1d7e..43625d9 100644--- a/src/main/db/index.ts+++ b/src/main/db/index.ts@@ -50,7 +50,8 @@ export function initDatabase(): ReturnType<typeof drizzle<typeof schema>> {status TEXT NOT NULL DEFAULT 'recording' CHECK(status IN ('recording', 'processing', 'available', 'failed')),insights TEXT,insights_status TEXT NOT NULL DEFAULT 'pending' CHECK(insights_status IN ('pending', 'processing', 'ready', 'failed')),- call_summary TEXT,+ short_overview TEXT,+ key_points TEXT,playbook_snapshot TEXT,metrics_snapshot TEXT);@@ -241,9 +242,15 @@ function ensureRecordingColumns(): void {}};- addColumnIfMissing('call_summary', "ALTER TABLE recordings ADD COLUMN call_summary TEXT");+ addColumnIfMissing('short_overview', "ALTER TABLE recordings ADD COLUMN short_overview TEXT");+ addColumnIfMissing('key_points', "ALTER TABLE recordings ADD COLUMN key_points TEXT");addColumnIfMissing('playbook_snapshot', "ALTER TABLE recordings ADD COLUMN playbook_snapshot TEXT");addColumnIfMissing('metrics_snapshot', "ALTER TABLE recordings ADD COLUMN metrics_snapshot TEXT");+ addColumnIfMissing('meeting_name', "ALTER TABLE recordings ADD COLUMN meeting_name TEXT");+ addColumnIfMissing('meeting_description', "ALTER TABLE recordings ADD COLUMN meeting_description TEXT");+ addColumnIfMissing('probing_questions', "ALTER TABLE recordings ADD COLUMN probing_questions TEXT");+ addColumnIfMissing('meeting_checklist', "ALTER TABLE recordings ADD COLUMN meeting_checklist TEXT");+ addColumnIfMissing('collection_id', "ALTER TABLE recordings ADD COLUMN collection_id TEXT");}function ensureNudgesHistorySchema(): void {diff --git a/src/main/db/schema.ts b/src/main/db/schema.tsindex 5b3d9d0..757012e 100644--- a/src/main/db/schema.ts+++ b/src/main/db/schema.ts@@ -13,6 +13,7 @@ export const users = sqliteTable('users', {export const recordings = sqliteTable('recordings', {id: integer('id').primaryKey({ autoIncrement: true }),videoId: text('video_id'),+ collectionId: text('collection_id'),streamUrl: text('stream_url'),playerUrl: text('player_url'),sessionId: text('session_id').notNull(),@@ -26,9 +27,15 @@ export const recordings = sqliteTable('recordings', {.notNull().default('pending'),// Enhanced fields for Meeting Co-Pilot- callSummary: text('call_summary'), // JSON: CallSummary object+ shortOverview: text('short_overview'), // Narrative paragraph summary+ keyPoints: text('key_points'), // JSON: KeyPoint[] arrayplaybookSnapshot: text('playbook_snapshot'), // JSON: final playbook coveragemetricsSnapshot: text('metrics_snapshot'), // JSON: final conversation metrics+ // Meeting Setup fields+ meetingName: text('meeting_name'),+ meetingDescription: text('meeting_description'),+ probingQuestions: text('probing_questions'), // JSON: ProbingQuestion[]+ meetingChecklist: text('meeting_checklist'), // JSON: string[]});// Meeting Co-Pilot Tablesdiff --git a/src/main/ipc/copilot.ts b/src/main/ipc/copilot.tsindex 7ef0d97..8e6dde4 100644--- a/src/main/ipc/copilot.ts+++ b/src/main/ipc/copilot.ts@@ -12,7 +12,7 @@ import {type CopilotConfig,type ConversationMetrics,type Nudge,- type CallSummary,+ type PostMeetingSummary,} from '../services/copilot';const logger = createChildLogger('copilot-ipc');@@ -57,7 +57,7 @@ export function setupCopilotHandlers(): void {});copilot.on('call-ended', (data: {- summary: CallSummary;+ summary: PostMeetingSummary;metrics: ConversationMetrics;duration: number;}) => {diff --git a/src/main/server/trpc/procedures/meeting-setup.ts b/src/main/server/trpc/procedures/meeting-setup.tsnew file mode 100644index 0000000..5f28170--- /dev/null+++ b/src/main/server/trpc/procedures/meeting-setup.ts@@ -0,0 +1,43 @@+/**+ * Meeting Setup tRPC Procedures+ * Endpoints for generating probing questions and meeting checklist+ */++import { z } from 'zod';+import { router, protectedProcedure } from '../trpc';+import { getMeetingSetupService } from '../../../services/meeting-setup.service';++const probingQuestionSchema = z.object({+ question: z.string(),+ type: z.enum(['single-choice', 'multi-choice']),+ options: z.array(z.string()),+ answer: z.string(),+ customAnswer: z.string().optional(),+});++export const meetingSetupRouter = router({+ generateProbingQuestions: protectedProcedure+ .input(+ z.object({+ name: z.string().min(1, 'Meeting name is required'),+ description: z.string().min(1, 'Meeting description is required'),+ })+ )+ .mutation(async ({ input }) => {+ const service = getMeetingSetupService();+ return service.generateProbingQuestions(input.name, input.description);+ }),++ generateChecklist: protectedProcedure+ .input(+ z.object({+ name: z.string().min(1),+ description: z.string().min(1),+ questions: z.array(probingQuestionSchema),+ })+ )+ .mutation(async ({ input }) => {+ const service = getMeetingSetupService();+ return service.generateChecklist(input.name, input.description, input.questions);+ }),+});diff --git a/src/main/server/trpc/procedures/recordings.ts b/src/main/server/trpc/procedures/recordings.tsindex afd65a2..cb33c09 100644--- a/src/main/server/trpc/procedures/recordings.ts+++ b/src/main/server/trpc/procedures/recordings.ts@@ -5,10 +5,11 @@ import {CreateRecordingInputSchema,StopRecordingInputSchema,GetRecordingInputSchema,- CallSummarySchema,+ KeyPointsSchema,PlaybookSnapshotSchema,MetricsSnapshotSchema,- type CallSummary,+ ProbingQuestionSchema,+ type KeyPoints,type PlaybookSnapshot,type MetricsSnapshot,} from '../../../../shared/schemas/recording.schema';@@ -17,10 +18,12 @@ import {createRecording,updateRecordingBySessionId,getRecordingById,+ getTranscriptSegmentsByRecording,} from '../../../db';import { createChildLogger } from '../../../lib/logger';import { loadRuntimeConfig } from '../../../lib/config';import { checkAndRecoverSession } from '../../../services/recording-export.service';+import { createVideoDBService } from '../../../services/videodb.service';const logger = createChildLogger('recordings-procedure');@@ -43,9 +46,20 @@ function safeJsonParse<T>(function toApiRecording(dbRecording: ReturnType<typeof getRecordingById>) {if (!dbRecording) return null;+ // Parse meeting setup data+ const probingQuestions = safeJsonParse(+ (dbRecording as any).probingQuestions,+ z.array(ProbingQuestionSchema)+ );+ const meetingChecklist = safeJsonParse(+ (dbRecording as any).meetingChecklist,+ z.array(z.string())+ );+return {id: dbRecording.id,videoId: dbRecording.videoId,+ collectionId: (dbRecording as any).collectionId || null,streamUrl: dbRecording.streamUrl,playerUrl: dbRecording.playerUrl,sessionId: dbRecording.sessionId,@@ -54,10 +68,16 @@ function toApiRecording(dbRecording: ReturnType<typeof getRecordingById>) {status: dbRecording.status as 'recording' | 'processing' | 'available' | 'failed',insights: dbRecording.insights,insightsStatus: dbRecording.insightsStatus as 'pending' | 'processing' | 'ready' | 'failed',- // Parse and validate copilot data from JSON strings- callSummary: safeJsonParse<CallSummary>(dbRecording.callSummary, CallSummarySchema),+ // Parse and validate copilot data+ shortOverview: (dbRecording as any).shortOverview || null,+ keyPoints: safeJsonParse<KeyPoints>((dbRecording as any).keyPoints, KeyPointsSchema),playbookSnapshot: safeJsonParse<PlaybookSnapshot>(dbRecording.playbookSnapshot, PlaybookSnapshotSchema),metricsSnapshot: safeJsonParse<MetricsSnapshot>(dbRecording.metricsSnapshot, MetricsSnapshotSchema),+ // Meeting Setup data+ meetingName: (dbRecording as any).meetingName || null,+ meetingDescription: (dbRecording as any).meetingDescription || null,+ probingQuestions: probingQuestions || null,+ meetingChecklist: meetingChecklist || null,};}@@ -89,16 +109,53 @@ export const recordingsRouter = router({return toApiRecording(recording);}),+ getTranscript: protectedProcedure+ .input(z.object({ recordingId: z.number() }))+ .output(z.array(z.object({+ id: z.string(),+ channel: z.enum(['me', 'them']),+ text: z.string(),+ startTime: z.number(),+ endTime: z.number(),+ })))+ .query(async ({ input }) => {+ logger.debug({ recordingId: input.recordingId }, 'Fetching transcript');+ const segments = getTranscriptSegmentsByRecording(input.recordingId);+ return segments.map(s => ({+ id: s.id,+ channel: s.channel as 'me' | 'them',+ text: s.text,+ startTime: s.startTime,+ endTime: s.endTime,+ }));+ }),+start: protectedProcedure.input(CreateRecordingInputSchema).output(RecordingSchema).mutation(async ({ input }) => {- logger.info({ sessionId: input.sessionId }, 'Starting recording');+ logger.info({ sessionId: input.sessionId, hasMeetingSetup: !!input.meetingName }, 'Starting recording');- const recording = createRecording({+ const recordingData: any = {sessionId: input.sessionId,status: 'recording',- });+ };++ // Add meeting setup data if provided+ if (input.meetingName) {+ recordingData.meetingName = input.meetingName;+ }+ if (input.meetingDescription) {+ recordingData.meetingDescription = input.meetingDescription;+ }+ if (input.probingQuestions) {+ recordingData.probingQuestions = JSON.stringify(input.probingQuestions);+ }+ if (input.meetingChecklist) {+ recordingData.meetingChecklist = JSON.stringify(input.meetingChecklist);+ }++ const recording = createRecording(recordingData);logger.info({ recordingId: recording.id, sessionId: input.sessionId },@@ -197,7 +254,7 @@ export const recordingsRouter = router({// Mark truly stale recordings as failedconst updatedRecordings = getAllRecordings();for (const recording of updatedRecordings) {- if ((recording.status === 'processing' || recording.status === 'recording') && !recording.callSummary) {+ if ((recording.status === 'processing' || recording.status === 'recording') && !(recording as any).shortOverview) {const createdAt = new Date(recording.createdAt).getTime();const age = now - createdAt;@@ -215,4 +272,70 @@ export const recordingsRouter = router({logger.info({ cleaned, recovered }, 'Stale recordings cleanup complete');return { cleaned, recovered };}),++ downloadVideo: protectedProcedure+ .input(z.object({ recordingId: z.number() }))+ .output(z.object({ downloadUrl: z.string(), name: z.string() }))+ .mutation(async ({ input, ctx }) => {+ logger.debug({ recordingId: input.recordingId }, 'Getting video download URL');++ const recording = getRecordingById(input.recordingId);+ if (!recording || !recording.videoId) {+ throw new Error('Recording or video not found');+ }++ const apiKey = ctx.user?.apiKey;+ if (!apiKey) {+ throw new Error('API key not found');+ }++ try {+ const runtimeConfig = loadRuntimeConfig();+ const service = createVideoDBService(apiKey, runtimeConfig.apiUrl);+ const result = await service.downloadVideo(recording.videoId, recording.meetingName || undefined);+ logger.info({ recordingId: input.recordingId, result }, 'Video download URL obtained');+ return result;+ } catch (error) {+ logger.error({ recordingId: input.recordingId, error }, 'Failed to get video download URL');+ throw error;+ }+ }),++ // Populate collectionId for recordings that don't have it+ populateCollectionId: protectedProcedure+ .input(z.object({ recordingId: z.number() }))+ .output(z.object({ collectionId: z.string().nullable() }))+ .mutation(async ({ input, ctx }) => {+ const recording = getRecordingById(input.recordingId);+ if (!recording || !recording.videoId) {+ return { collectionId: null };+ }++ // Already has collectionId+ if ((recording as any).collectionId) {+ return { collectionId: (recording as any).collectionId };+ }++ const apiKey = ctx.user?.apiKey;+ if (!apiKey) {+ return { collectionId: null };+ }++ try {+ const runtimeConfig = loadRuntimeConfig();+ const service = createVideoDBService(apiKey, runtimeConfig.apiUrl);+ const video = await service.getVideo(recording.videoId);+ const collectionId = video.collectionId || null;++ if (collectionId) {+ updateRecordingBySessionId(recording.sessionId, { collectionId });+ logger.info({ recordingId: input.recordingId, collectionId }, 'Populated collectionId for recording');+ }++ return { collectionId };+ } catch (error) {+ logger.error({ error, recordingId: input.recordingId }, 'Failed to fetch collectionId');+ return { collectionId: null };+ }+ }),});diff --git a/src/main/server/trpc/router.ts b/src/main/server/trpc/router.tsindex c7523fb..8d51679 100644--- a/src/main/server/trpc/router.ts+++ b/src/main/server/trpc/router.ts@@ -6,6 +6,7 @@ import { captureRouter } from './procedures/capture';import { recordingsRouter } from './procedures/recordings';import { transcriptionRouter } from './procedures/transcription';import { settingsRouter } from './procedures/settings';+import { meetingSetupRouter } from './procedures/meeting-setup';export const appRouter = router({auth: authRouter,@@ -15,6 +16,7 @@ export const appRouter = router({recordings: recordingsRouter,transcription: transcriptionRouter,settings: settingsRouter,+ meetingSetup: meetingSetupRouter,});export type AppRouter = typeof appRouter;diff --git a/src/main/services/copilot/index.ts b/src/main/services/copilot/index.tsindex d07fc06..9064f92 100644--- a/src/main/services/copilot/index.ts+++ b/src/main/services/copilot/index.ts@@ -59,6 +59,8 @@ export {SummaryGeneratorService,getSummaryGenerator,resetSummaryGenerator,- type CallSummary,- type FullCallReport,+ type PostMeetingSummary,+ type KeyPoint,+ type MeetingContext,+ type ProbingQA,} from './summary-generator.service';diff --git a/src/main/services/copilot/sales-copilot.service.ts b/src/main/services/copilot/sales-copilot.service.tsindex 7847f3a..7afde6a 100644--- a/src/main/services/copilot/sales-copilot.service.ts+++ b/src/main/services/copilot/sales-copilot.service.ts@@ -11,6 +11,7 @@ import { logger } from '../../lib/logger';import { initLLMService } from '../llm.service';import {updateRecording,+ getRecordingById,createCallMetricsSnapshot,createNudge,} from '../../db';@@ -42,7 +43,7 @@ import {import {SummaryGeneratorService,getSummaryGenerator,- type CallSummary,+ type PostMeetingSummary,} from './summary-generator.service';// MCP Services@@ -78,7 +79,7 @@ export interface CopilotEvents {'metrics-update': { metrics: ConversationMetrics; health: number };'nudge': { nudge: Nudge };'call-ended': {- summary: CallSummary;+ summary: PostMeetingSummary;metrics: ConversationMetrics;duration: number;};@@ -507,7 +508,7 @@ export class MeetingCopilotService extends EventEmitter {/*** End call and generate summary*/- async endCall(): Promise<CallSummary | null> {+ async endCall(): Promise<PostMeetingSummary | null> {if (!this.callState) {log.warn('No active call to end');return null;@@ -531,38 +532,54 @@ export class MeetingCopilotService extends EventEmitter {// Mark call as inactivethis.callState.isActive = false;- // Get final segments+ // Get final segments for metrics calculationconst segments = this.transcriptBuffer.getFinalSegments(sessionId);// Calculate final metricsconst metrics = this.metricsService.calculate(segments, duration);- // Generate summary- let summary: CallSummary;+ // Fetch meeting context from recording+ const recording = getRecordingById(recordingId);+ const meetingContext = {+ meetingName: (recording as any)?.meetingName || undefined,+ meetingDescription: (recording as any)?.meetingDescription || undefined,+ probingQuestions: (recording as any)?.probingQuestions+ ? JSON.parse((recording as any).probingQuestions)+ : undefined,+ checklist: (recording as any)?.meetingChecklist+ ? JSON.parse((recording as any).meetingChecklist)+ : undefined,+ };++ // Generate summaries (fetches full transcript from DB)+ let summary: PostMeetingSummary;try {log.info({ recordingId, segmentCount: segments.length }, 'Starting summary generation');const summaryStartTime = Date.now();- summary = await this.summaryGenerator.generate(segments);+ summary = await this.summaryGenerator.generate(recordingId, meetingContext);const summaryElapsed = Date.now() - summaryStartTime;log.info({recordingId,elapsedMs: summaryElapsed,- summaryLength: summary.summary.length,+ overviewLength: summary.shortOverview.length,+ keyPointsCount: summary.keyPoints.length,}, 'Summary generation completed');} catch (error) {const errMsg = error instanceof Error ? error.message : 'Unknown error';log.error({ err: error, errorMessage: errMsg, recordingId }, 'Failed to generate summary');summary = {- summary: `## Meeting Summary\n\nSummary generation failed: ${errMsg}`,+ shortOverview: `Summary generation failed: ${errMsg}`,+ keyPoints: [],generatedAt: Date.now(),};}// Save to databasetry {- log.info({ recordingId, hasSummary: summary.summary.length > 0 }, 'Saving call data to database');+ log.info({ recordingId, hasOverview: summary.shortOverview.length > 0 }, 'Saving call data to database');updateRecording(recordingId, {- callSummary: JSON.stringify(summary),+ shortOverview: summary.shortOverview,+ keyPoints: JSON.stringify(summary.keyPoints),metricsSnapshot: JSON.stringify(metrics),duration: Math.round(duration),});@@ -573,7 +590,7 @@ export class MeetingCopilotService extends EventEmitter {}// Emit end event- log.info({ recordingId, hasSummary: summary.summary.length > 0 }, 'Emitting call-ended event');+ log.info({ recordingId, hasOverview: summary.shortOverview.length > 0 }, 'Emitting call-ended event');this.emit('call-ended', {summary,metrics,diff --git a/src/main/services/copilot/summary-generator.service.ts b/src/main/services/copilot/summary-generator.service.tsindex 22598c6..5fbac71 100644--- a/src/main/services/copilot/summary-generator.service.ts+++ b/src/main/services/copilot/summary-generator.service.ts@@ -1,176 +1,249 @@/*** Summary Generator Service*- * Generates a clean, high-quality meeting summary using a single LLM call.- * Outputs a well-formatted markdown summary with action items.+ * Generates post-meeting summaries using two specialized prompts:+ * 1. Short Overview - A narrative paragraph summary (3-5 sentences)+ * 2. Key Points - Structured JSON with topics and attributed points*/import { logger } from '../../lib/logger';import { getLLMService } from '../llm.service';+import { getTranscriptSegmentsByRecording } from '../../db';import type { TranscriptSegmentData } from './transcript-buffer.service';-import type { ConversationMetrics } from './conversation-metrics.service';const log = logger.child({ module: 'summary-generator' });// Types-export interface CallSummary {- /** The complete meeting summary as markdown text */- summary: string;- /** When the summary was generated */+export interface KeyPoint {+ topic: string;+ points: string[];+}++export interface PostMeetingSummary {+ shortOverview: string;+ keyPoints: KeyPoint[];generatedAt: number;}-export interface FullCallReport {- summary: CallSummary;- metrics?: ConversationMetrics;- callDuration: number;- segmentCount: number;+export interface ProbingQA {+ question: string;+ answer: string;+ customAnswer?: string;}+export interface MeetingContext {+ meetingName?: string;+ meetingDescription?: string;+ probingQuestions?: ProbingQA[];+ checklist?: string[];+}++// System Prompts++const SHORT_OVERVIEW_SYSTEM_PROMPT = `You are an expert meeting summarizer. Given a meeting transcript along+with its name, description, and checklist, produce a short narrative+summary of what happened in the meeting.++Rules:+- Write a single flowing paragraph. No bullet points, no headers,+ no numbered lists.+- The summary should read like a brief written by a sharp colleague+ who sat in on the meeting - it tells you who was there, what the+ meeting was about, and what the main threads of discussion were.+- Mention participants by name and what they contributed, but keep it+ high-level. Do not quote anyone verbatim.+- Do not editorialize or add opinions. Stick to what actually happened.+- Aim for 3-5 sentences. Never exceed 120 words.+- Write in past tense, third person.++Respond ONLY with the summary paragraph - no explanation, no headers,+no preamble.`;++const KEY_POINTS_SYSTEM_PROMPT = `You are an expert meeting summarizer. Given a meeting transcript along+with its name, description, and checklist, produce a detailed breakdown+of the key discussion points from the meeting.++Rules:+- Identify the major topics or themes that were discussed. Group related+ points under a clear, short topic heading.+- Under each topic, write individual points attributed to the person+ who raised them. Use the format: "Name did/said/raised/confirmed..."+- Each point should be one concrete sentence capturing what was said,+ decided, or proposed. No filler, no fluff.+- Stay factual - report what happened, do not add interpretation or+ recommendations.+- Write in past tense, third person.+- Aim for 2-5 topics, with 2-5 points each. Let the actual content of+ the meeting dictate the count - do not pad or compress artificially.+- If the checklist items were addressed in the meeting, naturally weave+ that into the relevant topic. Do not create a separate "checklist+ review" section.++Respond ONLY with the JSON object below - no explanation, no markdown+fences, no preamble.++Output format:+{+ "key_points": [+ {+ "topic": "Topic Name",+ "points": [+ "Person did/said something specific.",+ "Another person confirmed/raised another point."+ ]+ }+ ]+}`;+// Summary Generator Serviceexport class SummaryGeneratorService {constructor() {}/**- * Generate a comprehensive meeting summary+ * Generate both short overview and key points from full transcript*/- async generate(segments: TranscriptSegmentData[]): Promise<CallSummary> {- const finalSegments = segments.filter(s => s.isFinal);-- if (finalSegments.length === 0) {+ async generate(+ recordingId: number,+ context: MeetingContext+ ): Promise<PostMeetingSummary> {+ // Fetch full transcript from database+ const dbSegments = getTranscriptSegmentsByRecording(recordingId);++ if (!dbSegments || dbSegments.length === 0) {+ log.warn({ recordingId }, 'No transcript segments found for recording');return this.emptyResults();}- log.info({ segmentCount: finalSegments.length }, 'Generating meeting summary');-- const transcript = this.formatTranscript(finalSegments);- const duration = this.calculateDuration(finalSegments);- const llm = getLLMService();-- const prompt = `You are an expert meeting note-taker. Generate a comprehensive, well-organized meeting summary from the following transcript.--MEETING DURATION: ${this.formatDuration(duration)}--TRANSCRIPT:-${transcript}-------Generate a professional meeting summary in markdown format. The summary should be:-- Clear and concise-- Well-organized with proper headings-- Actionable with specific to-dos--Use this structure:--## Meeting Summary--A 2-3 sentence overview of what this meeting was about and the main outcome.--## Key Discussion Points--- Bullet points of the main topics discussed-- Include important details and context-- Note any significant points raised by participants+ log.info({ recordingId, segmentCount: dbSegments.length }, 'Generating post-meeting summaries');-## Decisions Made+ const transcript = this.formatTranscript(dbSegments);+ const userPrompt = this.buildUserPrompt(transcript, context);-- List any decisions that were reached-- Include the reasoning if discussed-- Skip this section if no clear decisions were made+ // Generate both summaries in parallel+ const [shortOverview, keyPoints] = await Promise.all([+ this.generateShortOverview(userPrompt),+ this.generateKeyPoints(userPrompt),+ ]);-## Action Items--- [ ] Specific task - Owner (if mentioned)-- [ ] Another task - Owner-- List all commitments and follow-ups mentioned-- Include deadlines if specified--## Notes--- Any other important information-- Open questions or items needing follow-up-- Skip this section if nothing additional to note-----+ return {+ shortOverview,+ keyPoints,+ generatedAt: Date.now(),+ };+ }-Important:-- Write in a professional but conversational tone-- Be specific - use names, dates, and details from the transcript-- Focus on what's actionable and important-- Don't include filler or obvious statements-- If something wasn't discussed, don't make it up`;+ /**+ * Generate short overview (narrative paragraph)+ */+ private async generateShortOverview(userPrompt: string): Promise<string> {+ const llm = getLLMService();try {- const response = await llm.complete(- prompt,- 'You are a professional meeting summarizer. Generate clear, actionable meeting notes.'- );+ const response = await llm.complete(userPrompt, SHORT_OVERVIEW_SYSTEM_PROMPT);if (response.success && response.content) {- log.info('Meeting summary generated successfully');- return {- summary: response.content.trim(),- generatedAt: Date.now(),- };+ log.info('Short overview generated successfully');+ return response.content.trim();}} catch (error) {- log.error({ error }, 'Summary generation failed');+ log.error({ error }, 'Short overview generation failed');}- // Fallback: generate a basic summary- return this.generateFallbackSummary(finalSegments);+ return 'Unable to generate meeting summary.';}/**- * Generate a quick summary (for shorter meetings or quick review)+ * Generate key points (structured JSON)*/- async generateQuick(segments: TranscriptSegmentData[]): Promise<CallSummary> {- const finalSegments = segments.filter(s => s.isFinal);-- if (finalSegments.length === 0) {- return this.emptyResults();- }-- const transcript = this.formatTranscript(finalSegments);+ private async generateKeyPoints(userPrompt: string): Promise<KeyPoint[]> {const llm = getLLMService();- const prompt = `Summarize this meeting in a brief format:--${transcript}+ try {+ const response = await llm.complete(userPrompt, KEY_POINTS_SYSTEM_PROMPT);-Generate a quick summary with:-1. One sentence overview-2. 3-5 key points as bullets-3. Action items as a checklist+ if (response.success && response.content) {+ // Parse the JSON response+ const parsed = this.parseKeyPointsResponse(response.content);+ if (parsed) {+ log.info({ topicCount: parsed.length }, 'Key points generated successfully');+ return parsed;+ }+ }+ } catch (error) {+ log.error({ error }, 'Key points generation failed');+ }-Keep it concise and actionable.`;+ return [];+ }+ /**+ * Parse key points JSON response+ */+ private parseKeyPointsResponse(content: string): KeyPoint[] | null {try {- const response = await llm.complete(- prompt,- 'You are a meeting summarizer. Be brief and actionable.'- );+ // Remove markdown fences if present+ let cleaned = content.trim();+ if (cleaned.startsWith('```')) {+ cleaned = cleaned.replace(/^```(?:json)?\s*\n?/, '').replace(/\n?```\s*$/, '');+ }- if (response.success && response.content) {- return {- summary: response.content.trim(),- generatedAt: Date.now(),- };+ const parsed = JSON.parse(cleaned);++ // Handle both { key_points: [...] } and direct array+ const keyPoints = parsed.key_points || parsed;++ if (Array.isArray(keyPoints)) {+ return keyPoints.map((kp: { topic: string; points: string[] }) => ({+ topic: kp.topic || 'Discussion',+ points: Array.isArray(kp.points) ? kp.points : [],+ }));}} catch (error) {- log.warn({ error }, 'Quick summary generation failed');+ log.warn({ error, content: content.slice(0, 200) }, 'Failed to parse key points JSON');}+ return null;+ }- return this.emptyResults();+ /**+ * Build the user prompt with meeting context+ */+ private buildUserPrompt(transcript: string, context: MeetingContext): string {+ const meetingName = context.meetingName || 'Untitled Meeting';+ const meetingDescription = context.meetingDescription || 'No description provided';++ // Format probing questions and answers+ const probingQA = context.probingQuestions?.length+ ? context.probingQuestions.map((q, i) => {+ const answer = q.customAnswer+ ? `${q.answer} (${q.customAnswer})`+ : q.answer;+ return `Q${i + 1}: ${q.question}\nA${i + 1}: ${answer}`;+ }).join('\n\n')+ : 'No pre-meeting context provided';++ const checklist = context.checklist?.length+ ? context.checklist.map((item, i) => `${i + 1}. ${item}`).join('\n')+ : 'No checklist';++ return `Meeting Name: ${meetingName}+Meeting Description: ${meetingDescription}++Pre-Meeting Context (Q&A):+${probingQA}++Checklist:+${checklist}++Transcript:+${transcript}`;}/**- * Format transcript for the LLM+ * Format transcript segments for the LLM*/- private formatTranscript(segments: TranscriptSegmentData[]): string {+ private formatTranscript(segments: { channel: string; text: string; startTime: number }[]): string {return segments.map(s => {const speaker = s.channel === 'me' ? 'You' : 'Them';@@ -180,27 +253,6 @@ Keep it concise and actionable.`;.join('\n');}- /**- * Calculate meeting duration from segments- */- private calculateDuration(segments: TranscriptSegmentData[]): number {- if (segments.length === 0) return 0;- const firstTime = segments[0].startTime;- const lastTime = segments[segments.length - 1].endTime;- return lastTime - firstTime;- }-- /**- * Format duration as human readable- */- private formatDuration(seconds: number): string {- const mins = Math.floor(seconds / 60);- const secs = Math.floor(seconds % 60);- if (mins === 0) return `${secs} seconds`;- if (secs === 0) return `${mins} minute${mins > 1 ? 's' : ''}`;- return `${mins} minute${mins > 1 ? 's' : ''} ${secs} second${secs > 1 ? 's' : ''}`;- }-/*** Format time as MM:SS*/@@ -210,39 +262,13 @@ Keep it concise and actionable.`;return `${mins}:${secs.toString().padStart(2, '0')}`;}- /**- * Generate fallback summary if LLM fails- */- private generateFallbackSummary(segments: TranscriptSegmentData[]): CallSummary {- const duration = this.calculateDuration(segments);- const mySegments = segments.filter(s => s.channel === 'me');- const theirSegments = segments.filter(s => s.channel === 'them');-- const summary = `## Meeting Summary--This meeting lasted ${this.formatDuration(duration)} with ${segments.length} exchanges.--## Transcript Overview--- You spoke ${mySegments.length} times-- They spoke ${theirSegments.length} times--## Notes--The full summary could not be generated. Please review the transcript directly.`;-- return {- summary,- generatedAt: Date.now(),- };- }-/*** Return empty results*/- private emptyResults(): CallSummary {+ private emptyResults(): PostMeetingSummary {return {- summary: '## Meeting Summary\n\nNo transcript available to summarize.',+ shortOverview: 'No transcript available to summarize.',+ keyPoints: [],generatedAt: Date.now(),};}diff --git a/src/main/services/meeting-setup.prompts.ts b/src/main/services/meeting-setup.prompts.tsnew file mode 100644index 0000000..824be43--- /dev/null+++ b/src/main/services/meeting-setup.prompts.ts@@ -0,0 +1,77 @@+/**+ * Meeting Setup Prompts+ * System and user prompts for generating probing questions and meeting checklist+ */++export const PROBING_QUESTIONS_SYSTEM_PROMPT = `You are an expert meeting preparation assistant. Your job is to generate+sharp, probing multiple-choice questions that uncover the user's real+goals, concerns, and success criteria for an upcoming meeting.++Rules:+- Generate exactly 3 questions. No more, no less.+- Each question must have exactly 4 options.+- Each question must have exactly 4 options as plain strings.+- Each question must specify a "type": either "multi-choice" (user picks+ one or more) or "single-choice" (user picks exactly one). Use your+ judgment - if only one answer makes sense, use single-choice.+- Include an empty "answer" field in every question (the app fills it in+ later - for multi-choice, answers will be comma-separated).+- Questions should dig into: (a) what a successful outcome looks like,+ (b) what risks or blockers exist, and (c) what specific deliverables+ or decisions are expected.+- Do NOT ask generic questions like "What is the purpose of this meeting?"+ The name and description already tell you that. Go deeper.+- Options should be concrete and specific to THIS meeting, not vague+ platitudes. Derive them from the name and description provided.+- Keep question text under 15 words. Keep each option under 12 words.++You will receive the meeting name and description. Respond ONLY with the+JSON object below - no explanation, no markdown fences, no preamble.`;++export function buildProbingQuestionsUserPrompt(name: string, description: string): string {+ return `Meeting Name: ${name}+Meeting Description: ${description}`;+}++export const CHECKLIST_SYSTEM_PROMPT = `You are an expert meeting strategist. Given everything you know about an+upcoming meeting - its name, description, and the user's own answers to+probing questions - generate a focused, genuinely useful meeting checklist.++Rules:+- The checklist is a flat list of actionable items to track during the+ meeting in real-time. These are things to watch for, bring up, or+ capture WHILE the meeting is happening. They act as a live scorecard+ - did we actually cover this?+- Generate between 5 and 10 items. Do not pad. Every item must be+ directly tied to something the user told you they care about. If you+ cannot justify an item from the inputs, do not include it.+- Each item must be a concrete, actionable statement - not a vague+ reminder. Bad: "Discuss design." Good: "Get explicit sign-off on+ button placement from all attendees."+- Keep each item under 25 words.+- Order items by priority (most critical first).++You will receive the meeting name, description, probing questions, and+the user's selected answers. Respond ONLY with the JSON object below -+no explanation, no markdown fences, no preamble.`;++export function buildChecklistUserPrompt(+ name: string,+ description: string,+ questions: Array<{ question: string; type: string; answer: string; customAnswer?: string }>+): string {+ const questionsText = questions+ .map((q) => {+ const answerPart = q.customAnswer+ ? `${q.answer}${q.answer ? ', ' : ''}Other: ${q.customAnswer}`+ : q.answer;+ return `Q: ${q.question} (${q.type})\nAnswer: ${answerPart}`;+ })+ .join('\n\n');++ return `Meeting Name: ${name}+Meeting Description: ${description}++Probing Questions & User's Answers:+${questionsText}`;+}diff --git a/src/main/services/meeting-setup.service.ts b/src/main/services/meeting-setup.service.tsnew file mode 100644index 0000000..4dcfe50--- /dev/null+++ b/src/main/services/meeting-setup.service.ts@@ -0,0 +1,108 @@+/**+ * Meeting Setup Service+ * Handles LLM calls for generating probing questions and meeting checklist+ */++import { logger } from '../lib/logger';+import { getLLMService } from './llm.service';+import {+ PROBING_QUESTIONS_SYSTEM_PROMPT,+ buildProbingQuestionsUserPrompt,+ CHECKLIST_SYSTEM_PROMPT,+ buildChecklistUserPrompt,+} from './meeting-setup.prompts';+import type {+ ProbingQuestion,+ ProbingQuestionsResponse,+ ChecklistResponse,+} from '../../shared/types/meeting-setup.types';++const log = logger.child({ module: 'meeting-setup-service' });++export class MeetingSetupService {+ /**+ * Generate probing questions based on meeting name and description+ */+ async generateProbingQuestions(+ name: string,+ description: string+ ): Promise<{ success: boolean; questions: ProbingQuestion[]; error?: string }> {+ log.info({ name, description: description.slice(0, 100) }, 'Generating probing questions');++ const llm = getLLMService();+ const userPrompt = buildProbingQuestionsUserPrompt(name, description);++ const response = await llm.chatCompletionJSON<ProbingQuestionsResponse>([+ { role: 'system', content: PROBING_QUESTIONS_SYSTEM_PROMPT },+ { role: 'user', content: userPrompt },+ ]);++ if (!response.success || !response.data) {+ log.error({ error: response.error }, 'Failed to generate probing questions');+ return {+ success: false,+ questions: [],+ error: response.error || 'Failed to generate questions',+ };+ }++ // Ensure questions have the correct structure+ const questions: ProbingQuestion[] = response.data.questions.map((q) => ({+ question: q.question,+ type: q.type,+ options: q.options,+ answer: '',+ customAnswer: undefined,+ }));++ log.info({ questionCount: questions.length }, 'Probing questions generated');+ return { success: true, questions };+ }++ /**+ * Generate meeting checklist based on setup data+ */+ async generateChecklist(+ name: string,+ description: string,+ questions: ProbingQuestion[]+ ): Promise<{ success: boolean; checklist: string[]; error?: string }> {+ log.info({ name, questionCount: questions.length }, 'Generating meeting checklist');++ const llm = getLLMService();+ const userPrompt = buildChecklistUserPrompt(name, description, questions);++ const response = await llm.chatCompletionJSON<ChecklistResponse>([+ { role: 'system', content: CHECKLIST_SYSTEM_PROMPT },+ { role: 'user', content: userPrompt },+ ]);++ if (!response.success || !response.data) {+ log.error({ error: response.error }, 'Failed to generate checklist');+ return {+ success: false,+ checklist: [],+ error: response.error || 'Failed to generate checklist',+ };+ }++ const checklist = response.data.checklist;++ log.info({ checklistCount: checklist.length }, 'Meeting checklist generated');+ return { success: true, checklist };+ }+}++// Singleton instance+let instance: MeetingSetupService | null = null;++export function getMeetingSetupService(): MeetingSetupService {+ if (!instance) {+ instance = new MeetingSetupService();+ }+ return instance;+}++export function resetMeetingSetupService(): void {+ instance = null;+}diff --git a/src/main/services/recording-export.service.ts b/src/main/services/recording-export.service.tsindex 48b12ca..23bbd71 100644--- a/src/main/services/recording-export.service.ts+++ b/src/main/services/recording-export.service.ts@@ -12,7 +12,6 @@ import { connect } from 'videodb';import type { CaptureSessionFull } from 'videodb';import { createChildLogger } from '../lib/logger';import { updateRecordingBySessionId } from '../db';-import { createInsightsService } from './insights.service';const logger = createChildLogger('recording-export');@@ -60,14 +59,15 @@ export async function checkSessionExport(/*** Recover a recording that has exported on VideoDB- * Updates the local database and triggers insights processing+ * Updates the local database with video info+ * Note: triggerInsights param is deprecated - summaries are now generated immediately after call ends*/export async function recoverExportedRecording(sessionId: string,videoId: string,apiKey: string,apiUrl?: string,- triggerInsights: boolean = true+ _triggerInsights: boolean = true // deprecated, kept for API compatibility): Promise<ExportRecoveryResult> {try {const conn = connect(apiUrl ? { apiKey, baseUrl: apiUrl } : { apiKey });@@ -86,6 +86,7 @@ export async function recoverExportedRecording(// Update recording in databaseconst recording = updateRecordingBySessionId(sessionId, {videoId,+ collectionId: video.collectionId || null,streamUrl: video.streamUrl || null,playerUrl: video.playerUrl || null,duration,@@ -112,18 +113,8 @@ export async function recoverExportedRecording('Recording recovered with video info');- // Trigger insights processing (fire and forget)- if (triggerInsights) {- const insightsService = createInsightsService(apiKey, apiUrl);- insightsService- .processRecording(recording.id, videoId)- .then((result) => {- logger.info({ recordingId: recording.id, result }, 'Insights processing completed');- })- .catch((err) => {- logger.error({ error: err, recordingId: recording.id }, 'Insights processing failed');- });- }+ // Note: Insights/summaries are now generated immediately after call ends+ // via the SummaryGeneratorService, so we skip VideoDB insights processingreturn {success: true,diff --git a/src/main/services/videodb.service.ts b/src/main/services/videodb.service.tsindex e500bcd..82fba07 100644--- a/src/main/services/videodb.service.ts+++ b/src/main/services/videodb.service.ts@@ -196,6 +196,20 @@ ${transcriptText}`;return generatedText.trim();}+ async downloadVideo(videoId: string, name?: string): Promise<{ downloadUrl: string; name: string }> {+ logger.info({ videoId, name }, 'Getting video download URL');+ const video = await this.getVideo(videoId);+ logger.info({ videoId, streamUrl: video.streamUrl }, 'Got video object');++ const result = await video.download(name);+ logger.info({ videoId, result }, 'Download API response');++ return {+ downloadUrl: result.downloadUrl as string,+ name: result.name as string,+ };+ }+static clearCache(): void {cachedConnection = null;logger.info('VideoDB connection cache cleared');diff --git a/src/preload/index.ts b/src/preload/index.tsindex eecdcd9..d5d342e 100644--- a/src/preload/index.ts+++ b/src/preload/index.ts@@ -80,8 +80,14 @@ export interface CopilotPlaybookSnapshot {recommendations: string[];}+export interface CopilotKeyPoint {+ topic: string;+ points: string[];+}+export interface CopilotCallSummary {- summary: string;+ shortOverview: string;+ keyPoints: CopilotKeyPoint[];generatedAt: number;}diff --git a/src/renderer/App.tsx b/src/renderer/App.tsxindex b5dfe1a..2e5a8cd 100644--- a/src/renderer/App.tsx+++ b/src/renderer/App.tsx@@ -1,8 +1,6 @@import { useState } from 'react';import { Sidebar } from './components/layout/Sidebar';-import { MainContent } from './components/layout/MainContent';import { AuthView } from './components/auth/AuthView';-import { StreamToggles } from './components/recording/StreamToggles';import { TopStatusBar } from './components/recording/TopStatusBar';import { TranscriptionPanel } from './components/transcription/TranscriptionPanel';import { HistoryView } from './components/history/HistoryView';@@ -14,16 +12,16 @@ import { useGlobalRecorderEvents } from './hooks/useGlobalRecorderEvents';import { useCopilot } from './hooks/useCopilot';import { Card, CardContent, CardHeader, CardTitle, CardDescription } from './components/ui/card';import { Button } from './components/ui/button';-import { Badge } from './components/ui/badge';import { ErrorToast } from './components/ui/error-toast';import { AlertCircle, Shield, Loader2 } from 'lucide-react';import {NudgeToast,CallSummaryView,} from './components/copilot';-import { MCPResultsOverlay } from './components/mcp';import { useCopilotStore } from './stores/copilot.store';+import { useMeetingSetupStore } from './stores/meeting-setup.store';import { MCPServersPanel } from './components/settings/MCPServersPanel';+import { MeetingSetupFlow, MeetingInfoPanel } from './components/meeting-setup';type Tab = 'recording' | 'history' | 'settings';@@ -88,13 +86,21 @@ function PermissionsView() {function RecordingView() {const { isCallActive, callSummary } = useCopilotStore();- const { status, streams, toggleStream, isStarting, isStopping } = useSession();+ const { status } = useSession();+ const meetingSetupStore = useMeetingSetupStore();const isRecording = status === 'recording';const isProcessing = status === 'processing' || status === 'stopping';+ const isIdle = status === 'idle';useCopilot();+ // Reset meeting setup when starting a new call+ const handleStartNewCall = () => {+ useCopilotStore.getState().reset();+ meetingSetupStore.reset();+ };+// Show call summary view if call ended and summary availableif (callSummary && !isCallActive) {return (@@ -104,7 +110,7 @@ function RecordingView() {<div className="max-w-4xl mx-auto h-full flex flex-col"><div className="flex items-center justify-between mb-4 shrink-0"><h2 className="text-lg font-semibold">Call Complete</h2>- <Button variant="outline" size="sm" onClick={() => useCopilotStore.getState().reset()}>+ <Button variant="outline" size="sm" onClick={handleStartNewCall}>Start New Call</Button></div>@@ -139,6 +145,19 @@ function RecordingView() {);}+ // Show meeting setup flow when idle (not recording)+ if (isIdle) {+ return (+ <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">+ <TopStatusBar />+ <div className="flex-1 flex items-center justify-center overflow-auto py-8">+ <MeetingSetupFlow />+ </div>+ </div>+ );+ }++ // Show recording view with transcription and meeting inforeturn (<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 */}@@ -147,38 +166,17 @@ function RecordingView() {{/* Main Content Area */}<div className="flex-1 flex gap-4 p-4 overflow-hidden">{/* Left Column - Transcription */}- <div className="flex-1 flex flex-col gap-4 min-w-0">- {/* Stream Toggles (only show when not recording) */}- {!isRecording && (- <Card className="shrink-0">- <CardHeader className="pb-2">- <CardTitle className="text-sm">Recording Sources</CardTitle>- </CardHeader>- <CardContent>- <StreamToggles- streams={streams}- onToggle={toggleStream}- disabled={isStarting || isStopping}- />- </CardContent>- </Card>- )}-- {/* Transcription Panel */}+ <div className="flex-1 flex flex-col min-w-0"><div className="flex-1 min-h-0"><TranscriptionPanel /></div></div>- {/* Right Column - MCP Results */}- <div className="w-96 flex flex-col gap-4 shrink-0 overflow-hidden">- <div className="flex-1 overflow-y-auto pr-1">- {/* MCP Results Overlay - Shows tool call results */}- <MCPResultsOverlay />- </div>+ {/* Right Column - Meeting Info Panel */}+ <div className="w-80 flex flex-col shrink-0 overflow-hidden">+ <MeetingInfoPanel /></div></div>-</div>);}@@ -272,17 +270,6 @@ export function App() {sessionStore.setError(null);};- const getTitle = () => {- switch (activeTab) {- case 'recording':- return 'Recording';- case 'history':- return 'History';- case 'settings':- return 'Settings';- }- };-const renderContent = () => {if (!isAuthenticated) {return <AuthView />;@@ -310,36 +297,6 @@ export function App() {}};- // Special layout for recording view - no MainContent header- if (isAuthenticated && activeTab === 'recording' && allGranted && !permissionsLoading) {- return (- <div className="flex flex-col h-screen bg-background">- {/* Shared titlebar for macOS traffic lights */}- <div className="h-12 flex items-center justify-center border-b bg-background/80 backdrop-blur-lg shrink-0 drag-region relative">- {/* Space for traffic lights (absolute so title can center) */}- <div className="absolute left-0 w-20 shrink-0" />- <span className="text-sm font-medium text-muted-foreground">Meeting Copilot</span>- </div>-- {/* Main layout below titlebar */}- <div className="flex flex-1 overflow-hidden">- <Sidebar activeTab={activeTab} onTabChange={setActiveTab} />- <div className="flex-1 overflow-hidden">- <RecordingView />- </div>- </div>-- {/* Global Copilot Components */}- <NudgeToast position="bottom" />- <ErrorToast- message={sessionStore.error}- onDismiss={handleDismissError}- position="bottom"- />- </div>- );- }-return (<div className="flex flex-col h-screen bg-background">{/* Shared titlebar for macOS traffic lights */}@@ -352,7 +309,7 @@ export function App() {{/* Main layout below titlebar */}<div className="flex flex-1 overflow-hidden">{isAuthenticated && <Sidebar activeTab={activeTab} onTabChange={setActiveTab} />}- <MainContent title={getTitle()}>{renderContent()}</MainContent>+ <div className="flex-1 overflow-hidden">{renderContent()}</div></div>{/* Global Copilot Components */}diff --git a/src/renderer/components/copilot/CallSummaryView.tsx b/src/renderer/components/copilot/CallSummaryView.tsxindex a71223f..2862511 100644--- a/src/renderer/components/copilot/CallSummaryView.tsx+++ b/src/renderer/components/copilot/CallSummaryView.tsx@@ -1,15 +1,16 @@/*** Meeting Summary View Component*- * Displays the AI-generated meeting summary as formatted markdown.+ * Displays the post-meeting summary with:+ * - Short Overview (narrative paragraph)+ * - Key Discussion Points (grouped by topic)*/import { useState } from 'react';-import ReactMarkdown from 'react-markdown';import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';import { Button } from '../ui/button';import { Badge } from '../ui/badge';-import { FileText, Copy, Check, Clock } from 'lucide-react';+import { FileText, Copy, Check, Clock, ChevronDown, ChevronUp } from 'lucide-react';import { useCopilotStore } from '../../stores/copilot.store';import { cn } from '../../lib/utils';import type { CopilotCallSummary } from '../../../shared/types/ipc.types';@@ -25,6 +26,7 @@ export function CallSummaryView({ className, summary: propSummary, duration: proconst summary = propSummary || store.callSummary;const duration = propDuration || store.callDuration;const [copied, setCopied] = useState(false);+ const [expandedTopics, setExpandedTopics] = useState<Set<number>>(new Set([0])); // First topic expanded by defaultif (!summary) {return (@@ -52,11 +54,36 @@ export function CallSummaryView({ className, summary: propSummary, duration: pro};const copyToClipboard = () => {- navigator.clipboard.writeText(summary.summary);+ // Format summary for clipboard+ let text = `Meeting Overview\n${'='.repeat(50)}\n${summary.shortOverview}\n\n`;++ if (summary.keyPoints && summary.keyPoints.length > 0) {+ text += `Key Discussion Points\n${'='.repeat(50)}\n`;+ summary.keyPoints.forEach((kp) => {+ text += `\n${kp.topic}\n${'-'.repeat(30)}\n`;+ kp.points.forEach((point) => {+ text += ` - ${point}\n`;+ });+ });+ }++ navigator.clipboard.writeText(text);setCopied(true);setTimeout(() => setCopied(false), 2000);};+ const toggleTopic = (index: number) => {+ setExpandedTopics((prev) => {+ const newSet = new Set(prev);+ if (newSet.has(index)) {+ newSet.delete(index);+ } else {+ newSet.add(index);+ }+ return newSet;+ });+ };+return (<Card className={cn("", className)}><CardHeader className="pb-2">@@ -89,50 +116,55 @@ export function CallSummaryView({ className, summary: propSummary, duration: pro</div></CardHeader>- <CardContent>- <div className="prose prose-sm dark:prose-invert max-w-none">- <ReactMarkdown- components={{- h2: ({ children }) => (- <h2 className="text-base font-semibold mt-4 mb-2 first:mt-0 border-b pb-1">{children}</h2>- ),- h3: ({ children }) => (- <h3 className="text-sm font-semibold mt-3 mb-1">{children}</h3>- ),- ul: ({ children }) => (- <ul className="list-disc list-inside space-y-1 my-2 ml-2">{children}</ul>- ),- ol: ({ children }) => (- <ol className="list-decimal list-inside space-y-1 my-2 ml-2">{children}</ol>- ),- li: ({ children }) => (- <li className="text-sm">{children}</li>- ),- p: ({ children }) => (- <p className="text-sm my-2 leading-relaxed">{children}</p>- ),- // Style checkboxes in action items- input: ({ type, checked }) => {- if (type === 'checkbox') {- return (- <input- type="checkbox"- checked={checked}- readOnly- className="mr-2 rounded border-gray-300"- />- );- }- return null;- },- strong: ({ children }) => (- <strong className="font-semibold">{children}</strong>- ),- }}- >- {summary.summary}- </ReactMarkdown>+ <CardContent className="space-y-6">+ {/* Short Overview */}+ <div>+ <h3 className="text-sm font-semibold text-foreground mb-2">Overview</h3>+ <p className="text-sm text-muted-foreground leading-relaxed">+ {summary.shortOverview}+ </p></div>++ {/* Key Points */}+ {summary.keyPoints && summary.keyPoints.length > 0 && (+ <div>+ <h3 className="text-sm font-semibold text-foreground mb-3">Key Discussion Points</h3>+ <div className="space-y-2">+ {summary.keyPoints.map((kp, idx) => (+ <div key={idx} className="border rounded-lg overflow-hidden">+ <button+ className="w-full flex items-center justify-between p-3 hover:bg-muted/50 transition-colors text-left"+ onClick={() => toggleTopic(idx)}+ >+ <span className="font-medium text-sm">{kp.topic}</span>+ <div className="flex items-center gap-2">+ <Badge variant="secondary" className="text-xs">+ {kp.points.length} points+ </Badge>+ {expandedTopics.has(idx) ? (+ <ChevronUp className="h-4 w-4 text-muted-foreground" />+ ) : (+ <ChevronDown className="h-4 w-4 text-muted-foreground" />+ )}+ </div>+ </button>+ {expandedTopics.has(idx) && (+ <div className="px-3 pb-3">+ <ul className="space-y-1.5">+ {kp.points.map((point, pointIdx) => (+ <li key={pointIdx} className="flex items-start gap-2 text-sm text-muted-foreground">+ <span className="text-muted-foreground/60 mt-1.5 text-[8px]">●</span>+ <span>{point}</span>+ </li>+ ))}+ </ul>+ </div>+ )}+ </div>+ ))}+ </div>+ </div>+ )}</CardContent></Card>);diff --git a/src/renderer/components/history/HistoryView.tsx b/src/renderer/components/history/HistoryView.tsxindex aa8bd92..61dbf4c 100644--- a/src/renderer/components/history/HistoryView.tsx+++ b/src/renderer/components/history/HistoryView.tsx@@ -1,17 +1,16 @@-import React, { useState, useEffect } from 'react';-import { RefreshCw, Inbox, Trash2 } from 'lucide-react';-import { Button } from '../ui/button';-import { ScrollArea } from '../ui/scroll-area';+import React, { useState, useEffect, useMemo } from 'react';+import { RefreshCw, Inbox, Search } from 'lucide-react';import { RecordingCard } from './RecordingCard';-import { RecordingDetailsModal } from './RecordingDetailsModal';+import { RecordingDetailPage } from './RecordingDetailPage';import { trpc } from '../../api/trpc';import type { Recording } from '../../../shared/schemas/recording.schema';export function HistoryView() {- const [selectedRecording, setSelectedRecording] = useState<Recording | null>(null);+ const [selectedRecordingId, setSelectedRecordingId] = useState<number | null>(null);const [hasCleanedUp, setHasCleanedUp] = useState(false);+ const [searchQuery, setSearchQuery] = useState('');- const { data: recordings, isLoading, refetch, isRefetching } = trpc.recordings.list.useQuery(+ const { data: recordings, isLoading, refetch } = trpc.recordings.list.useQuery(undefined,{refetchInterval: 10000,@@ -40,75 +39,100 @@ export function HistoryView() {}}, [recordings, hasCleanedUp]);- const sortedRecordings = [...(recordings || [])].sort(- (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()- );+ // Sort recordings by date (newest first) and filter by search query+ const filteredRecordings = useMemo(() => {+ const sorted = [...(recordings || [])].sort(+ (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()+ );++ if (!searchQuery.trim()) {+ return sorted;+ }++ const query = searchQuery.toLowerCase();+ return sorted.filter((recording) => {+ // Search in meeting name+ if (recording.meetingName?.toLowerCase().includes(query)) {+ return true;+ }+ // Search in short overview+ if (recording.shortOverview?.toLowerCase().includes(query)) {+ return true;+ }+ return false;+ });+ }, [recordings, searchQuery]);++ // If a recording is selected, show the detail page+ if (selectedRecordingId !== null) {+ return (+ <RecordingDetailPage+ recordingId={selectedRecordingId}+ onBack={() => setSelectedRecordingId(null)}+ />+ );+ }+ // Show the recordings gridreturn (- <div className="h-full flex flex-col">+ <div className="h-full flex flex-col bg-white">{/* Header */}- <div className="flex items-center justify-between mb-4">- <div>- <h2 className="text-lg font-semibold">Recording History</h2>- <p className="text-sm text-muted-foreground">- {recordings?.length || 0} recording{recordings?.length !== 1 ? 's' : ''}- </p>- </div>- <div className="flex gap-2">- {recordings && recordings.some(r => r.status === 'processing' || r.status === 'recording') && (- <Button- variant="outline"- size="sm"- onClick={() => cleanupMutation.mutate({ maxAgeMinutes: 30 })}- disabled={cleanupMutation.isPending}- >- <Trash2 className="h-4 w-4 mr-2" />- Clean Stale- </Button>- )}- <Button- variant="outline"- size="sm"- onClick={() => refetch()}- disabled={isRefetching}- >- <RefreshCw className={`h-4 w-4 mr-2 ${isRefetching ? 'animate-spin' : ''}`} />- Refresh- </Button>+ <div className="px-8 pt-8 pb-6">+ <h1 className="text-[28px] font-semibold text-black tracking-tight">+ Meeting Recordings+ </h1>+ <p className="text-[15px] text-[#6b6b6b] mt-1">+ View and manage your past meeting recordings+ </p>+ </div>++ {/* Search Bar */}+ <div className="px-8 pb-6">+ <div className="relative max-w-md">+ <Search className="absolute left-3.5 top-1/2 -translate-y-1/2 h-4.5 w-4.5 text-[#969696]" />+ <input+ type="text"+ placeholder="Search recordings..."+ value={searchQuery}+ onChange={(e) => setSearchQuery(e.target.value)}+ className="w-full h-11 pl-11 pr-4 rounded-xl border border-[#e0e0e0] bg-[#fafafa] text-[14px] text-black placeholder:text-[#969696] focus:outline-none focus:border-[#c0c0c0] focus:bg-white transition-colors"+ /></div></div>- {/* Recordings List */}- <ScrollArea className="flex-1">+ {/* Recording Cards Grid */}+ <div className="flex-1 overflow-y-auto px-8 pb-8">{isLoading ? (- <div className="flex items-center justify-center h-32">- <RefreshCw className="h-6 w-6 animate-spin text-muted-foreground" />+ <div className="flex items-center justify-center h-48">+ <RefreshCw className="h-6 w-6 animate-spin text-[#969696]" /></div>- ) : sortedRecordings.length === 0 ? (- <div className="flex flex-col items-center justify-center h-32 text-muted-foreground">- <Inbox className="h-10 w-10 mb-2" />- <p className="text-sm">No recordings yet</p>- <p className="text-xs">Start a recording to see it here</p>+ ) : filteredRecordings.length === 0 ? (+ <div className="flex flex-col items-center justify-center h-48 text-[#6b6b6b]">+ <Inbox className="h-12 w-12 mb-3 text-[#c0c0c0]" />+ {searchQuery ? (+ <>+ <p className="text-[15px] font-medium">No matching recordings</p>+ <p className="text-[13px] text-[#969696] mt-1">Try a different search term</p>+ </>+ ) : (+ <>+ <p className="text-[15px] font-medium">No recordings yet</p>+ <p className="text-[13px] text-[#969696] mt-1">Start a recording to see it here</p>+ </>+ )}</div>) : (- <div className="space-y-3 pr-4">- {sortedRecordings.map((recording) => (+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5">+ {filteredRecordings.map((recording) => (<RecordingCardkey={recording.id}recording={recording}- onViewDetails={() => setSelectedRecording(recording)}+ onClick={() => setSelectedRecordingId(recording.id)}/>))}</div>)}- </ScrollArea>-- {/* Details Modal */}- <RecordingDetailsModal- recording={selectedRecording}- open={!!selectedRecording}- onOpenChange={(open) => !open && setSelectedRecording(null)}- />+ </div></div>);}diff --git a/src/renderer/components/history/RecordingCard.tsx b/src/renderer/components/history/RecordingCard.tsxindex b02b77a..164d22f 100644--- a/src/renderer/components/history/RecordingCard.tsx+++ b/src/renderer/components/history/RecordingCard.tsx@@ -1,129 +1,139 @@import React from 'react';-import { Play, Clock, FileText, Loader2 } from 'lucide-react';-import { Card, CardContent } from '../ui/card';-import { Button } from '../ui/button';-import { Badge } from '../ui/badge';+import { Calendar, Clock, CheckCircle2, AlertTriangle, Loader2, Circle } from 'lucide-react';import type { Recording } from '../../../shared/schemas/recording.schema';-import { formatDuration, formatRelativeTime, stripMarkdown } from '../../lib/utils';-import { getElectronAPI } from '../../api/ipc';+import { formatDate, formatDurationMinutes, stripMarkdown, cn } from '../../lib/utils';interface RecordingCardProps {recording: Recording;- onViewDetails: () => void;+ onClick: () => void;}-export function RecordingCard({ recording, onViewDetails }: RecordingCardProps) {- const handlePlay = async () => {- const api = getElectronAPI();- if (recording.playerUrl && api) {- await api.app.openPlayerWindow(recording.playerUrl);- }- };+type RecordingStatus = 'recording' | 'processing' | 'available' | 'failed';- const getStatusBadge = () => {- switch (recording.status) {- case 'recording':- return <Badge variant="destructive">Recording</Badge>;- case 'processing':- return (- <Badge variant="warning" className="gap-1">- <Loader2 className="h-3 w-3 animate-spin" />- Processing- </Badge>- );- case 'available':- return <Badge variant="success">Ready</Badge>;- case 'failed':- return <Badge variant="destructive">Failed</Badge>;- default:- return null;- }- };+interface StatusConfig {+ label: string;+ bgColor: string;+ hoverBg: string;+ hoverBorder: string;+ icon: React.ReactNode;+}- const getSummaryBadge = () => {- // Prioritize call summary over insights- if (recording.callSummary?.summary && recording.callSummary.summary.length > 0) {- return <Badge variant="default">Summary ready</Badge>;- }+const statusConfigs: Record<RecordingStatus, StatusConfig> = {+ recording: {+ label: 'Recording',+ bgColor: 'bg-[#3b82f6]',+ hoverBg: 'hover:bg-[#eff6ff]',+ hoverBorder: 'hover:border-[#93c5fd]',+ icon: <Circle className="h-4 w-4 fill-current" />,+ },+ processing: {+ label: 'Processing',+ bgColor: 'bg-[#eab308]',+ hoverBg: 'hover:bg-[#fefce8]',+ hoverBorder: 'hover:border-[#fde047]',+ icon: <Loader2 className="h-4 w-4 animate-spin" />,+ },+ available: {+ label: 'Done',+ bgColor: 'bg-[#559e58]',+ hoverBg: 'hover:bg-[#f0fdf4]',+ hoverBorder: 'hover:border-[#86efac]',+ icon: <CheckCircle2 className="h-4 w-4" />,+ },+ failed: {+ label: 'Error',+ bgColor: 'bg-[#ef4444]',+ hoverBg: 'hover:bg-[#fef2f2]',+ hoverBorder: 'hover:border-[#fca5a5]',+ icon: <AlertTriangle className="h-4 w-4" />,+ },+};++function StatusBadge({ status }: { status: RecordingStatus }) {+ const config = statusConfigs[status] || statusConfigs.available;++ return (+ <div+ className={cn(+ 'inline-flex w-fit items-center gap-[4px] pl-[6px] pr-[8px] py-[4px] rounded-[36px] text-white text-[13px] font-medium leading-[1.5]',+ config.bgColor+ )}+ >+ {config.icon}+ <span>{config.label}</span>+ </div>+ );+}++export function RecordingCard({ recording, onClick }: RecordingCardProps) {+ const config = statusConfigs[recording.status] || statusConfigs.available;- if (recording.status !== 'available') return null;+ // Get the title - prefer meetingName, fallback to date-based title+ const title = recording.meetingName || `Recording - ${formatDate(recording.createdAt)}`;- switch (recording.insightsStatus) {- case 'pending':- return <Badge variant="secondary">Insights pending</Badge>;- case 'processing':- return (- <Badge variant="secondary" className="gap-1">- <Loader2 className="h-3 w-3 animate-spin" />- Generating insights- </Badge>- );- case 'ready':- return <Badge variant="outline">Insights ready</Badge>;- case 'failed':- return <Badge variant="outline">Insights failed</Badge>;- default:- return null;+ // Get the description - prefer shortOverview, fallback to insights+ const getDescription = (): string => {+ if (recording.shortOverview) {+ return recording.shortOverview;}+ if (recording.insights) {+ return stripMarkdown(recording.insights);+ }+ if (recording.meetingDescription) {+ return recording.meetingDescription;+ }+ return 'No summary available yet.';};+ const description = getDescription();+return (- <Card className="hover:bg-muted/50 transition-colors">- <CardContent className="p-4">- <div className="flex items-start justify-between gap-4">- <div className="flex-1 min-w-0">- <div className="flex items-center gap-2 mb-2">- {getStatusBadge()}- {getSummaryBadge()}- </div>+ <div+ onClick={onClick}+ className={cn(+ 'bg-[#f7f7f7] border border-[#efefef] rounded-[16px] pt-[20px] pb-[24px] px-[20px] cursor-pointer',+ 'transition-all duration-200',+ 'flex flex-col gap-[20px]',+ config.hoverBg,+ config.hoverBorder+ )}+ >+ {/* Header Section */}+ <div className="flex flex-col gap-[10px]">+ {/* Status Badge */}+ <StatusBadge status={recording.status} />- <p className="text-sm font-medium truncate">- Session: {recording.sessionId.slice(0, 20)}...- </p>+ {/* Title */}+ <h3 className="text-[18px] font-medium text-black tracking-[0.09px] line-clamp-1">+ {title}+ </h3>- <div className="flex items-center gap-4 mt-2 text-xs text-muted-foreground">- <span className="flex items-center gap-1">- <Clock className="h-3 w-3" />- {formatRelativeTime(recording.createdAt)}- </span>- {recording.duration && (- <span className="flex items-center gap-1">- <FileText className="h-3 w-3" />- {formatDuration(recording.duration)}- </span>- )}- </div>+ {/* Metadata Row */}+ <div className="flex items-center gap-[20px]">+ {/* Date */}+ <div className="flex items-center gap-[4px]">+ <Calendar className="h-4 w-4 text-[#969696]" />+ <span className="text-[13px] text-[#464646] tracking-[0.065px]">+ {formatDate(recording.createdAt)}+ </span></div>- <div className="flex items-center gap-2">- {recording.status === 'available' && recording.playerUrl && (- <Button size="sm" variant="outline" onClick={handlePlay}>- <Play className="h-4 w-4 mr-1" />- Play- </Button>- )}- <Button size="sm" variant="ghost" onClick={onViewDetails}>- Details- </Button>- </div>+ {/* Duration */}+ {recording.duration && (+ <div className="flex items-center gap-[8px]">+ <Clock className="h-4 w-4 text-[#969696]" />+ <span className="text-[13px] text-[#464646] tracking-[0.065px]">+ {formatDurationMinutes(recording.duration)}+ </span>+ </div>+ )}</div>+ </div>- {/* Call Summary preview (prioritized) */}- {recording.callSummary?.summary && recording.callSummary.summary.length > 0 && (- <div className="mt-3 pt-3 border-t">- <p className="text-xs font-medium text-muted-foreground mb-1">Call Summary</p>- <p className="text-sm line-clamp-2">{stripMarkdown(recording.callSummary.summary)}</p>- </div>- )}-- {/* Fallback to insights if no call summary */}- {!recording.callSummary?.summary?.length && recording.insightsStatus === 'ready' && recording.insights && (- <div className="mt-3 pt-3 border-t">- <p className="text-xs font-medium text-muted-foreground mb-1">AI Summary</p>- <p className="text-sm line-clamp-2">{stripMarkdown(recording.insights)}</p>- </div>- )}- </CardContent>- </Card>+ {/* Description */}+ <p className="text-[13px] text-[#2d2d2d] leading-[18px] tracking-[0.065px] line-clamp-4">+ {description}+ </p>+ </div>);}diff --git a/src/renderer/components/history/RecordingDetailPage.tsx b/src/renderer/components/history/RecordingDetailPage.tsxnew file mode 100644index 0000000..ad9fcc0--- /dev/null+++ b/src/renderer/components/history/RecordingDetailPage.tsx@@ -0,0 +1,630 @@+/**+ * Recording Detail Page+ *+ * Full page view for a recording with:+ * - Header: back button, title, metadata, actions+ * - Left panel: Meeting summary, key points, checklist+ * - Right panel: Video player, chat button, transcript+ */++import React, { useState, useEffect } from 'react';+import {+ ArrowLeft,+ Calendar,+ Clock,+ FileText,+ List,+ CheckSquare,+ MessageCircle,+ Sparkles,+ Upload,+ Link2,+ ChevronDown,+ Check,+ Loader2,+ Video,+} from 'lucide-react';+import { trpc } from '../../api/trpc';+import type { Recording } from '../../../shared/schemas/recording.schema';+import { formatDate, formatDurationMinutes, cn } from '../../lib/utils';++interface RecordingDetailPageProps {+ recordingId: number;+ onBack: () => void;+}++// Format time as MM:SS for transcript+function formatTime(seconds: number): string {+ const mins = Math.floor(seconds / 60);+ const secs = Math.floor(seconds % 60);+ return `${mins}:${secs.toString().padStart(2, '0')}`;+}++export function RecordingDetailPage({ recordingId, onBack }: RecordingDetailPageProps) {+ const [showAllKeyPoints, setShowAllKeyPoints] = useState(false);+ const [collectionId, setCollectionId] = useState<string | null>(null);++ // Fetch recording data+ const { data: recording, isLoading } = trpc.recordings.get.useQuery(+ { recordingId },+ { enabled: !!recordingId }+ );++ // Fetch transcript from database+ const { data: transcript } = trpc.recordings.getTranscript.useQuery(+ { recordingId },+ { enabled: !!recordingId }+ );++ // Populate collectionId if missing+ const populateCollectionIdMutation = trpc.recordings.populateCollectionId.useMutation();++ useEffect(() => {+ if (recording?.videoId && !recording?.collectionId && !collectionId) {+ populateCollectionIdMutation.mutateAsync({ recordingId }).then((result) => {+ if (result.collectionId) {+ setCollectionId(result.collectionId);+ }+ });+ } else if (recording?.collectionId) {+ setCollectionId(recording.collectionId);+ }+ }, [recording?.videoId, recording?.collectionId, recordingId]);++ if (isLoading) {+ return (+ <div className="bg-[#f7f7f7] h-full flex items-center justify-center">+ <div className="animate-spin h-8 w-8 border-2 border-[#ec5b16] border-t-transparent rounded-full" />+ </div>+ );+ }++ if (!recording) {+ return (+ <div className="bg-[#f7f7f7] h-full flex flex-col items-center justify-center gap-4">+ <p className="text-[#464646]">Recording not found</p>+ <button+ onClick={onBack}+ className="text-[#ec5b16] hover:underline"+ >+ Go back+ </button>+ </div>+ );+ }++ const title = recording.meetingName || `Recording - ${formatDate(recording.createdAt)}`;+ const isVideoReady = recording.status === 'available' && !!recording.playerUrl;++ // Debug logging+ console.log('[RecordingDetailPage] videoId:', recording.videoId);+ console.log('[RecordingDetailPage] collectionId (from recording):', recording.collectionId);+ console.log('[RecordingDetailPage] collectionId (local state):', collectionId);++ return (+ <div className="bg-[#f7f7f7] h-full flex flex-col pt-[10px] px-[10px]">+ {/* Header */}+ <Header+ title={title}+ recordingId={recordingId}+ createdAt={recording.createdAt}+ duration={recording.duration}+ playerUrl={recording.playerUrl}+ onBack={onBack}+ />++ {/* Main Content */}+ <div className="flex-1 bg-white border border-[#efefef] rounded-[20px] p-[20px] pb-[40px] flex gap-[30px] overflow-y-auto mb-[10px]">+ {/* Left Panel - Meeting Insights */}+ <div className="flex-1 flex flex-col gap-[30px] min-w-0">+ {/* Section Header */}+ <div className="flex items-center gap-[4px]">+ <Sparkles className="h-5 w-5 text-[#ec5b16]" />+ <h2 className="text-[18px] font-semibold text-black tracking-[0.09px]">+ Meeting Insights+ </h2>+ </div>++ {/* Cards */}+ <div className="flex flex-col gap-[20px] pb-[20px]">+ {/* Meeting Summary Card */}+ <SummaryCard summary={recording.shortOverview} />++ {/* Key Points Card */}+ <KeyPointsCard+ keyPoints={recording.keyPoints}+ expanded={showAllKeyPoints}+ onToggle={() => setShowAllKeyPoints(!showAllKeyPoints)}+ />++ {/* Checklist Card */}+ <ChecklistCard checklist={recording.meetingChecklist} />+ </div>+ </div>++ {/* Right Panel - Video & Transcript */}+ <div className="flex-1 flex flex-col gap-[30px] min-w-0">+ {/* Video Player */}+ <VideoPlayerSection+ playerUrl={recording.playerUrl}+ isReady={isVideoReady}+ />++ {/* Chat with Video Button */}+ <div className="flex justify-center">+ <ChatWithVideoButton+ videoId={recording.videoId}+ collectionId={collectionId}+ disabled={!isVideoReady}+ />+ </div>++ {/* Transcript Section */}+ <TranscriptSection transcript={transcript || []} />+ </div>+ </div>+ </div>+ );+}++// ============================================================================+// Sub-components+// ============================================================================++interface HeaderProps {+ title: string;+ recordingId: number;+ createdAt: string;+ duration: number | null;+ playerUrl: string | null | undefined;+ onBack: () => void;+}++function Header({ title, recordingId, createdAt, duration, playerUrl, onBack }: HeaderProps) {+ const [copyState, setCopyState] = useState<'idle' | 'copying' | 'copied'>('idle');+ const [exportOpen, setExportOpen] = useState(false);+ const [downloadingVideo, setDownloadingVideo] = useState(false);+ const [downloadingTranscript, setDownloadingTranscript] = useState(false);++ const downloadVideoMutation = trpc.recordings.downloadVideo.useMutation();+ const { data: transcript } = trpc.recordings.getTranscript.useQuery(+ { recordingId },+ { enabled: !!recordingId }+ );++ const handleCopyLink = async () => {+ if (!playerUrl || copyState !== 'idle') return;++ setCopyState('copying');+ await navigator.clipboard.writeText(playerUrl);+ setCopyState('copied');+ setTimeout(() => setCopyState('idle'), 2000);+ };++ const handleDownloadVideo = async () => {+ setDownloadingVideo(true);+ setExportOpen(false);+ try {+ const result = await downloadVideoMutation.mutateAsync({ recordingId });+ window.open(result.downloadUrl, '_blank');+ } catch (error) {+ console.error('Failed to download video:', error);+ } finally {+ setDownloadingVideo(false);+ }+ };++ const handleDownloadTranscript = () => {+ if (!transcript || transcript.length === 0) return;+ setDownloadingTranscript(true);+ setExportOpen(false);++ const content = transcript.map(seg => {+ const mins = Math.floor(seg.startTime / 60);+ const secs = Math.floor(seg.startTime % 60);+ const time = `${mins}:${secs.toString().padStart(2, '0')}`;+ const speaker = seg.channel === 'me' ? 'You' : 'Them';+ return `[${time}] ${speaker}: ${seg.text}`;+ }).join('\n\n');++ const blob = new Blob([content], { type: 'text/plain' });+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = `${title.replace(/[^a-z0-9]/gi, '_')}_transcript.txt`;+ a.click();+ URL.revokeObjectURL(url);+ setDownloadingTranscript(false);+ };++ return (+ <div className="flex gap-[12px] items-start p-[20px]">+ {/* Left: Back + Title */}+ <div className="flex-1 flex gap-[16px] items-start">+ {/* Back Button */}+ <div className="pt-[2px]">+ <button+ onClick={onBack}+ className="w-[28px] h-[28px] bg-white border border-black/20 rounded-[6.5px] flex items-center justify-center hover:bg-gray-50 transition-colors"+ >+ <ArrowLeft className="h-[15px] w-[15px] text-black" />+ </button>+ </div>++ {/* Title & Metadata */}+ <div className="flex-1 flex flex-col gap-[10px]">+ <h1 className="text-[24px] font-semibold text-black tracking-[0.12px]">+ {title}+ </h1>+ <div className="flex items-center gap-[20px]">+ {/* Date */}+ <div className="flex items-center gap-[4px]">+ <Calendar className="h-4 w-4 text-[#969696]" />+ <span className="text-[14px] text-[#464646] tracking-[0.07px]">+ {formatDate(createdAt)}+ </span>+ </div>+ {/* Duration */}+ {duration && (+ <div className="flex items-center gap-[8px]">+ <Clock className="h-4 w-4 text-[#969696]" />+ <span className="text-[14px] text-[#464646] tracking-[0.07px]">+ {formatDurationMinutes(duration)}+ </span>+ </div>+ )}+ </div>+ </div>+ </div>++ {/* Right: Action Buttons */}+ <div className="flex gap-[12px] items-start">+ {/* Export Button with Dropdown */}+ <div className="relative">+ <button+ onClick={() => setExportOpen(!exportOpen)}+ disabled={downloadingVideo || downloadingTranscript}+ className={cn(+ "flex items-center gap-[6px] border rounded-[12px] px-[16px] py-[12px] shadow-[0px_1.27px_15.27px_0px_rgba(0,0,0,0.05)] transition-colors",+ exportOpen+ ? "bg-[#fff5ec] border-[#ffcfa5]"+ : "bg-white border-[#efefef] hover:bg-[#efefef] hover:border-[#969696]"+ )}+ >+ {downloadingVideo || downloadingTranscript ? (+ <Loader2 className="h-5 w-5 text-black animate-spin" />+ ) : (+ <Upload className="h-5 w-5 text-black" />+ )}+ <span className="text-[14px] font-semibold text-black tracking-[-0.28px]">+ Export+ </span>+ <ChevronDown className="h-5 w-5 text-black" />+ </button>++ {/* Dropdown Menu */}+ {exportOpen && (+ <>+ <div className="fixed inset-0 z-10" onClick={() => setExportOpen(false)} />+ <div className="absolute right-0 top-full mt-2 z-20 bg-white border border-[#efefef] rounded-[12px] shadow-[0px_17px_17px_0px_rgba(0,0,0,0.12),0px_4px_9px_0px_rgba(0,0,0,0.14)] p-[8px] min-w-[180px]">+ <button+ onClick={handleDownloadVideo}+ className="w-full flex items-center gap-[6px] px-[10px] py-[8px] rounded-[10px] hover:bg-[#efefef] transition-colors"+ >+ <Video className="h-5 w-5 text-black" />+ <span className="text-[13px] font-medium text-black">Video</span>+ </button>+ <button+ onClick={handleDownloadTranscript}+ disabled={!transcript || transcript.length === 0}+ className="w-full flex items-center gap-[6px] px-[10px] py-[8px] rounded-[10px] hover:bg-[#efefef] transition-colors disabled:opacity-50"+ >+ <FileText className="h-5 w-5 text-black" />+ <span className="text-[13px] font-medium text-black">Transcript</span>+ </button>+ </div>+ </>+ )}+ </div>++ {/* Copy Video Link Button */}+ <button+ onClick={handleCopyLink}+ disabled={!playerUrl || copyState !== 'idle'}+ className={cn(+ "flex items-center gap-[4px] rounded-[12px] px-[14px] py-[12px] shadow-[0px_1.27px_15.27px_0px_rgba(0,0,0,0.05)] transition-colors",+ copyState === 'copied' ? "bg-[#007657]" :+ copyState === 'copying' ? "bg-[#ff7e32]" :+ "bg-[#ff4000] hover:bg-[#cc2b02]",+ !playerUrl && "opacity-50 cursor-not-allowed"+ )}+ >+ {copyState === 'copied' ? (+ <Check className="h-5 w-5 text-white" />+ ) : copyState === 'copying' ? (+ <Loader2 className="h-5 w-5 text-white animate-spin" />+ ) : (+ <Link2 className="h-5 w-5 text-white" />+ )}+ <span className="text-[14px] font-semibold text-white tracking-[-0.28px]">+ {copyState === 'copied' ? "Link copied!" :+ copyState === 'copying' ? "Creating link..." :+ "Copy video link"}+ </span>+ </button>+ </div>+ </div>+ );+}++interface SummaryCardProps {+ summary: string | null | undefined;+}++function SummaryCard({ summary }: SummaryCardProps) {+ if (!summary) return null;++ return (+ <div className="bg-[#fff5ec] border border-[#ffe9d3] rounded-[16px] p-[20px] flex flex-col gap-[16px]">+ {/* Header */}+ <div className="flex items-center gap-[8px]">+ <FileText className="h-5 w-5 text-[#ec5b16]" />+ <h3 className="text-[16px] font-medium text-black tracking-[0.08px]">+ Meeting Summary+ </h3>+ </div>+ {/* Content */}+ <p className="text-[14px] text-[#2d2d2d] leading-[20px] tracking-[0.07px]">+ {summary}+ </p>+ </div>+ );+}++interface KeyPointsCardProps {+ keyPoints: Array<{ topic: string; points: string[] }> | null | undefined;+ expanded: boolean;+ onToggle: () => void;+}++function KeyPointsCard({ keyPoints, expanded, onToggle }: KeyPointsCardProps) {+ if (!keyPoints || keyPoints.length === 0) return null;++ return (+ <div className={cn(+ "bg-[#fff5ec] border border-[#ffe9d3] rounded-[16px] p-[20px] flex flex-col gap-[16px] relative overflow-hidden",+ !expanded && "max-h-[200px]"+ )}>+ {/* Header */}+ <div className="flex items-center gap-[8px]">+ <List className="h-5 w-5 text-[#ec5b16]" />+ <h3 className="text-[16px] font-medium text-black tracking-[0.08px]">+ Key Points+ </h3>+ </div>++ {/* Content */}+ <div className="flex flex-col text-[14px] text-[#2d2d2d]">+ {keyPoints.map((kp, idx) => (+ <div key={idx} className="mb-2">+ <p className="font-semibold leading-[24px]">+ {idx + 1}. {kp.topic}+ </p>+ <ul className="list-disc ml-[42px]">+ {kp.points.map((point, pIdx) => (+ <li key={pIdx} className="leading-[24px]">+ {point}+ </li>+ ))}+ </ul>+ </div>+ ))}+ </div>++ {/* Gradient Overlay & See More Button */}+ {!expanded && (+ <>+ <div className="absolute bottom-0 left-0 right-0 h-[52px] bg-gradient-to-t from-[#fff5ec] to-transparent pointer-events-none" />+ <button+ onClick={onToggle}+ className="absolute bottom-[6px] left-1/2 -translate-x-1/2 flex items-center gap-px bg-white border border-[#ffcfa5] rounded-full px-[12px] py-[8px] hover:bg-gray-50 transition-colors"+ >+ <span className="text-[13px] font-medium text-[#1f2937] tracking-[0.065px] px-[4px]">+ See more+ </span>+ <ChevronDown className="h-4 w-4 text-[#1f2937]" />+ </button>+ </>+ )}+ </div>+ );+}++interface ChecklistCardProps {+ checklist: string[] | null | undefined;+}++function ChecklistCard({ checklist }: ChecklistCardProps) {+ if (!checklist || checklist.length === 0) return null;++ return (+ <div className="bg-[#f7f7f7] border border-[#efefef] rounded-[16px] p-[20px] flex flex-col gap-[16px]">+ {/* Header */}+ <div className="flex items-center gap-[8px]">+ <CheckSquare className="h-5 w-5 text-[#464646]" />+ <h3 className="text-[16px] font-medium text-black tracking-[0.08px]">+ Follow Up+ </h3>+ </div>++ {/* Content */}+ <div className="flex flex-col gap-[10px]">+ {checklist.map((item, idx) => (+ <div+ key={idx}+ className="bg-white border border-[#efefef] rounded-[8px] px-[16px] py-[8px] flex items-center gap-[16px]"+ >+ {/* Checkbox */}+ <div className="w-4 h-4 shrink-0 rounded border border-[#969696] flex items-center justify-center">+ {/* Unchecked by default */}+ </div>+ <span className="text-[14px] text-black leading-[24px] tracking-[0.07px]">+ {item}+ </span>+ </div>+ ))}+ </div>+ </div>+ );+}++interface VideoPlayerSectionProps {+ playerUrl: string | null | undefined;+ isReady: boolean;+}++function VideoPlayerSection({ playerUrl, isReady }: VideoPlayerSectionProps) {+ const embedUrl = playerUrl?.replace('/watch', '/embed');++ return (+ <div className="border border-[#efefef] rounded-[16px] px-[6px] py-[5px]">+ <div className="aspect-video rounded-[16px] border border-black/10 overflow-hidden bg-gray-100">+ {isReady && embedUrl ? (+ <iframe+ src={embedUrl}+ className="w-full h-full"+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"+ allowFullScreen+ />+ ) : (+ <div className="w-full h-full flex items-center justify-center text-[#969696]">+ <p className="text-[14px]">Video not available yet</p>+ </div>+ )}+ </div>+ </div>+ );+}++interface ChatWithVideoButtonProps {+ videoId: string | null | undefined;+ collectionId: string | null | undefined;+ disabled: boolean;+}++function ChatWithVideoButton({ videoId, collectionId, disabled }: ChatWithVideoButtonProps) {+ const handleClick = () => {+ if (!videoId || !collectionId) return;+ const chatUrl = `https://chat.videodb.io?video_id=${videoId}&collection_id=${collectionId}`;+ window.electronAPI?.app.openExternalLink(chatUrl);+ };++ return (+ <button+ onClick={handleClick}+ disabled={disabled || !videoId || !collectionId}+ className={cn(+ "w-[248px] h-[52px] rounded-[32px] shadow-[0px_2px_3px_0px_rgba(0,0,0,0.18)] relative overflow-hidden",+ (disabled || !videoId || !collectionId) && "opacity-50 cursor-not-allowed"+ )}+ >+ {/* Gradient Background */}+ <div+ className="absolute inset-0 rounded-[32px] border-2 border-[#494949]"+ style={{+ background: 'linear-gradient(260deg, rgb(0, 0, 0) 4.66%, rgb(30, 30, 30) 99.38%)',+ }}+ >+ <div className="absolute inset-0 rounded-[inherit] shadow-[inset_0px_4px_4px_0px_rgba(255,255,255,0.32)]" />+ </div>++ {/* Content */}+ <div className="absolute inset-0 flex items-center justify-center gap-[6px]">+ <MessageCircle className="h-5 w-5 text-white" />+ <span className="text-[16px] font-medium text-white tracking-[-0.08px]">+ Chat with video+ </span>+ </div>+ </button>+ );+}++interface TranscriptSegment {+ id: string;+ channel: 'me' | 'them';+ text: string;+ startTime: number;+}++interface TranscriptSectionProps {+ transcript: TranscriptSegment[];+}++function TranscriptSection({ transcript }: TranscriptSectionProps) {+ return (+ <div className="flex flex-col gap-[20px] flex-1 min-h-0">+ {/* Header */}+ <div className="flex items-center gap-[4px]">+ <Sparkles className="h-5 w-5 text-[#ec5b16]" />+ <h2 className="text-[18px] font-semibold text-black tracking-[0.09px]">+ Meeting Transcript+ </h2>+ </div>++ {/* Transcript Content */}+ <div className="border border-[#efefef] rounded-[16px] flex-1 min-h-[200px] max-h-[500px] overflow-hidden relative">+ <div className="h-full overflow-y-auto px-[20px]">+ {/* Top gradient overlay */}+ <div className="sticky top-0 left-0 right-0 h-[52px] bg-gradient-to-b from-white to-transparent pointer-events-none z-10" />++ {/* Transcript items */}+ <div className="flex flex-col gap-[8px] -mt-[40px] pb-[20px]">+ {transcript.length === 0 ? (+ <div className="py-8 text-center text-[#969696] text-[14px]">+ No transcript available+ </div>+ ) : (+ transcript.map((segment) => (+ <TranscriptChunk+ key={segment.id}+ time={formatTime(segment.startTime)}+ speaker={segment.channel === 'me' ? 'You' : 'Them'}+ text={segment.text}+ />+ ))+ )}+ </div>+ </div>+ </div>+ </div>+ );+}++interface TranscriptChunkProps {+ time: string;+ speaker: string;+ text: string;+}++function TranscriptChunk({ time, speaker, text }: TranscriptChunkProps) {+ return (+ <div className="flex gap-[12px] items-start px-[8px] py-[6px] rounded-[10px]">+ {/* Time */}+ <div className="flex items-center justify-center">+ <span className="text-[12px] text-[#969696] leading-[16px]">{time}</span>+ </div>++ {/* Speaker & Text */}+ <div className="flex-1 flex flex-col gap-[4px]">+ <span className="text-[13px] font-medium text-black leading-[16px]">+ {speaker}+ </span>+ <p className="text-[12px] text-[#464646] leading-[16px]">+ {text}+ </p>+ </div>+ </div>+ );+}++export default RecordingDetailPage;diff --git a/src/renderer/components/history/RecordingDetailsModal.tsx b/src/renderer/components/history/RecordingDetailsModal.tsxindex e0b80c6..df0cba2 100644--- a/src/renderer/components/history/RecordingDetailsModal.tsx+++ b/src/renderer/components/history/RecordingDetailsModal.tsx@@ -14,6 +14,8 @@ import {ChevronUp,CheckCircle2,MessageSquare,+ ClipboardList,+ HelpCircle,} from 'lucide-react';import {Dialog,@@ -95,7 +97,8 @@ export function RecordingDetailsModal({const metrics = recording.metricsSnapshot;const playbook = recording.playbookSnapshot;- const callSummary = recording.callSummary;+ const shortOverview = recording.shortOverview;+ const keyPoints = recording.keyPoints;return (<Dialog open={open} onOpenChange={onOpenChange}>@@ -167,6 +170,69 @@ export function RecordingDetailsModal({</div>)}+ {/* Meeting Info */}+ {recording.meetingName && (+ <CollapsibleSection+ title="Meeting Info"+ icon={<FileText className="h-4 w-4" />}+ defaultOpen={true}+ >+ <div className="space-y-3 pt-2">+ <div>+ <p className="text-xs font-medium text-muted-foreground mb-1">Name</p>+ <p className="text-sm font-semibold">{recording.meetingName}</p>+ </div>+ {recording.meetingDescription && (+ <div>+ <p className="text-xs font-medium text-muted-foreground mb-1">Description</p>+ <p className="text-sm">{recording.meetingDescription}</p>+ </div>+ )}+ </div>+ </CollapsibleSection>+ )}++ {/* Probing Q&A */}+ {recording.probingQuestions && recording.probingQuestions.length > 0 && (+ <CollapsibleSection+ title="Pre-meeting Context"+ icon={<HelpCircle className="h-4 w-4" />}+ badge={`${recording.probingQuestions.length} Q&A`}+ >+ <div className="space-y-3 pt-2">+ {recording.probingQuestions.map((q, idx) => (+ <div key={idx} className="bg-muted/30 rounded-lg p-3">+ <p className="text-xs text-muted-foreground mb-1">{q.question}</p>+ <p className="text-sm font-medium">+ {q.answer}+ {q.customAnswer && (+ <span className="text-muted-foreground ml-1">+ {q.customAnswer}</span>+ )}+ </p>+ </div>+ ))}+ </div>+ </CollapsibleSection>+ )}++ {/* Meeting Checklist */}+ {recording.meetingChecklist && recording.meetingChecklist.length > 0 && (+ <CollapsibleSection+ title="Meeting Checklist"+ icon={<ClipboardList className="h-4 w-4" />}+ badge={`${recording.meetingChecklist.length} items`}+ >+ <ul className="space-y-2 pt-2">+ {recording.meetingChecklist.map((item, idx) => (+ <li key={idx} className="flex items-start gap-2 text-sm">+ <div className="w-4 h-4 rounded border border-muted-foreground/40 flex-shrink-0 mt-0.5" />+ <span>{item}</span>+ </li>+ ))}+ </ul>+ </CollapsibleSection>+ )}+{/* Conversation Metrics */}{metrics && (<CollapsibleSection@@ -309,82 +375,46 @@ export function RecordingDetailsModal({</CollapsibleSection>)}- {/* Meeting Summary */}- {callSummary && callSummary.summary && (+ {/* Short Overview */}+ {shortOverview && (<CollapsibleSection- title="Meeting Summary"+ title="Meeting Overview"icon={<MessageSquare className="h-4 w-4" />}defaultOpen={true}>- <div className="prose prose-sm dark:prose-invert max-w-none pt-2">- <ReactMarkdown- components={{- h2: ({ children }) => (- <h2 className="text-base font-semibold mt-4 mb-2 first:mt-0 border-b pb-1">{children}</h2>- ),- h3: ({ children }) => (- <h3 className="text-sm font-semibold mt-3 mb-1">{children}</h3>- ),- ul: ({ children }) => (- <ul className="list-disc list-inside space-y-1 my-2 ml-2">{children}</ul>- ),- ol: ({ children }) => (- <ol className="list-decimal list-inside space-y-1 my-2 ml-2">{children}</ol>- ),- li: ({ children }) => <li className="text-sm">{children}</li>,- p: ({ children }) => <p className="text-sm my-2">{children}</p>,- }}- >- {callSummary.summary}- </ReactMarkdown>- </div>+ <p className="text-sm text-foreground leading-relaxed pt-2">+ {shortOverview}+ </p></CollapsibleSection>)}- {/* AI Insights (from VideoDB) */}- {recording.insightsStatus === 'ready' && recording.insights && (+ {/* Key Points */}+ {keyPoints && keyPoints.length > 0 && (<CollapsibleSection- title="AI Summary"+ title="Key Discussion Points"icon={<FileText className="h-4 w-4" />}- defaultOpen={!callSummary}+ badge={`${keyPoints.length} topics`}+ defaultOpen={true}>- <div className="prose prose-sm dark:prose-invert max-w-none pt-2">- <ReactMarkdown- components={{- h2: ({ children }) => (- <h2 className="text-base font-semibold mt-4 mb-2 first:mt-0">{children}</h2>- ),- h3: ({ children }) => (- <h3 className="text-sm font-semibold mt-3 mb-1">{children}</h3>- ),- ul: ({ children }) => (- <ul className="list-disc list-inside space-y-1 my-2">{children}</ul>- ),- li: ({ children }) => <li className="text-sm">{children}</li>,- p: ({ children }) => <p className="text-sm my-2">{children}</p>,- }}- >- {unwrapMarkdownCodeBlock(recording.insights)}- </ReactMarkdown>+ <div className="space-y-4 pt-2">+ {keyPoints.map((kp, idx) => (+ <div key={idx}>+ <h4 className="text-sm font-semibold text-foreground mb-2">+ {kp.topic}+ </h4>+ <ul className="space-y-1.5 ml-1">+ {kp.points.map((point, pointIdx) => (+ <li key={pointIdx} className="flex items-start gap-2 text-sm text-muted-foreground">+ <span className="text-muted-foreground/60 mt-1.5 text-[8px]">●</span>+ <span>{point}</span>+ </li>+ ))}+ </ul>+ </div>+ ))}</div></CollapsibleSection>)}-- {recording.insightsStatus === 'processing' && (- <div className="bg-muted rounded-lg p-4 text-center">- <p className="text-sm text-muted-foreground">- Generating AI insights... This may take a moment.- </p>- </div>- )}-- {recording.insightsStatus === 'failed' && (- <div className="bg-destructive/10 rounded-lg p-4 text-center">- <p className="text-sm text-destructive">- Failed to generate insights for this recording.- </p>- </div>- )}</div></ScrollArea></DialogContent>diff --git a/src/renderer/components/layout/MainContent.tsx b/src/renderer/components/layout/MainContent.tsxdeleted file mode 100644index d92e913..0000000--- a/src/renderer/components/layout/MainContent.tsx+++ /dev/null@@ -1,20 +0,0 @@-import React from 'react';--interface MainContentProps {- title: string;- children: React.ReactNode;-}--export function MainContent({ title, children }: MainContentProps) {- return (- <div className="flex-1 flex flex-col overflow-hidden">- {/* Page header */}- <header className="h-12 flex items-center px-6 border-b bg-background shrink-0">- <h1 className="text-lg font-semibold">{title}</h1>- </header>-- {/* Content */}- <main className="flex-1 overflow-auto p-6">{children}</main>- </div>- );-}diff --git a/src/renderer/components/meeting-setup/ChecklistStep.tsx b/src/renderer/components/meeting-setup/ChecklistStep.tsxnew file mode 100644index 0000000..6fa7ede--- /dev/null+++ b/src/renderer/components/meeting-setup/ChecklistStep.tsx@@ -0,0 +1,78 @@+import React from 'react';+import { ArrowLeft, Play, CheckCircle2 } from 'lucide-react';+import { Button } from '../ui/button';+import { Card, CardContent } from '../ui/card';++interface ChecklistStepProps {+ name: string;+ description: string;+ checklist: string[];+ isStarting: boolean;+ onBack: () => void;+ onStart: () => void;+}++export function ChecklistStep({+ name,+ description,+ checklist,+ isStarting,+ onBack,+ onStart,+}: ChecklistStepProps) {+ return (+ <div className="flex flex-col items-center justify-center min-h-[400px] space-y-8 animate-in fade-in duration-300">+ <div className="text-center space-y-2">+ <h2 className="text-2xl font-semibold tracking-tight">Ready to Start</h2>+ <p className="text-muted-foreground">+ Your meeting checklist is ready+ </p>+ </div>++ <Card className="w-full max-w-lg">+ <CardContent className="pt-6 space-y-4">+ <div>+ <h3 className="font-semibold text-lg">{name}</h3>+ <p className="text-sm text-muted-foreground line-clamp-2">{description}</p>+ </div>++ <div className="border-t pt-4">+ <p className="text-xs text-muted-foreground uppercase tracking-wider mb-3">+ Meeting Checklist ({checklist.length} items)+ </p>+ <ul className="space-y-2">+ {checklist.map((item, idx) => (+ <li key={idx} className="flex items-start gap-2 text-sm">+ <CheckCircle2 className="h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5" />+ <span>{item}</span>+ </li>+ ))}+ </ul>+ </div>+ </CardContent>+ </Card>++ <div className="flex gap-3 w-full max-w-lg pt-2">+ <Button+ type="button"+ variant="outline"+ onClick={onBack}+ disabled={isStarting}+ className="flex-1"+ >+ <ArrowLeft className="mr-2 h-4 w-4" />+ Back+ </Button>+ <Button+ onClick={onStart}+ disabled={isStarting}+ className="flex-1 bg-red-600 hover:bg-red-700"+ size="lg"+ >+ <Play className="mr-2 h-4 w-4 fill-current" />+ {isStarting ? 'Starting...' : 'Start Recording'}+ </Button>+ </div>+ </div>+ );+}diff --git a/src/renderer/components/meeting-setup/InfoStep.tsx b/src/renderer/components/meeting-setup/InfoStep.tsxnew file mode 100644index 0000000..4087616--- /dev/null+++ b/src/renderer/components/meeting-setup/InfoStep.tsx@@ -0,0 +1,107 @@+import React, { useState } from 'react';+import { ArrowRight, ArrowLeft, Loader2 } from 'lucide-react';+import { Button } from '../ui/button';+import { Input } from '../ui/input';+import { Textarea } from '../ui/textarea';+import { Label } from '../ui/label';++interface InfoStepProps {+ initialName: string;+ initialDescription: string;+ isGenerating: boolean;+ onBack: () => void;+ onNext: (name: string, description: string) => void;+}++export function InfoStep({+ initialName,+ initialDescription,+ isGenerating,+ onBack,+ onNext,+}: InfoStepProps) {+ const [name, setName] = useState(initialName);+ const [description, setDescription] = useState(initialDescription);++ const canContinue = name.trim().length > 0 && description.trim().length >= 10;++ const handleSubmit = (e: React.FormEvent) => {+ e.preventDefault();+ if (canContinue && !isGenerating) {+ onNext(name.trim(), description.trim());+ }+ };++ return (+ <div className="flex flex-col items-center justify-center min-h-[400px] space-y-8 animate-in fade-in duration-300">+ <div className="text-center space-y-2">+ <h2 className="text-2xl font-semibold tracking-tight">Meeting Details</h2>+ <p className="text-muted-foreground">+ Tell us about your meeting so we can prepare better+ </p>+ </div>++ <form onSubmit={handleSubmit} className="w-full max-w-md space-y-6">+ <div className="space-y-2">+ <Label htmlFor="meeting-name">Meeting Name</Label>+ <Input+ id="meeting-name"+ placeholder="e.g., Q4 Planning Session"+ value={name}+ onChange={(e) => setName(e.target.value)}+ disabled={isGenerating}+ autoFocus+ />+ </div>++ <div className="space-y-2">+ <Label htmlFor="meeting-description">Description</Label>+ <Textarea+ id="meeting-description"+ placeholder="What will be discussed in this meeting? What are the goals?"+ value={description}+ onChange={(e) => setDescription(e.target.value)}+ disabled={isGenerating}+ rows={4}+ className="resize-none"+ />+ <p className="text-xs text-muted-foreground">+ {description.length < 10+ ? `At least ${10 - description.length} more characters needed`+ : 'Good description!'}+ </p>+ </div>++ <div className="flex gap-3 pt-2">+ <Button+ type="button"+ variant="outline"+ onClick={onBack}+ disabled={isGenerating}+ className="flex-1"+ >+ <ArrowLeft className="mr-2 h-4 w-4" />+ Back+ </Button>+ <Button+ type="submit"+ disabled={!canContinue || isGenerating}+ className="flex-1"+ >+ {isGenerating ? (+ <>+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />+ Preparing...+ </>+ ) : (+ <>+ Continue+ <ArrowRight className="ml-2 h-4 w-4" />+ </>+ )}+ </Button>+ </div>+ </form>+ </div>+ );+}diff --git a/src/renderer/components/meeting-setup/MeetingInfoPanel.tsx b/src/renderer/components/meeting-setup/MeetingInfoPanel.tsxnew file mode 100644index 0000000..c58c78c--- /dev/null+++ b/src/renderer/components/meeting-setup/MeetingInfoPanel.tsx@@ -0,0 +1,120 @@+import React from 'react';+import { FileText, MessageSquareText, CheckSquare, ChevronDown, ChevronUp } from 'lucide-react';+import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';+import { Badge } from '../ui/badge';+import { useMeetingSetupStore } from '../../stores/meeting-setup.store';+import { cn } from '../../lib/utils';++export function MeetingInfoPanel() {+ const { name, description, questions, checklist } = useMeetingSetupStore();+ const [expandedSections, setExpandedSections] = React.useState({+ questions: false,+ checklist: true,+ });++ const toggleSection = (section: 'questions' | 'checklist') => {+ setExpandedSections((prev) => ({+ ...prev,+ [section]: !prev[section],+ }));+ };++ if (!name) {+ return null;+ }++ return (+ <div className="space-y-4 h-full overflow-auto pr-1">+ {/* Meeting Info Card */}+ <Card>+ <CardHeader className="pb-2">+ <div className="flex items-center gap-2">+ <FileText className="h-4 w-4 text-primary" />+ <CardTitle className="text-sm">Meeting</CardTitle>+ </div>+ </CardHeader>+ <CardContent className="space-y-2">+ <h3 className="font-semibold">{name}</h3>+ <p className="text-sm text-muted-foreground line-clamp-3">{description}</p>+ </CardContent>+ </Card>++ {/* Probing Q&A Card */}+ {questions.length > 0 && (+ <Card>+ <CardHeader+ className="pb-2 cursor-pointer hover:bg-muted/50 transition-colors rounded-t-lg"+ onClick={() => toggleSection('questions')}+ >+ <div className="flex items-center justify-between">+ <div className="flex items-center gap-2">+ <MessageSquareText className="h-4 w-4 text-primary" />+ <CardTitle className="text-sm">Context</CardTitle>+ <Badge variant="secondary" className="text-xs">+ {questions.length}+ </Badge>+ </div>+ {expandedSections.questions ? (+ <ChevronUp className="h-4 w-4 text-muted-foreground" />+ ) : (+ <ChevronDown className="h-4 w-4 text-muted-foreground" />+ )}+ </div>+ </CardHeader>+ {expandedSections.questions && (+ <CardContent className="space-y-4 animate-in slide-in-from-top-2 duration-200">+ {questions.map((q, idx) => (+ <div key={idx} className="space-y-1">+ <p className="text-xs text-muted-foreground">{q.question}</p>+ <p className="text-sm font-medium">+ {q.answer}+ {q.customAnswer && (+ <span className="text-muted-foreground"> + {q.customAnswer}</span>+ )}+ </p>+ </div>+ ))}+ </CardContent>+ )}+ </Card>+ )}++ {/* Checklist Card */}+ {checklist.length > 0 && (+ <Card>+ <CardHeader+ className="pb-2 cursor-pointer hover:bg-muted/50 transition-colors rounded-t-lg"+ onClick={() => toggleSection('checklist')}+ >+ <div className="flex items-center justify-between">+ <div className="flex items-center gap-2">+ <CheckSquare className="h-4 w-4 text-primary" />+ <CardTitle className="text-sm">Checklist</CardTitle>+ <Badge variant="secondary" className="text-xs">+ {checklist.length}+ </Badge>+ </div>+ {expandedSections.checklist ? (+ <ChevronUp className="h-4 w-4 text-muted-foreground" />+ ) : (+ <ChevronDown className="h-4 w-4 text-muted-foreground" />+ )}+ </div>+ </CardHeader>+ {expandedSections.checklist && (+ <CardContent className="animate-in slide-in-from-top-2 duration-200">+ <ul className="space-y-2">+ {checklist.map((item, idx) => (+ <li key={idx} className="flex items-start gap-2">+ <div className="w-4 h-4 rounded border border-muted-foreground/40 flex-shrink-0 mt-0.5" />+ <span className="text-sm">{item}</span>+ </li>+ ))}+ </ul>+ </CardContent>+ )}+ </Card>+ )}+ </div>+ );+}diff --git a/src/renderer/components/meeting-setup/MeetingSetupFlow.tsx b/src/renderer/components/meeting-setup/MeetingSetupFlow.tsxnew file mode 100644index 0000000..ae701b0--- /dev/null+++ b/src/renderer/components/meeting-setup/MeetingSetupFlow.tsx@@ -0,0 +1,150 @@+import React from 'react';+import { useMeetingSetupStore } from '../../stores/meeting-setup.store';+import { useSession } from '../../hooks/useSession';+import { trpc } from '../../api/trpc';+import { SourcesStep } from './SourcesStep';+import { InfoStep } from './InfoStep';+import { QuestionsStep } from './QuestionsStep';+import { ChecklistStep } from './ChecklistStep';++export function MeetingSetupFlow() {+ const {+ step,+ name,+ description,+ questions,+ checklist,+ isGenerating,+ error,+ setStep,+ setInfo,+ setQuestions,+ setQuestionAnswer,+ setChecklist,+ setIsGenerating,+ setError,+ getMeetingSetupData,+ } = useMeetingSetupStore();++ const { startRecording, isStarting } = useSession();++ const generateQuestionsMutation = trpc.meetingSetup.generateProbingQuestions.useMutation();+ const generateChecklistMutation = trpc.meetingSetup.generateChecklist.useMutation();++ const handleSourcesNext = () => {+ setStep('info');+ };++ const handleInfoBack = () => {+ setStep('sources');+ };++ const handleInfoNext = async (newName: string, newDescription: string) => {+ setInfo(newName, newDescription);+ setIsGenerating(true);+ setError(null);++ try {+ const result = await generateQuestionsMutation.mutateAsync({+ name: newName,+ description: newDescription,+ });++ if (result.success && result.questions.length > 0) {+ setQuestions(result.questions);+ setStep('questions');+ } else {+ setError(result.error || 'Failed to generate questions');+ }+ } catch (err) {+ setError(err instanceof Error ? err.message : 'Failed to generate questions');+ } finally {+ setIsGenerating(false);+ }+ };++ const handleQuestionsBack = () => {+ setStep('info');+ };++ const handleQuestionsNext = async (answeredQuestions: typeof questions) => {+ setIsGenerating(true);+ setError(null);++ try {+ const result = await generateChecklistMutation.mutateAsync({+ name,+ description,+ questions: answeredQuestions,+ });++ if (result.success && result.checklist.length > 0) {+ setChecklist(result.checklist);+ setStep('checklist');+ } else {+ setError(result.error || 'Failed to generate checklist');+ }+ } catch (err) {+ setError(err instanceof Error ? err.message : 'Failed to generate checklist');+ } finally {+ setIsGenerating(false);+ }+ };++ const handleChecklistBack = () => {+ setStep('questions');+ };++ const handleStartRecording = async () => {+ // Get the meeting setup data to pass to the recording+ const setupData = getMeetingSetupData();++ // Start the recording with meeting setup data+ await startRecording(setupData);+ };++ return (+ <div className="w-full max-w-2xl mx-auto px-4">+ {error && (+ <div className="mb-6 p-4 rounded-lg bg-destructive/10 border border-destructive/20 text-destructive text-sm animate-in fade-in duration-200">+ {error}+ </div>+ )}++ {step === 'sources' && (+ <SourcesStep onNext={handleSourcesNext} />+ )}++ {step === 'info' && (+ <InfoStep+ initialName={name}+ initialDescription={description}+ isGenerating={isGenerating}+ onBack={handleInfoBack}+ onNext={handleInfoNext}+ />+ )}++ {step === 'questions' && (+ <QuestionsStep+ questions={questions}+ isGenerating={isGenerating}+ onBack={handleQuestionsBack}+ onNext={handleQuestionsNext}+ onAnswerChange={setQuestionAnswer}+ />+ )}++ {step === 'checklist' && (+ <ChecklistStep+ name={name}+ description={description}+ checklist={checklist}+ isStarting={isStarting}+ onBack={handleChecklistBack}+ onStart={handleStartRecording}+ />+ )}+ </div>+ );+}diff --git a/src/renderer/components/meeting-setup/QuestionsStep.tsx b/src/renderer/components/meeting-setup/QuestionsStep.tsxnew file mode 100644index 0000000..6f51785--- /dev/null+++ b/src/renderer/components/meeting-setup/QuestionsStep.tsx@@ -0,0 +1,224 @@+import React, { useState } from 'react';+import { ArrowRight, ArrowLeft, Loader2, Check, MessageSquare } from 'lucide-react';+import { Button } from '../ui/button';+import { Input } from '../ui/input';+import { cn } from '../../lib/utils';+import type { ProbingQuestion } from '../../../shared/types/meeting-setup.types';++interface QuestionsStepProps {+ questions: ProbingQuestion[];+ isGenerating: boolean;+ onBack: () => void;+ onNext: (questions: ProbingQuestion[]) => void;+ onAnswerChange: (index: number, answer: string, customAnswer?: string) => void;+}++export function QuestionsStep({+ questions,+ isGenerating,+ onBack,+ onNext,+ onAnswerChange,+}: QuestionsStepProps) {+ const [currentQuestion, setCurrentQuestion] = useState(0);+ const [showCustomInput, setShowCustomInput] = useState<Record<number, boolean>>({});+ const [customInputs, setCustomInputs] = useState<Record<number, string>>({});++ const current = questions[currentQuestion];+ const isLastQuestion = currentQuestion === questions.length - 1;++ const allQuestionsAnswered = questions.every(+ (q) => q.answer.trim().length > 0 || (showCustomInput[questions.indexOf(q)] && customInputs[questions.indexOf(q)]?.trim())+ );++ const currentHasAnswer = current?.answer.trim().length > 0 ||+ (showCustomInput[currentQuestion] && customInputs[currentQuestion]?.trim());++ const handleOptionClick = (option: string) => {+ if (!current) return;++ if (current.type === 'single-choice') {+ onAnswerChange(currentQuestion, option, customInputs[currentQuestion]);+ setShowCustomInput((prev) => ({ ...prev, [currentQuestion]: false }));+ } else {+ // Multi-choice: toggle the option+ const currentAnswers = current.answer ? current.answer.split(',').map((s) => s.trim()) : [];+ const isSelected = currentAnswers.includes(option);++ const newAnswers = isSelected+ ? currentAnswers.filter((a) => a !== option)+ : [...currentAnswers, option];++ onAnswerChange(currentQuestion, newAnswers.join(','), customInputs[currentQuestion]);+ }+ };++ const handleOtherClick = () => {+ setShowCustomInput((prev) => ({ ...prev, [currentQuestion]: !prev[currentQuestion] }));+ };++ const handleCustomInputChange = (value: string) => {+ setCustomInputs((prev) => ({ ...prev, [currentQuestion]: value }));+ onAnswerChange(currentQuestion, current?.answer || '', value);+ };++ const handleNext = () => {+ if (isLastQuestion) {+ onNext(questions);+ } else {+ setCurrentQuestion((prev) => prev + 1);+ }+ };++ const handlePrev = () => {+ if (currentQuestion === 0) {+ onBack();+ } else {+ setCurrentQuestion((prev) => prev - 1);+ }+ };++ const isOptionSelected = (option: string) => {+ if (!current) return false;+ if (current.type === 'single-choice') {+ return current.answer === option;+ }+ return current.answer.split(',').map((s) => s.trim()).includes(option);+ };++ if (!current) {+ return (+ <div className="flex items-center justify-center min-h-[400px]">+ <Loader2 className="h-8 w-8 animate-spin text-muted-foreground" />+ </div>+ );+ }++ return (+ <div className="flex flex-col items-center justify-center min-h-[400px] space-y-8 animate-in fade-in duration-300">+ {/* Progress indicator */}+ <div className="flex gap-2">+ {questions.map((_, idx) => (+ <div+ key={idx}+ className={cn(+ 'w-2.5 h-2.5 rounded-full transition-all duration-200',+ idx === currentQuestion+ ? 'bg-primary w-6'+ : idx < currentQuestion+ ? 'bg-primary/60'+ : 'bg-muted'+ )}+ />+ ))}+ </div>++ <div className="text-center space-y-2 max-w-lg">+ <p className="text-xs text-muted-foreground uppercase tracking-wider">+ Question {currentQuestion + 1} of {questions.length}+ {current.type === 'multi-choice' && ' (select multiple)'}+ </p>+ <h2 className="text-xl font-semibold tracking-tight">{current.question}</h2>+ </div>++ <div className="w-full max-w-md space-y-3">+ {current.options.map((option, idx) => (+ <button+ key={idx}+ type="button"+ onClick={() => handleOptionClick(option)}+ className={cn(+ 'w-full flex items-center gap-3 p-4 rounded-lg border-2 text-left transition-all duration-200',+ 'hover:border-primary/50 hover:bg-muted/30',+ 'focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2',+ isOptionSelected(option)+ ? 'border-primary bg-primary/10'+ : 'border-border bg-background'+ )}+ >+ <div+ className={cn(+ 'w-5 h-5 rounded-full border-2 flex items-center justify-center flex-shrink-0 transition-all',+ current.type === 'multi-choice' && 'rounded-md',+ isOptionSelected(option)+ ? 'border-primary bg-primary'+ : 'border-muted-foreground/40'+ )}+ >+ {isOptionSelected(option) && (+ <Check className="h-3 w-3 text-primary-foreground" />+ )}+ </div>+ <span className="text-sm">{option}</span>+ </button>+ ))}++ {/* Other option */}+ <button+ type="button"+ onClick={handleOtherClick}+ className={cn(+ 'w-full flex items-center gap-3 p-4 rounded-lg border-2 text-left transition-all duration-200',+ 'hover:border-primary/50 hover:bg-muted/30',+ 'focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2',+ showCustomInput[currentQuestion]+ ? 'border-primary bg-primary/10'+ : 'border-dashed border-border bg-background'+ )}+ >+ <MessageSquare className="h-5 w-5 text-muted-foreground flex-shrink-0" />+ <span className="text-sm text-muted-foreground">Other (type your answer)</span>+ </button>++ {showCustomInput[currentQuestion] && (+ <div className="animate-in slide-in-from-top-2 duration-200">+ <Input+ placeholder="Type your answer..."+ value={customInputs[currentQuestion] || ''}+ onChange={(e) => handleCustomInputChange(e.target.value)}+ autoFocus+ />+ </div>+ )}+ </div>++ <div className="flex gap-3 w-full max-w-md pt-2">+ <Button+ type="button"+ variant="outline"+ onClick={handlePrev}+ disabled={isGenerating}+ className="flex-1"+ >+ <ArrowLeft className="mr-2 h-4 w-4" />+ {currentQuestion === 0 ? 'Back' : 'Previous'}+ </Button>+ <Button+ type="button"+ onClick={handleNext}+ disabled={!currentHasAnswer || (isLastQuestion && isGenerating)}+ className="flex-1"+ >+ {isLastQuestion ? (+ isGenerating ? (+ <>+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />+ Generating...+ </>+ ) : (+ <>+ Generate Checklist+ <ArrowRight className="ml-2 h-4 w-4" />+ </>+ )+ ) : (+ <>+ Next+ <ArrowRight className="ml-2 h-4 w-4" />+ </>+ )}+ </Button>+ </div>+ </div>+ );+}diff --git a/src/renderer/components/meeting-setup/SourcesStep.tsx b/src/renderer/components/meeting-setup/SourcesStep.tsxnew file mode 100644index 0000000..dcab984--- /dev/null+++ b/src/renderer/components/meeting-setup/SourcesStep.tsx@@ -0,0 +1,48 @@+import React from 'react';+import { ArrowRight } from 'lucide-react';+import { Button } from '../ui/button';+import { StreamToggles } from '../recording/StreamToggles';+import { useSessionStore } from '../../stores/session.store';++interface SourcesStepProps {+ onNext: () => void;+}++export function SourcesStep({ onNext }: SourcesStepProps) {+ const { streams, toggleStream } = useSessionStore();++ const hasAnySource = streams.microphone || streams.systemAudio || streams.screen;++ return (+ <div className="flex flex-col items-center justify-center min-h-[400px] space-y-8 animate-in fade-in duration-300">+ <div className="text-center space-y-2">+ <h2 className="text-2xl font-semibold tracking-tight">Recording Sources</h2>+ <p className="text-muted-foreground">+ Select which sources to capture during your meeting+ </p>+ </div>++ <StreamToggles+ streams={streams}+ onToggle={toggleStream}+ compact+ />++ <Button+ size="lg"+ onClick={onNext}+ disabled={!hasAnySource}+ className="min-w-[200px]"+ >+ Continue+ <ArrowRight className="ml-2 h-4 w-4" />+ </Button>++ {!hasAnySource && (+ <p className="text-sm text-muted-foreground">+ Please select at least one source to continue+ </p>+ )}+ </div>+ );+}diff --git a/src/renderer/components/meeting-setup/index.ts b/src/renderer/components/meeting-setup/index.tsnew file mode 100644index 0000000..b907cde--- /dev/null+++ b/src/renderer/components/meeting-setup/index.ts@@ -0,0 +1,6 @@+export { MeetingSetupFlow } from './MeetingSetupFlow';+export { MeetingInfoPanel } from './MeetingInfoPanel';+export { SourcesStep } from './SourcesStep';+export { InfoStep } from './InfoStep';+export { QuestionsStep } from './QuestionsStep';+export { ChecklistStep } from './ChecklistStep';diff --git a/src/renderer/components/recording/StreamToggles.tsx b/src/renderer/components/recording/StreamToggles.tsxindex 1664c25..a3ffbc3 100644--- a/src/renderer/components/recording/StreamToggles.tsx+++ b/src/renderer/components/recording/StreamToggles.tsx@@ -1,7 +1,6 @@import React from 'react';-import { Mic, Volume2, Monitor } from 'lucide-react';-import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';-import { Switch } from '../ui/switch';+import { Mic, Volume2, Monitor, Check } from 'lucide-react';+import { cn } from '../../lib/utils';interface StreamState {microphone: boolean;@@ -13,55 +12,55 @@ interface StreamTogglesProps {streams: StreamState;onToggle: (stream: keyof StreamState) => void;disabled?: boolean;+ compact?: boolean;}-export function StreamToggles({ streams, onToggle, disabled }: StreamTogglesProps) {+export function StreamToggles({ streams, onToggle, disabled, compact }: StreamTogglesProps) {const toggles = [{id: 'microphone' as const,icon: Mic,label: 'Microphone',- description: 'Capture audio from your microphone',},{id: 'systemAudio' as const,icon: Volume2,label: 'System Audio',- description: 'Capture audio from your computer',},{id: 'screen' as const,icon: Monitor,label: 'Screen',- description: 'Capture your screen',},];return (- <Card>- <CardHeader className="pb-3">- <CardTitle className="text-base">Sources</CardTitle>- </CardHeader>- <CardContent className="space-y-4">- {toggles.map(({ id, icon: Icon, label, description }) => (- <div key={id} className="flex items-center justify-between gap-4">- <div className="flex items-center gap-3">- <div className="p-2 rounded-lg bg-muted">- <Icon className="h-4 w-4" />- </div>- <div>- <p className="text-sm font-medium">{label}</p>- <p className="text-xs text-muted-foreground">{description}</p>- </div>- </div>- <Switch- checked={streams[id]}- onCheckedChange={() => onToggle(id)}- disabled={disabled}- />- </div>- ))}- </CardContent>- </Card>+ <div className={cn('flex gap-3', compact ? 'flex-wrap justify-center' : 'flex-col sm:flex-row')}>+ {toggles.map(({ id, icon: Icon, label }) => {+ const isActive = streams[id];+ return (+ <button+ key={id}+ type="button"+ onClick={() => onToggle(id)}+ disabled={disabled}+ className={cn(+ 'flex items-center gap-2 px-4 py-2.5 rounded-full border-2 transition-all duration-200',+ 'focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2',+ 'disabled:opacity-50 disabled:cursor-not-allowed',+ isActive+ ? 'border-primary bg-primary/10 text-primary'+ : 'border-border bg-background text-muted-foreground hover:border-primary/50 hover:bg-muted/50'+ )}+ >+ <Icon className="h-4 w-4" />+ <span className="text-sm font-medium">{label}</span>+ {isActive && (+ <Check className="h-3.5 w-3.5 ml-1" />+ )}+ </button>+ );+ })}+ </div>);}diff --git a/src/renderer/components/recording/TopStatusBar.tsx b/src/renderer/components/recording/TopStatusBar.tsxindex 211b008..39db655 100644--- a/src/renderer/components/recording/TopStatusBar.tsx+++ b/src/renderer/components/recording/TopStatusBar.tsx@@ -17,32 +17,18 @@ import { useCopilotStore } from '../../stores/copilot.store';import { formatDuration, cn } from '../../lib/utils';export function TopStatusBar() {- const { status, elapsedTime, isRecording, isStopping, stopRecording, startRecording, isStarting } =+ const { status, elapsedTime, isRecording, isStopping, stopRecording } =useSession();const { metrics, healthScore, isCallActive } = useCopilotStore();const mePercent = metrics ? Math.round(metrics.talkRatio.me * 100) : 0;const themPercent = metrics ? Math.round(metrics.talkRatio.them * 100) : 0;+ // In idle state, show minimal status bar (MeetingSetupFlow handles recording start)if (!isRecording && status === 'idle') {return (- <div className="h-16 border-b bg-white/80 dark:bg-slate-900/80 backdrop-blur-lg flex items-center px-6 gap-6">- <div className="flex items-center gap-3">- <div className="flex items-center gap-2">- <Circle className="w-3 h-3 text-slate-400" />- <span className="text-2xl font-mono font-bold tracking-tight text-slate-400">0:00</span>- </div>- <Badge variant="secondary" className="text-xs">- READY- </Badge>- </div>-- <div className="flex-1" />-- <Button size="sm" className="gap-2" onClick={startRecording} disabled={isStarting}>- <Circle className="w-3 h-3 fill-current" />- Start Recording- </Button>+ <div className="h-14 border-b bg-white/80 dark:bg-slate-900/80 backdrop-blur-lg flex items-center justify-center px-6">+ <span className="text-sm text-muted-foreground">Prepare your meeting below</span></div>);}diff --git a/src/renderer/hooks/useSession.ts b/src/renderer/hooks/useSession.tsindex 4d6f3ad..cc94830 100644--- a/src/renderer/hooks/useSession.ts+++ b/src/renderer/hooks/useSession.ts@@ -4,8 +4,17 @@ import { useTranscriptionStore } from '../stores/transcription.store';import { useConfigStore } from '../stores/config.store';import { useCopilotStore } from '../stores/copilot.store';import { useMCPStore } from '../stores/mcp.store';+import { useMeetingSetupStore } from '../stores/meeting-setup.store';import { trpc } from '../api/trpc';import { getElectronAPI } from '../api/ipc';+import type { ProbingQuestion } from '../../shared/types/meeting-setup.types';++interface MeetingSetupData {+ name: string;+ description: string;+ questions: ProbingQuestion[];+ checklist: string[];+}export function useSession() {const sessionStore = useSessionStore();@@ -42,7 +51,7 @@ export function useSession() {};}, [sessionStore.status, sessionStore.startTime]);- const startRecording = useCallback(async () => {+ const startRecording = useCallback(async (meetingSetup?: MeetingSetupData) => {const api = getElectronAPI();if (!api) {sessionStore.setError('Electron API not available');@@ -102,8 +111,13 @@ export function useSession() {throw new Error(result.error || 'Failed to start recording');}+ // Start recording with meeting setup data if providedconst recordingResult = await startRecordingMutation.mutateAsync({sessionId: captureSession.sessionId,+ meetingName: meetingSetup?.name,+ meetingDescription: meetingSetup?.description,+ probingQuestions: meetingSetup?.questions,+ meetingChecklist: meetingSetup?.checklist,});if (transcriptionStore.enabled && (result.micWsConnectionId || result.sysAudioWsConnectionId)) {diff --git a/src/renderer/index.html b/src/renderer/index.htmlindex 13c3d46..64f2346 100644--- a/src/renderer/index.html+++ b/src/renderer/index.html@@ -5,7 +5,7 @@<meta name="viewport" content="width=device-width, initial-scale=1.0" /><metahttp-equiv="Content-Security-Policy"- content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' http://localhost:* https://*.trycloudflare.com https://fonts.googleapis.com https://fonts.gstatic.com; img-src 'self' data: https:;"+ content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' http://localhost:* https://*.trycloudflare.com https://fonts.googleapis.com https://fonts.gstatic.com; img-src 'self' data: https:; frame-src 'self' https://player.videodb.io;"/><title>Meeting Copilot</title></head>diff --git a/src/renderer/lib/utils.ts b/src/renderer/lib/utils.tsindex 2193df2..42ed60e 100644--- a/src/renderer/lib/utils.ts+++ b/src/renderer/lib/utils.ts@@ -16,6 +16,32 @@ export function formatDuration(seconds: number): string {return `${minutes}:${secs.toString().padStart(2, '0')}`;}+export function formatDate(date: Date | string): string {+ let dateStr = typeof date === 'string' ? date : date.toISOString();+ if (typeof date === 'string' && !date.endsWith('Z') && !date.includes('+') && !date.includes('-', 10)) {+ dateStr = date.replace(' ', 'T') + 'Z';+ }+ const d = new Date(dateStr);+ return d.toLocaleDateString('en-US', {+ month: 'short',+ day: 'numeric',+ year: 'numeric',+ });+}++export function formatDurationMinutes(seconds: number): string {+ const minutes = Math.round(seconds / 60);+ if (minutes < 60) {+ return `${minutes} min`;+ }+ const hours = Math.floor(minutes / 60);+ const remainingMins = minutes % 60;+ if (remainingMins === 0) {+ return `${hours} hr`;+ }+ return `${hours} hr ${remainingMins} min`;+}+export function formatRelativeTime(date: Date | string): string {const now = new Date();// SQLite datetime('now') returns UTC without timezone indicator (e.g., "2024-01-15 10:00:00")diff --git a/src/renderer/stores/meeting-setup.store.ts b/src/renderer/stores/meeting-setup.store.tsnew file mode 100644index 0000000..6edb481--- /dev/null+++ b/src/renderer/stores/meeting-setup.store.ts@@ -0,0 +1,93 @@+import { create } from 'zustand';+import type { ProbingQuestion } from '../../shared/types/meeting-setup.types';++export type MeetingSetupStep = 'sources' | 'info' | 'questions' | 'checklist' | 'ready';++interface MeetingSetupState {+ step: MeetingSetupStep;+ name: string;+ description: string;+ questions: ProbingQuestion[];+ checklist: string[];+ isGenerating: boolean;+ error: string | null;++ // Actions+ setStep: (step: MeetingSetupStep) => void;+ setInfo: (name: string, description: string) => void;+ setQuestions: (questions: ProbingQuestion[]) => void;+ setQuestionAnswer: (index: number, answer: string, customAnswer?: string) => void;+ setChecklist: (checklist: string[]) => void;+ setIsGenerating: (isGenerating: boolean) => void;+ setError: (error: string | null) => void;+ reset: () => void;++ // Computed helpers+ isSetupComplete: () => boolean;+ getMeetingSetupData: () => {+ name: string;+ description: string;+ questions: ProbingQuestion[];+ checklist: string[];+ };+}++const initialState = {+ step: 'sources' as MeetingSetupStep,+ name: '',+ description: '',+ questions: [] as ProbingQuestion[],+ checklist: [] as string[],+ isGenerating: false,+ error: null as string | null,+};++export const useMeetingSetupStore = create<MeetingSetupState>((set, get) => ({+ ...initialState,++ setStep: (step) => set({ step, error: null }),++ setInfo: (name, description) => set({ name, description }),++ setQuestions: (questions) => set({ questions }),++ setQuestionAnswer: (index, answer, customAnswer) => {+ const questions = [...get().questions];+ if (questions[index]) {+ questions[index] = {+ ...questions[index],+ answer,+ customAnswer,+ };+ set({ questions });+ }+ },++ setChecklist: (checklist) => set({ checklist }),++ setIsGenerating: (isGenerating) => set({ isGenerating }),++ setError: (error) => set({ error }),++ reset: () => set(initialState),++ isSetupComplete: () => {+ const state = get();+ return (+ state.name.trim().length > 0 &&+ state.description.trim().length > 0 &&+ state.questions.length > 0 &&+ state.checklist.length > 0+ );+ },++ getMeetingSetupData: () => {+ const state = get();+ return {+ name: state.name,+ description: state.description,+ questions: state.questions,+ checklist: state.checklist,+ };+ },+}));diff --git a/src/shared/schemas/recording.schema.ts b/src/shared/schemas/recording.schema.tsindex 1fdfed5..ec360ff 100644--- a/src/shared/schemas/recording.schema.ts+++ b/src/shared/schemas/recording.schema.ts@@ -3,10 +3,13 @@ import { z } from 'zod';export const RecordingStatusSchema = z.enum(['recording', 'processing', 'available', 'failed']);export const InsightsStatusSchema = z.enum(['pending', 'processing', 'ready', 'failed']);-export const CallSummarySchema = z.object({- summary: z.string(), // The complete meeting summary as markdown- generatedAt: z.number().optional(),-}).nullable();+// Key Points schema for structured meeting breakdown+export const KeyPointSchema = z.object({+ topic: z.string(),+ points: z.array(z.string()),+});++export const KeyPointsSchema = z.array(KeyPointSchema).nullable();export const PlaybookSnapshotSchema = z.object({playbookId: z.string(),@@ -51,9 +54,26 @@ export const MetricsSnapshotSchema = z.object({interruptionCount: z.number(),}).nullable();+// Meeting Setup schemas+export const ProbingQuestionSchema = z.object({+ question: z.string(),+ type: z.enum(['single-choice', 'multi-choice']),+ options: z.array(z.string()),+ answer: z.string(),+ customAnswer: z.string().optional(),+});++export const MeetingSetupSchema = z.object({+ name: z.string(),+ description: z.string(),+ questions: z.array(ProbingQuestionSchema),+ checklist: z.array(z.string()),+}).nullable();+export const RecordingSchema = z.object({id: z.number(),videoId: z.string().nullable(),+ collectionId: z.string().nullable(),streamUrl: z.string().nullable(),playerUrl: z.string().nullable(),sessionId: z.string(),@@ -63,13 +83,24 @@ export const RecordingSchema = z.object({insights: z.string().nullable(),insightsStatus: InsightsStatusSchema,// Copilot data- callSummary: CallSummarySchema.optional(),+ shortOverview: z.string().nullable().optional(),+ keyPoints: KeyPointsSchema.optional(),playbookSnapshot: PlaybookSnapshotSchema.optional(),metricsSnapshot: MetricsSnapshotSchema.optional(),+ // Meeting Setup data+ meetingName: z.string().nullable().optional(),+ meetingDescription: z.string().nullable().optional(),+ probingQuestions: z.array(ProbingQuestionSchema).nullable().optional(),+ meetingChecklist: z.array(z.string()).nullable().optional(),});export const CreateRecordingInputSchema = z.object({sessionId: z.string(),+ // Meeting Setup data+ meetingName: z.string().optional(),+ meetingDescription: z.string().optional(),+ probingQuestions: z.array(ProbingQuestionSchema).optional(),+ meetingChecklist: z.array(z.string()).optional(),});export const StopRecordingInputSchema = z.object({@@ -83,9 +114,12 @@ export const GetRecordingInputSchema = z.object({export type RecordingStatus = z.infer<typeof RecordingStatusSchema>;export type InsightsStatus = z.infer<typeof InsightsStatusSchema>;export type Recording = z.infer<typeof RecordingSchema>;-export type CallSummary = z.infer<typeof CallSummarySchema>;+export type KeyPoint = z.infer<typeof KeyPointSchema>;+export type KeyPoints = z.infer<typeof KeyPointsSchema>;export type PlaybookSnapshot = z.infer<typeof PlaybookSnapshotSchema>;export type MetricsSnapshot = z.infer<typeof MetricsSnapshotSchema>;+export type ProbingQuestion = z.infer<typeof ProbingQuestionSchema>;+export type MeetingSetup = z.infer<typeof MeetingSetupSchema>;export type CreateRecordingInput = z.infer<typeof CreateRecordingInputSchema>;export type StopRecordingInput = z.infer<typeof StopRecordingInputSchema>;export type GetRecordingInput = z.infer<typeof GetRecordingInputSchema>;diff --git a/src/shared/types/index.ts b/src/shared/types/index.tsindex 4aa11b8..4e058de 100644--- a/src/shared/types/index.ts+++ b/src/shared/types/index.ts@@ -1,2 +1,3 @@export * from './ipc.types';export * from './api.types';+export * from './meeting-setup.types';diff --git a/src/shared/types/ipc.types.ts b/src/shared/types/ipc.types.tsindex 7d57237..05f3e11 100644--- a/src/shared/types/ipc.types.ts+++ b/src/shared/types/ipc.types.ts@@ -133,8 +133,14 @@ export interface CopilotPlaybookSnapshot {recommendations: string[];}+export interface CopilotKeyPoint {+ topic: string;+ points: string[];+}+export interface CopilotCallSummary {- summary: string;+ shortOverview: string;+ keyPoints: CopilotKeyPoint[];generatedAt: number;}diff --git a/src/shared/types/meeting-setup.types.ts b/src/shared/types/meeting-setup.types.tsnew file mode 100644index 0000000..b916aba--- /dev/null+++ b/src/shared/types/meeting-setup.types.ts@@ -0,0 +1,37 @@+/**+ * Meeting Setup Types+ * Types for the multi-step meeting setup flow+ */++export interface ProbingQuestion {+ question: string;+ type: 'single-choice' | 'multi-choice';+ options: string[];+ answer: string; // comma-separated for multi-choice+ customAnswer?: string; // 5th "other" option for custom input+}++export interface MeetingSetup {+ name: string;+ description: string;+ questions: ProbingQuestion[];+ checklist: string[];+}++export interface MeetingSetupStep {+ step: 'sources' | 'info' | 'questions' | 'checklist' | 'ready';+}++// Response types for LLM calls+export interface ProbingQuestionsResponse {+ questions: Array<{+ question: string;+ type: 'single-choice' | 'multi-choice';+ options: string[];+ answer: string;+ }>;+}++export interface ChecklistResponse {+ checklist: string[];+}