diff --git a/apps/x/apps/renderer/src/hooks/useMeetingTranscription.ts b/apps/x/apps/renderer/src/hooks/useMeetingTranscription.ts index 75b4d91f..b47146ef 100644 --- a/apps/x/apps/renderer/src/hooks/useMeetingTranscription.ts +++ b/apps/x/apps/renderer/src/hooks/useMeetingTranscription.ts @@ -493,7 +493,16 @@ export function useMeetingTranscription(onAutoStop?: () => void) { const filename = calendarEvent?.summary ? calendarEvent.summary.replace(/[\\/*?:"<>|]/g, '').replace(/\s+/g, '_').substring(0, 100).trim() : `meeting-${timestamp}`; - const notePath = `knowledge/Meetings/rowboat/${dateFolder}/${filename}.md`; + let notePath = `knowledge/Meetings/rowboat/${dateFolder}/${filename}.md`; + // Title-derived names collide within a day — every ad-hoc detection is + // titled "Meeting", and recurring calendar events repeat their summary. + // Never overwrite an earlier meeting's note: suffix with the timestamp. + if (calendarEvent?.summary) { + try { + const { exists } = await window.ipc.invoke('workspace:exists', { path: notePath }); + if (exists) notePath = `knowledge/Meetings/rowboat/${dateFolder}/${filename}-${timestamp}.md`; + } catch { /* fall through with the unsuffixed path */ } + } notePathRef.current = notePath; calendarEventRef.current = calendarEvent;