Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Recording: taking notes for a meeting that left the calendar refreshes the agenda

Eric Brownroutd090fab19fba
diff --git a/app/src/renderer/src/components/StartRecording.tsx b/app/src/renderer/src/components/StartRecording.tsx
index 936248a7..33e08a1c 100644
--- a/app/src/renderer/src/components/StartRecording.tsx
+++ b/app/src/renderer/src/components/StartRecording.tsx
@@ -13,7 +13,7 @@ import { personName } from './People'
let lastRecording: boolean | undefined
/** A fresh recording from a library destination; main owns capture and opening the note. */
-export function StartRecording({ onStarted, testId = 'start-recording' }: { onStarted?: (id: string) => void; testId?: string }) {
+export function StartRecording({ onStarted, onGone, testId = 'start-recording' }: { onStarted?: (id: string) => void; onGone?: () => void; testId?: string }) {
const [actions, setActions] = useState<HTMLElement | null>(null)
const [recording, setRecording] = useState(lastRecording)
const [starting, setStarting] = useState(false)
@@ -60,7 +60,7 @@ export function StartRecording({ onStarted, testId = 'start-recording' }: { onSt
try {
const result = await window.yogurt.meetings.start(eventId)
if ('error' in result) {
- if (result.error === 'gone') { setEvents([]); void load() }
+ if (result.error === 'gone') { setEvents([]); void load(); onGone?.() }
toasts.add({ id: 'start-recording-message', data: { testId: 'start-recording-message' }, title: result.error === 'gone' ? t('That meeting is no longer on your calendar.') : t("Yogurt couldn't start the notes. Try again in a moment.") })
return
}
diff --git a/app/src/renderer/src/screens/Home.tsx b/app/src/renderer/src/screens/Home.tsx
index 06a04470..8e700cb7 100644
--- a/app/src/renderer/src/screens/Home.tsx
+++ b/app/src/renderer/src/screens/Home.tsx
@@ -38,7 +38,7 @@ export function Home({ open, openFolder }: { open: (id: string) => void; openFol
const noMeetings = past.cards?.length === 0
const calendar = window.yogurt.capabilities.calendar
return <div data-testid="home" className={calendar ? 'native-home' : 'native-home no-agenda'}>
- <StartRecording testId="new-note" />
+ <StartRecording testId="new-note" onGone={() => setCalendarRevision(revision => revision + 1)} />
<div className="native-library" ref={past.setRoot} tabIndex={-1}>
<h1>{t('Your meetings')}</h1>
<LoadingContent pending={!past.cards} testId="meetings-loading" skeleton={<MeetingListLoading />} className="library-load">{noMeetings ? <section data-testid="past-empty" className="library-empty empty-state"><div className="empty-state-content">
diff --git a/app/test/startRecordingActions.test.ts b/app/test/startRecordingActions.test.ts
index b4e74aa3..32aa5cad 100644
--- a/app/test/startRecordingActions.test.ts
+++ b/app/test/startRecordingActions.test.ts
@@ -30,13 +30,14 @@ const event = (id: string, start = now - 60_000, end = now + 30 * 60_000): Agend
const start = vi.fn()
const day = vi.fn()
const started = vi.fn()
+const gone = vi.fn()
let calendarChanged: () => void
let widgetChanged: (view: WidgetView | null) => void
let cleanups: (() => void)[]
const flush = async () => { await Promise.resolve(); await Promise.resolve() }
const render = () => {
hooks.state = 0; hooks.ref = 0; hooks.effects = []; hooks.layout = []
- return StartRecording({ onStarted: started }) as ReactElement<Record<string, unknown>> | null
+ return StartRecording({ onStarted: started, onGone: gone }) as ReactElement<Record<string, unknown>> | null
}
const run = (effect: () => (() => void) | void) => { const cleanup = effect(); if (cleanup) cleanups.push(cleanup) }
type Element = ReactElement<Record<string, unknown>>
@@ -160,6 +161,7 @@ it('reports a removed event, refreshes choices, and never reports a failed or ra
day.mockResolvedValue({ status: 'granted', events: [] })
await click(find(tree, 'start-recording'))
expect(toasts.add).toHaveBeenLastCalledWith(expect.objectContaining({ title: 'That meeting is no longer on your calendar.' }))
+ expect(gone).toHaveBeenCalledOnce()
expect(find(render(), 'recording-choices')).toBeUndefined()
expect(started).not.toHaveBeenCalled()
start.mockResolvedValueOnce({ id: 'existing', alreadyRecording: true })
@@ -169,4 +171,5 @@ it('reports a removed event, refreshes choices, and never reports a failed or ra
await click(find(render(), 'start-recording'))
expect(toasts.add).toHaveBeenLastCalledWith(expect.objectContaining({ title: "Yogurt couldn't start the notes. Try again in a moment." }))
expect(find(render(), 'start-recording').props.disabled).toBe(false)
+ expect(gone).toHaveBeenCalledOnce()
})