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: Take notes for a meeting that already has notes resumes them instead of starting a new note

Eric Brownrout26c7e1bc37be
diff --git a/app/e2e/startRecording.spec.ts b/app/e2e/startRecording.spec.ts
index fccbb49d..15efccb3 100644
--- a/app/e2e/startRecording.spec.ts
+++ b/app/e2e/startRecording.spec.ts
@@ -27,6 +27,69 @@ const stop = async (page: Page) => {
await expect(page.getByTestId('note-state')).not.toHaveAttribute('data-state', 'recording')
}
+test('a live event resumes the same note from the title bar and menu, keeping the edited-summary safeguard', async () => {
+ test.setTimeout(90_000)
+ const { app, page } = await launch()
+ try {
+ const now = await page.evaluate(() => { const date = new Date(); date.setHours(12, 0, 0, 0); return +date })
+ await page.clock.setFixedTime(now)
+ await app.evaluate(async (_e, now) => {
+ const fake = (globalThis as unknown as { __fake__: { advance(ms: number): Promise<void>; calendarEvents(events: unknown[]): void } }).__fake__
+ await fake.advance(now - Date.now())
+ fake.calendarEvents([{ id: 'resume-event', title: 'Resume fixture', start: new Date(now - 60_000).toISOString(), end: new Date(now + 30 * 60_000).toISOString(), attendees: [] }])
+ }, now)
+ await page.reload()
+ await expect(page.getByTestId('new-note')).toHaveText('Take notes · Resume fixture')
+ await page.getByTestId('new-note').click()
+ await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording')
+ const id = await meetingId(page)
+ await expect.poll(() => page.evaluate(id => window.yogurt.transcript.get(id).then(lines => lines.length), id), { timeout: 20_000 }).toBeGreaterThan(0)
+ await app.evaluate(() => { process.env.YOGURT_FAKE_LLM_MS = '120' })
+ await stop(page)
+ await expect.poll(() => page.evaluate(id => window.yogurt.notes.get(id).then(notes => notes.status), id)).toBe('writing')
+ const prior = await page.evaluate(id => window.yogurt.transcript.get(id), id)
+ await page.getByTestId('nav-home').click()
+ await expect(page.getByTestId('new-note')).toHaveText('Resume notes · Resume fixture')
+ await page.getByTestId('new-note').click()
+ await expect(page.getByTestId('note-resume')).toBeDisabled()
+ await expect(page.getByTestId('note-state')).not.toHaveAttribute('data-state', 'recording')
+ await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording', { timeout: 30_000 })
+ await app.evaluate(() => { process.env.YOGURT_FAKE_LLM_MS = '1' })
+ expect(await meetingId(page)).toBe(id)
+ await expect(page.getByTestId('resume-confirm')).toHaveCount(0)
+ await expect(page.getByTestId('note-notes-tab')).toHaveAttribute('aria-selected', 'true')
+ const continued = await page.evaluate(id => window.yogurt.transcript.get(id), id)
+ for (const line of prior) expect(continued.find(next => next.id === line.id)).toEqual(line)
+ expect(await page.evaluate(() => window.yogurt.meetings.cards({ limit: 10 }))).toHaveLength(1)
+
+ await page.getByTestId('note-notes-tab').click()
+ await page.getByRole('textbox', { name: 'My notes', exact: true }).fill('Keep this earlier decision.')
+ await stop(page)
+ await expect(page.getByTestId('note-resume')).toBeEnabled({ timeout: 30_000 })
+ await page.getByTestId('note-summary-tab').click()
+ await page.getByRole('textbox', { name: 'Summary', exact: true }).fill('Keep this edited summary until confirmation.')
+ await page.getByTestId('nav-home').click()
+ await page.getByTestId('recording-choices').click()
+ const row = page.getByTestId('recording-meeting')
+ await expect(row).toContainText('Resume notes · Resume fixture')
+ await row.click()
+ await expect(page.getByTestId('resume-confirm')).toBeVisible()
+ expect(await meetingId(page)).toBe(id)
+ await page.getByTestId('resume-cancel').click()
+ await expect(page.getByTestId('note-state')).not.toHaveAttribute('data-state', 'recording')
+ // The Summary editor keeps its heading block, so the saved text may start with markdown.
+ expect((await page.evaluate(id => window.yogurt.notes.get(id), id)).enhanced).toContain('Keep this edited summary until confirmation.')
+ await page.getByTestId('nav-home').click()
+ await page.getByTestId('new-note').click()
+ await page.getByTestId('resume-yes').click()
+ await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording')
+ await expect(page.getByTestId('note-notes-tab')).toHaveAttribute('aria-selected', 'true')
+ await expect(page.getByRole('textbox', { name: 'My notes', exact: true })).toHaveText('Keep this earlier decision.')
+ expect(await meetingId(page)).toBe(id)
+ expect(await page.evaluate(() => window.yogurt.meetings.cards({ limit: 10 }))).toHaveLength(1)
+ } finally { await app.close() }
+})
+
test('a folder starts recording immediately and only files the note after a successful confirmation', async () => {
const { app, page } = await launch()
try {
diff --git a/app/src/main/index.ts b/app/src/main/index.ts
index b02068f8..d1377547 100644
--- a/app/src/main/index.ts
+++ b/app/src/main/index.ts
@@ -8,6 +8,7 @@ import { closeAction, keepMainWindow } from './mainWindow'
import { titleBarOverlay, windowChrome } from './windowChrome'
import { x11Relaunch } from './display'
import { isAppRoute } from '../shared/routes'
+import { resumesNote } from '../shared/agendaNote'
import { relaunchOptions, stripAppImageEnv } from './relaunch'
import { capabilities, micListHelper, platformOf, supportedKinds } from '../shared/platform'
import { app, BrowserWindow, dialog, ipcMain, nativeTheme, Notification, protocol, shell } from 'electron'
@@ -150,7 +151,7 @@ function createWindow() {
win.on('restore', visibilityChanged)
win.on('closed', () => { win = undefined; visibilityChanged() })
// a page still loading misses a go-to sent to it: tell it again once it is up
- win.webContents.on('did-finish-load', () => { if (route) win?.webContents.send('nav:go', route) })
+ win.webContents.on('did-finish-load', () => { if (route) win?.webContents.send('nav:go', route, resumeRequested) })
presentMain()
}
@@ -215,16 +216,18 @@ function showMain() {
/** Where the app was last told to go (e.g. /note/<id>); the window asks for it when it opens */
let route = ''
+let resumeRequested = false
let pendingAsk = false
function askFromMenu() {
pendingAsk = true
showMain()
win?.webContents.send('nav:ask')
}
-function goTo(next: string) {
+function goTo(next: string, resume = false) {
route = next
+ resumeRequested = resume
if (!win) createWindow()
- win?.webContents.send('nav:go', route)
+ win?.webContents.send('nav:go', route, resumeRequested)
presented++
// The card and widget never take focus, so their explicit navigation brings Yogurt forward.
presentMain(true)
@@ -318,9 +321,11 @@ function startDetection() {
sendWidgetTranscript = widget.transcript
/** The one way notes start: the card's Take notes, and home's Start notes and New note. Opens the note. */
function begin(p: { title: string; event: CalEvent | null; app: string | null }) {
+ const alreadyRecording = !!activeMeeting()
const m = startMeeting(p)
- prompts.hide(); watcher.cleared(); goTo(`/note/${m.id}`)
- return m.id
+ const resume = resumesNote(m)
+ prompts.hide(); watcher.cleared(); goTo(`/note/${m.id}`, resume)
+ return { id: m.id, ...(resume ? { resumeRequested: true as const } : {}), ...(alreadyRecording ? { alreadyRecording: true as const } : {}) }
}
// home: Start notes for a calendar event (looked up here, never taken from the page), or New note with none
// gone: the event left the calendar since the page showed it (moved, cancelled); failed: anything else, in plain words on the page
@@ -333,7 +338,7 @@ function startDetection() {
event = (await comingUp()).find((e) => matchesEvent(e, eventId)) ?? null
if (!event) return { error: 'gone' }
}
- return { id: begin({ title: event?.title ?? '', event, app: null }) }
+ return begin({ title: event?.title ?? '', event, app: null })
} catch (e) {
console.error('start notes failed', e)
return { error: 'failed' }
@@ -949,6 +954,7 @@ app.whenReady().then(() => {
ipcMain.on('nav:go', (_e, r: unknown) => {
if (!isAppRoute(r)) return
route = r
+ resumeRequested = false
win?.webContents.send('nav:go', route)
})
ipcMain.handle('nav:current', () => route)
diff --git a/app/src/main/meeting.ts b/app/src/main/meeting.ts
index 455997ed..67b9ac41 100644
--- a/app/src/main/meeting.ts
+++ b/app/src/main/meeting.ts
@@ -55,8 +55,10 @@ export const withStopState = <T extends Meeting>(m: T): T => {
export function startMeeting(p: { title: string; event: CalEvent | null; app: string | null }): Meeting {
if (!store) throw new Error('Meetings are not ready yet')
if (active) return active
- const prepared = p.event && eventIds(p.event).map((id) => store!.meetingForEvent(id)).find(Boolean)
- if (prepared?.state === 'prepared') return startPreparedMeeting(prepared.id, p.app)!
+ const existing = p.event && eventIds(p.event).map((id) => store!.meetingForEvent(id)).find(Boolean)
+ if (existing?.state === 'prepared') return startPreparedMeeting(existing.id, p.app)!
+ // Finished notes open their guarded Resume action before capture can append to them.
+ if (existing) return withStopState(existing)
const title = p.title || t('Meeting')
const m = store.createMeeting({
title, titleSource: sourceOf(title, p.event?.id ?? null), startedAt: Date.now(), endedAt: null, eventId: p.event?.id ?? null,
diff --git a/app/src/preload/index.ts b/app/src/preload/index.ts
index 6cd23a18..b66358f5 100644
--- a/app/src/preload/index.ts
+++ b/app/src/preload/index.ts
@@ -268,7 +268,7 @@ const api: YogurtApi = {
go: (r) => { ipcRenderer.send('nav:go', r) },
current: () => ipcRenderer.invoke('nav:current'),
onGo: (cb) => {
- const on = (_e: unknown, r: string) => cb(r)
+ const on = (_e: unknown, r: string, resumeRequested?: boolean) => cb(r, resumeRequested)
ipcRenderer.on('nav:go', on)
return () => { ipcRenderer.removeListener('nav:go', on) }
},
diff --git a/app/src/renderer/src/App.tsx b/app/src/renderer/src/App.tsx
index dcca3b87..41bd99f4 100644
--- a/app/src/renderer/src/App.tsx
+++ b/app/src/renderer/src/App.tsx
@@ -42,6 +42,7 @@ export function App() {
// where the app was told to go, e.g. /note/<id>
const [route, setRouteNow] = useState('')
const [agendaJump, setAgendaJump] = useState<{ at: number }>()
+ const [resumeRequested, setResumeRequested] = useState(false)
const [meeting, setMeeting] = useState<Pick<MeetingView, 'id' | 'title'>>()
/** Back and forward keep the same note routes; a new destination starts a new branch. */
const history = useRef<string[]>([])
@@ -51,6 +52,7 @@ export function App() {
const setRoute = (r: string, agendaDate?: number) => {
// A fresh request lets the same date reset a day changed with the arrows.
setAgendaJump(agendaDate === undefined ? undefined : { at: agendaDate })
+ setResumeRequested(false)
rememberScrollPositions()
if (r !== routeRef.current) { history.current = [...history.current, routeRef.current].slice(-50); future.current = [] }
routeRef.current = r
@@ -62,6 +64,7 @@ export function App() {
const prev = history.current.pop()
if (prev === undefined) return
setAgendaJump(undefined)
+ setResumeRequested(false)
rememberScrollPositions()
future.current.push(routeRef.current)
routeRef.current = prev; setRouteNow(prev); rememberRoute(prev)
@@ -70,6 +73,7 @@ export function App() {
const next = future.current.pop()
if (next === undefined) return
setAgendaJump(undefined)
+ setResumeRequested(false)
rememberScrollPositions()
history.current.push(routeRef.current)
routeRef.current = next; setRouteNow(next); rememberRoute(next)
@@ -77,11 +81,12 @@ export function App() {
useEffect(() => {
// a go-to that arrives while the first ask is on its way wins over the older answer
let told = false
- const off = window.yogurt.nav.onGo((r) => {
+ const off = window.yogurt.nav.onGo((r, resume) => {
told = true
// Main echoes our moves for persistence; delayed echoes must not create new history entries.
if (echoes.current[0] === r) { echoes.current.shift(); return }
setRoute(r)
+ setResumeRequested(!!resume)
})
void window.yogurt.nav.current().then((r) => { if (!told) { routeRef.current = r; setRouteNow(r) } })
return off
@@ -186,6 +191,7 @@ export function App() {
// a folder's page waits for the list; a folder that is gone shows Meetings
const folderScreen = folderId && (folder ? <Folder key={folder.id} folder={folder} open={open} onStarted={(id) => setSuggestedFolders((current) => ({ ...current, [id]: folder.id }))} /> : !folders ? <div className="native-folder"><StartRecording /><div className="native-library"><LoadingContent pending testId="meetings-loading" skeleton={<><div className="folder-page-heading"><h1><span className="loading-bar" style={{ width: 140 }} /></h1></div><MeetingListLoading showFolders={false} /></>} /></div></div> : null)
const screen = settings ? <Settings revision={settingsRevision} focus={route.startsWith('/settings/') ? route.slice('/settings/'.length) : undefined} /> : noteId ? <Note key={noteId} id={noteId} onSource={openSource} onTitleChange={setMeeting} at={jump?.id === noteId ? jump : undefined}
+ onResumeRequested={resumeRequested ? () => { setResumeRequested(false); rememberRoute(route) } : undefined}
folderSuggestion={suggestedFolder ? { folder: suggestedFolder, dismiss: () => dismissFolderSuggestion(noteId) } : undefined} />
: chatId !== undefined ? <ChatPage id={chatId} go={go} openSource={openSource} />
: trash ? <Trash open={open} /> : folderScreen || <Home open={open} openFolder={(id) => go(`/folder/${id}`)} agendaJump={agendaJump} />
diff --git a/app/src/renderer/src/components/StartRecording.tsx b/app/src/renderer/src/components/StartRecording.tsx
index 33e08a1c..c789555d 100644
--- a/app/src/renderer/src/components/StartRecording.tsx
+++ b/app/src/renderer/src/components/StartRecording.tsx
@@ -1,10 +1,11 @@
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'
import { createPortal } from 'react-dom'
import { Menu } from '@base-ui/react/menu'
-import { ChevronDown } from 'lucide-react'
+import { ChevronDown, RotateCcw } from 'lucide-react'
import { Mic } from './Icons'
import { toasts } from './TrashToast'
import { t } from '../../../shared/i18n'
+import { resumesNote } from '../../../shared/agendaNote'
import type { AgendaEvent } from '../../../shared/types'
import { eventPhase, recordingChoices } from '../agenda'
import { useDay } from '../dates'
@@ -12,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. */
+/** Start or resume from a library destination; main resolves the event's note. */
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)
@@ -37,8 +38,9 @@ export function StartRecording({ onStarted, onGone, testId = 'start-recording' }
const refresh = () => { setNow(Date.now()); void load() }
const timer = setInterval(refresh, 60_000)
const off = window.yogurt.calendar.onChange(() => { setEvents([]); refresh() })
+ const offMeetings = window.yogurt.meetings.onChange(refresh)
window.addEventListener('focus', refresh)
- return () => { seq.current++; off(); clearInterval(timer); window.removeEventListener('focus', refresh) }
+ return () => { seq.current++; off(); offMeetings(); clearInterval(timer); window.removeEventListener('focus', refresh) }
}, [load, today])
useEffect(() => {
// Switch at the live/soon boundaries, even between calendar refreshes.
@@ -64,7 +66,7 @@ export function StartRecording({ onStarted, onGone, testId = 'start-recording' }
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
}
- if (!result.alreadyRecording) onStarted?.(result.id)
+ if (!result.alreadyRecording && !result.resumeRequested) onStarted?.(result.id)
} catch {
toasts.add({ id: 'start-recording-message', data: { testId: 'start-recording-message' }, title: t("Yogurt couldn't start the notes. Try again in a moment.") })
} finally { setStarting(false) }
@@ -73,9 +75,11 @@ export function StartRecording({ onStarted, onGone, testId = 'start-recording' }
useEffect(() => { if (recording !== false || !choices.length) setOpen(false) }, [recording, choices.length])
if (recording !== false || !actions) return null
const live = choices.filter(event => eventPhase(event, now) === 'live')
- const label = live.length === 1 ? t('Take notes · {title}', { title: live[0].title || t('Meeting') })
+ const title = live[0]?.title || t('Meeting')
+ const resuming = live.length === 1 && resumesNote(live[0].note)
+ const label = live.length === 1 ? resuming ? t('Resume notes · {title}', { title }) : t('Take notes · {title}', { title })
: live.length > 1 ? t('Take notes · {count} now', { count: live.length }) : t('Start recording')
- const content = <><Mic size={14} aria-hidden="true" /><span className="recording-label">{label}</span></>
+ const content = <>{resuming ? <RotateCcw size={14} aria-hidden="true" /> : <Mic size={14} aria-hidden="true" />}<span className="recording-label">{label}</span></>
const button = { 'data-testid': testId, disabled: starting, title: label, className: 'workspace-button primary recording-main no-drag' }
return createPortal(<Menu.Root modal={false} open={open && choices.length > 0} onOpenChange={setOpen}>
<div ref={root} className="recording-split no-drag" data-split={choices.length > 0}>
@@ -86,10 +90,15 @@ export function StartRecording({ onStarted, onGone, testId = 'start-recording' }
{choices.length > 0 && <Menu.Portal>
<Menu.Positioner anchor={root} side="bottom" align="end" sideOffset={8} className="ask-menu-positioner">
<Menu.Popup className="menu-entry ask-actions-menu recording-menu" aria-label={t('Start recording')} onKeyDown={e => { if (e.key === 'Escape') e.stopPropagation() }}>
- {choices.map(event => <Menu.Item key={event.id} data-testid="recording-meeting" label={event.title || t('Meeting')} disabled={starting} onClick={() => void start(event.id)}>
- <span className="recording-meeting-copy"><span title={event.title || t('Meeting')}>{event.title || t('Meeting')}</span>{event.attendees.length > 0 && <small>{event.attendees.map(person => personName(person.name)).join(', ')}</small>}</span>
- <span className="recording-timing">{eventPhase(event, now) === 'live' ? t('Now') : t('in {count} min', { count: Math.ceil((event.start - now) / 60_000) })}</span>
- </Menu.Item>)}
+ {choices.map(event => {
+ const resume = resumesNote(event.note), title = event.title || t('Meeting')
+ const label = resume ? t('Resume notes · {title}', { title }) : title
+ return <Menu.Item key={event.id} data-testid="recording-meeting" label={title} disabled={starting} onClick={() => void start(event.id)}>
+ {resume ? <RotateCcw size={14} aria-hidden="true" /> : <Mic size={14} aria-hidden="true" />}
+ <span className="recording-meeting-copy"><span title={label}>{label}</span>{event.attendees.length > 0 && <small>{event.attendees.map(person => personName(person.name)).join(', ')}</small>}</span>
+ <span className="recording-timing">{eventPhase(event, now) === 'live' ? t('Now') : t('in {count} min', { count: Math.ceil((event.start - now) / 60_000) })}</span>
+ </Menu.Item>
+ })}
<Menu.Separator className="recording-menu-separator" />
<Menu.Item data-testid="recording-unattached" disabled={starting} onClick={() => void start(null)}><Mic size={14} aria-hidden="true" />{t('Start recording')}</Menu.Item>
</Menu.Popup>
diff --git a/app/src/renderer/src/screens/Note.tsx b/app/src/renderer/src/screens/Note.tsx
index c7d481ad..9297a9bf 100644
--- a/app/src/renderer/src/screens/Note.tsx
+++ b/app/src/renderer/src/screens/Note.tsx
@@ -52,12 +52,13 @@ function useAutosave(id: string, side: NoteSide, text: string, saved?: NoteSaveR
const readingViews = new Map<string, { primary: 'transcript' | 'notes'; view: 'mine' | 'enhanced' }>()
/** A meeting keeps its reading tab when revisited; an explicit source or recording action can still switch it. */
-export function Note({ id, onTitleChange, at, folderSuggestion, onSource }: {
+export function Note({ id, onTitleChange, at, folderSuggestion, onSource, onResumeRequested }: {
onSource: (s: LibrarySource, match?: string) => void
id: string; onTitleChange: (meeting: Pick<MeetingView, 'id' | 'title'>) => void
/** A citation target: null ms selects notes; seq identifies each Open action. */
at?: { ms: number | null; match?: string; seq: number }
folderSuggestion?: FolderSuggestion
+ onResumeRequested?: () => void
}) {
const [m, setM] = useState<MeetingView>()
const [footer, setFooter] = useState<HTMLElement | null>(null)
@@ -211,9 +212,18 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource }: {
return () => resize.disconnect()
}, [primary, view, m?.state, notes?.status])
+ const summarizing = finishing || notes?.status === 'waiting' || notes?.status === 'writing'
+ const resumeHandled = useRef(false)
+ useEffect(() => {
+ if (!onResumeRequested) { resumeHandled.current = false; return }
+ if (resumeHandled.current || !m || !notes || summarizing || starting || m.stopSavePending) return
+ resumeHandled.current = true
+ onResumeRequested()
+ if (m.trashedAt == null && !m.stopSavePending && (m.state === 'stopped' || m.state === 'done')) void resumeRecording()
+ }, [onResumeRequested, m, notes, summarizing, starting])
+
if (!m || !notes) return <LoadingContent pending skeleton={<Loading layout="note" />} className="loading-note-frame" />
const recording = m.state === 'recording'
- const summarizing = finishing || notes.status === 'waiting' || notes.status === 'writing'
/** in the Trash: it can be read and restored, not recorded into */
const trashed = m.trashedAt != null
const minutes = m.endedAt ? Math.max(1, Math.round((m.durationMs ?? (m.endedAt - m.startedAt)) / 60_000)) : null
@@ -276,7 +286,7 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource }: {
if (!await saveAll()) return
const result = await window.yogurt.meetings.resume(id)
if ('error' in result) setResumeFailed(true)
- else { picked.current = false; setPrimary('notes'); setView('mine'); setEditedHere(false) }
+ else { picked.current = false; requestFinish(false); setPrimary('notes'); setView('mine'); setEditedHere(false) }
} catch { setResumeFailed(true) }
finally { setStarting(false) }
}
diff --git a/app/src/shared/agendaNote.ts b/app/src/shared/agendaNote.ts
index 9e37fd33..f8614b65 100644
--- a/app/src/shared/agendaNote.ts
+++ b/app/src/shared/agendaNote.ts
@@ -1,5 +1,7 @@
import type { AgendaEvent, MeetingCard } from './types'
+export const resumesNote = (note: AgendaEvent['note']): boolean => note?.state === 'stopped' || note?.state === 'done'
+
export function agendaNoteAction(event: AgendaEvent, recording: MeetingCard | undefined, now: number): 'start' | 'open' | 'prepare' | null {
const note = recording?.eventId === event.id ? recording : event.note
const meeting = event.attendees.length > 0 || !!event.url?.trim() // EventKit already excludes the owner.
diff --git a/app/src/shared/locales/ar.json b/app/src/shared/locales/ar.json
index f8980c0f..b9707f28 100644
--- a/app/src/shared/locales/ar.json
+++ b/app/src/shared/locales/ar.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "انتقل إلى {date}",
+ "Resume notes · {title}": "متابعة تدوين الملاحظات · {title}",
"Take notes · {title}": "تدوين الملاحظات · {title}",
"Take notes · {count} now": "تدوين الملاحظات · {count} الآن",
"Now": "الآن",
diff --git a/app/src/shared/locales/bn.json b/app/src/shared/locales/bn.json
index 3b9983a3..2ecc93af 100644
--- a/app/src/shared/locales/bn.json
+++ b/app/src/shared/locales/bn.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "{date} তারিখে যান",
+ "Resume notes · {title}": "নোট নেওয়া চালিয়ে যান · {title}",
"Take notes · {title}": "নোট নিন · {title}",
"Take notes · {count} now": "নোট নিন · এখন {count}টি",
"Now": "এখন",
diff --git a/app/src/shared/locales/cs.json b/app/src/shared/locales/cs.json
index 4360fcc4..efcec2c2 100644
--- a/app/src/shared/locales/cs.json
+++ b/app/src/shared/locales/cs.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Přejít na {date}",
+ "Resume notes · {title}": "Pokračovat v poznámkách · {title}",
"Take notes · {title}": "Dělat poznámky · {title}",
"Take notes · {count} now": "Dělat poznámky · {count} právě teď",
"Now": "Nyní",
diff --git a/app/src/shared/locales/da.json b/app/src/shared/locales/da.json
index b86647e4..d8127fe5 100644
--- a/app/src/shared/locales/da.json
+++ b/app/src/shared/locales/da.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Gå til {date}",
+ "Resume notes · {title}": "Fortsæt noter · {title}",
"Take notes · {title}": "Tag noter · {title}",
"Take notes · {count} now": "Tag noter · {count} nu",
"Now": "Nu",
diff --git a/app/src/shared/locales/de.json b/app/src/shared/locales/de.json
index e0346e8b..964cb301 100644
--- a/app/src/shared/locales/de.json
+++ b/app/src/shared/locales/de.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Zum {date} springen",
+ "Resume notes · {title}": "Notizen fortsetzen · {title}",
"Take notes · {title}": "Notizen machen · {title}",
"Take notes · {count} now": "Notizen machen · {count} laufen",
"Now": "Jetzt",
diff --git a/app/src/shared/locales/el.json b/app/src/shared/locales/el.json
index 5c1001dd..9f037530 100644
--- a/app/src/shared/locales/el.json
+++ b/app/src/shared/locales/el.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Μετάβαση στις {date}",
+ "Resume notes · {title}": "Συνέχιση σημειώσεων · {title}",
"Take notes · {title}": "Κράτηση σημειώσεων · {title}",
"Take notes · {count} now": "Κράτηση σημειώσεων · {count} τώρα",
"Now": "Τώρα",
diff --git a/app/src/shared/locales/en.json b/app/src/shared/locales/en.json
index 9b74653d..423db7db 100644
--- a/app/src/shared/locales/en.json
+++ b/app/src/shared/locales/en.json
@@ -2,6 +2,7 @@
"Go to {date}": "Go to {date}",
"Previous day": "Previous day",
"Next day": "Next day",
+ "Resume notes · {title}": "Resume notes · {title}",
"Take notes · {title}": "Take notes · {title}",
"Take notes · {count} now": {
"one": "Take notes · {count} now",
diff --git a/app/src/shared/locales/es.json b/app/src/shared/locales/es.json
index fdc4834e..621c45b5 100644
--- a/app/src/shared/locales/es.json
+++ b/app/src/shared/locales/es.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Ir al {date}",
+ "Resume notes · {title}": "Continuar tomando notas · {title}",
"Take notes · {title}": "Tomar notas · {title}",
"Take notes · {count} now": "Tomar notas · {count} ahora",
"Now": "Ahora",
diff --git a/app/src/shared/locales/fi.json b/app/src/shared/locales/fi.json
index 0921712b..4687619c 100644
--- a/app/src/shared/locales/fi.json
+++ b/app/src/shared/locales/fi.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Siirry päivään {date}",
+ "Resume notes · {title}": "Jatka muistiinpanoja · {title}",
"Take notes · {title}": "Tee muistiinpanoja · {title}",
"Take notes · {count} now": "Tee muistiinpanoja · {count} käynnissä",
"Now": "Nyt",
diff --git a/app/src/shared/locales/fil.json b/app/src/shared/locales/fil.json
index ae00a41c..fd6d604c 100644
--- a/app/src/shared/locales/fil.json
+++ b/app/src/shared/locales/fil.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Pumunta sa {date}",
+ "Resume notes · {title}": "Ipagpatuloy ang mga tala · {title}",
"Take notes · {title}": "Mag-note · {title}",
"Take notes · {count} now": "Mag-note · {count} ngayon",
"Now": "Ngayon",
diff --git a/app/src/shared/locales/fr.json b/app/src/shared/locales/fr.json
index 320e47de..149baab5 100644
--- a/app/src/shared/locales/fr.json
+++ b/app/src/shared/locales/fr.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Aller au {date}",
+ "Resume notes · {title}": "Reprendre les notes · {title}",
"Take notes · {title}": "Prendre des notes · {title}",
"Take notes · {count} now": "Prendre des notes · {count} en cours",
"Now": "En cours",
diff --git a/app/src/shared/locales/he.json b/app/src/shared/locales/he.json
index 4ba188a9..8975852b 100644
--- a/app/src/shared/locales/he.json
+++ b/app/src/shared/locales/he.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "מעבר אל {date}",
+ "Resume notes · {title}": "המשך כתיבת הערות · {title}",
"Take notes · {title}": "רישום הערות · {title}",
"Take notes · {count} now": "רישום הערות · {count} עכשיו",
"Now": "עכשיו",
diff --git a/app/src/shared/locales/hi.json b/app/src/shared/locales/hi.json
index b75570ed..b9bfe7b5 100644
--- a/app/src/shared/locales/hi.json
+++ b/app/src/shared/locales/hi.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "{date} पर जाएँ",
+ "Resume notes · {title}": "नोट्स लेना जारी रखें · {title}",
"Take notes · {title}": "नोट्स लें · {title}",
"Take notes · {count} now": "नोट्स लें · अभी {count}",
"Now": "अभी",
diff --git a/app/src/shared/locales/hu.json b/app/src/shared/locales/hu.json
index e38a0750..c312300e 100644
--- a/app/src/shared/locales/hu.json
+++ b/app/src/shared/locales/hu.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Ugrás erre a napra: {date}",
+ "Resume notes · {title}": "Jegyzetelés folytatása · {title}",
"Take notes · {title}": "Jegyzetelés · {title}",
"Take notes · {count} now": "Jegyzetelés · most {count}",
"Now": "Most",
diff --git a/app/src/shared/locales/id.json b/app/src/shared/locales/id.json
index 82510c9e..55d1699d 100644
--- a/app/src/shared/locales/id.json
+++ b/app/src/shared/locales/id.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Buka tanggal {date}",
+ "Resume notes · {title}": "Lanjutkan catatan · {title}",
"Take notes · {title}": "Catat · {title}",
"Take notes · {count} now": "Catat · {count} sekarang",
"Now": "Sekarang",
diff --git a/app/src/shared/locales/it.json b/app/src/shared/locales/it.json
index bcdbaf95..ded08707 100644
--- a/app/src/shared/locales/it.json
+++ b/app/src/shared/locales/it.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Vai al {date}",
+ "Resume notes · {title}": "Riprendi gli appunti · {title}",
"Take notes · {title}": "Prendi appunti · {title}",
"Take notes · {count} now": "Prendi appunti · {count} in corso",
"Now": "In corso",
diff --git a/app/src/shared/locales/ja.json b/app/src/shared/locales/ja.json
index 1bca3168..92b9561d 100644
--- a/app/src/shared/locales/ja.json
+++ b/app/src/shared/locales/ja.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "{date}に移動",
+ "Resume notes · {title}": "メモを再開 · {title}",
"Take notes · {title}": "メモを取る · {title}",
"Take notes · {count} now": "メモを取る · {count}件が進行中",
"Now": "進行中",
diff --git a/app/src/shared/locales/ko.json b/app/src/shared/locales/ko.json
index b2bc3ca8..7240153f 100644
--- a/app/src/shared/locales/ko.json
+++ b/app/src/shared/locales/ko.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "{date}로 이동",
+ "Resume notes · {title}": "메모 재개 · {title}",
"Take notes · {title}": "노트 기록 · {title}",
"Take notes · {count} now": "노트 기록 · {count}개 진행 중",
"Now": "진행 중",
diff --git a/app/src/shared/locales/ms.json b/app/src/shared/locales/ms.json
index b4c2fefd..5c39d747 100644
--- a/app/src/shared/locales/ms.json
+++ b/app/src/shared/locales/ms.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Pergi ke {date}",
+ "Resume notes · {title}": "Sambung catatan · {title}",
"Take notes · {title}": "Ambil nota · {title}",
"Take notes · {count} now": "Ambil nota · {count} sekarang",
"Now": "Sekarang",
diff --git a/app/src/shared/locales/nb.json b/app/src/shared/locales/nb.json
index 230162c2..4fa4d3be 100644
--- a/app/src/shared/locales/nb.json
+++ b/app/src/shared/locales/nb.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Gå til {date}",
+ "Resume notes · {title}": "Fortsett notater · {title}",
"Take notes · {title}": "Ta notater · {title}",
"Take notes · {count} now": "Ta notater · {count} nå",
"Now": "Nå",
diff --git a/app/src/shared/locales/nl.json b/app/src/shared/locales/nl.json
index d173c226..87bf6bbd 100644
--- a/app/src/shared/locales/nl.json
+++ b/app/src/shared/locales/nl.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Ga naar {date}",
+ "Resume notes · {title}": "Notities hervatten · {title}",
"Take notes · {title}": "Notities maken · {title}",
"Take notes · {count} now": "Notities maken · {count} nu",
"Now": "Nu",
diff --git a/app/src/shared/locales/pl.json b/app/src/shared/locales/pl.json
index 5277974d..1eae6026 100644
--- a/app/src/shared/locales/pl.json
+++ b/app/src/shared/locales/pl.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Przejdź do {date}",
+ "Resume notes · {title}": "Wznów notowanie · {title}",
"Take notes · {title}": "Rób notatki · {title}",
"Take notes · {count} now": "Rób notatki · {count} teraz",
"Now": "Teraz",
diff --git a/app/src/shared/locales/pt-BR.json b/app/src/shared/locales/pt-BR.json
index 8067f622..145df413 100644
--- a/app/src/shared/locales/pt-BR.json
+++ b/app/src/shared/locales/pt-BR.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Ir para {date}",
+ "Resume notes · {title}": "Retomar anotações · {title}",
"Take notes · {title}": "Fazer anotações · {title}",
"Take notes · {count} now": "Fazer anotações · {count} agora",
"Now": "Agora",
diff --git a/app/src/shared/locales/ro.json b/app/src/shared/locales/ro.json
index 67d3c110..5f953e7d 100644
--- a/app/src/shared/locales/ro.json
+++ b/app/src/shared/locales/ro.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Mergi la {date}",
+ "Resume notes · {title}": "Reia notițele · {title}",
"Take notes · {title}": "Luați notițe · {title}",
"Take notes · {count} now": "Luați notițe · {count} acum",
"Now": "Acum",
diff --git a/app/src/shared/locales/ru.json b/app/src/shared/locales/ru.json
index ceb56647..6e6e4122 100644
--- a/app/src/shared/locales/ru.json
+++ b/app/src/shared/locales/ru.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Перейти к {date}",
+ "Resume notes · {title}": "Продолжить заметки · {title}",
"Take notes · {title}": "Вести заметки · {title}",
"Take notes · {count} now": "Вести заметки · {count} сейчас",
"Now": "Сейчас",
diff --git a/app/src/shared/locales/sv.json b/app/src/shared/locales/sv.json
index 9e48523c..224fd808 100644
--- a/app/src/shared/locales/sv.json
+++ b/app/src/shared/locales/sv.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Gå till {date}",
+ "Resume notes · {title}": "Fortsätt anteckna · {title}",
"Take notes · {title}": "Anteckna · {title}",
"Take notes · {count} now": "Anteckna · {count} nu",
"Now": "Nu",
diff --git a/app/src/shared/locales/th.json b/app/src/shared/locales/th.json
index b019555c..c8c3fa32 100644
--- a/app/src/shared/locales/th.json
+++ b/app/src/shared/locales/th.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "ไปที่ {date}",
+ "Resume notes · {title}": "จดบันทึกต่อ · {title}",
"Take notes · {title}": "จดโน้ต · {title}",
"Take notes · {count} now": "จดโน้ต · {count} รายการขณะนี้",
"Now": "ขณะนี้",
diff --git a/app/src/shared/locales/tr.json b/app/src/shared/locales/tr.json
index 2cf17003..2310c0a6 100644
--- a/app/src/shared/locales/tr.json
+++ b/app/src/shared/locales/tr.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Şu tarihe git: {date}",
+ "Resume notes · {title}": "Not almaya devam et · {title}",
"Take notes · {title}": "Not al · {title}",
"Take notes · {count} now": "Not al · şu anda {count}",
"Now": "Şimdi",
diff --git a/app/src/shared/locales/uk.json b/app/src/shared/locales/uk.json
index f5820977..96556d4f 100644
--- a/app/src/shared/locales/uk.json
+++ b/app/src/shared/locales/uk.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Перейти до {date}",
+ "Resume notes · {title}": "Продовжити нотатки · {title}",
"Take notes · {title}": "Вести нотатки · {title}",
"Take notes · {count} now": "Вести нотатки · {count} зараз",
"Now": "Зараз",
diff --git a/app/src/shared/locales/vi.json b/app/src/shared/locales/vi.json
index 8a4a1389..b3bbe374 100644
--- a/app/src/shared/locales/vi.json
+++ b/app/src/shared/locales/vi.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "Đi đến {date}",
+ "Resume notes · {title}": "Tiếp tục ghi chú · {title}",
"Take notes · {title}": "Ghi chú · {title}",
"Take notes · {count} now": "Ghi chú · {count} đang diễn ra",
"Now": "Đang diễn ra",
diff --git a/app/src/shared/locales/zh-CN.json b/app/src/shared/locales/zh-CN.json
index f3741cdd..3f1591d2 100644
--- a/app/src/shared/locales/zh-CN.json
+++ b/app/src/shared/locales/zh-CN.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "转到{date}",
+ "Resume notes · {title}": "继续记笔记 · {title}",
"Take notes · {title}": "记笔记 · {title}",
"Take notes · {count} now": "记笔记 · {count} 个正在进行",
"Now": "正在进行",
diff --git a/app/src/shared/locales/zh-TW.json b/app/src/shared/locales/zh-TW.json
index ea99ecbe..6176e33f 100644
--- a/app/src/shared/locales/zh-TW.json
+++ b/app/src/shared/locales/zh-TW.json
@@ -1,5 +1,6 @@
{
"Go to {date}": "前往{date}",
+ "Resume notes · {title}": "繼續記筆記 · {title}",
"Take notes · {title}": "做筆記 · {title}",
"Take notes · {count} now": "做筆記 · {count} 個進行中",
"Now": "進行中",
diff --git a/app/src/shared/types.ts b/app/src/shared/types.ts
index 24863286..4ec0de6c 100644
--- a/app/src/shared/types.ts
+++ b/app/src/shared/types.ts
@@ -70,7 +70,7 @@ export type YogurtApi = {
get(id: string): Promise<MeetingView | undefined>
/** past and current meetings for home, newest first, a page at a time (before: the last card already shown) */
cards(o: { before?: { at: number; id: string }; limit: number; /** only the meetings in this folder */ folder?: string }): Promise<MeetingCard[]>
- /** starts notes now, for a calendar event (its id) or none, the same way the Take notes card does; opens the note */
+ /** starts notes or opens the event's existing note with a guarded resume request */
start(eventId: string | null): Promise<StartResult>
/** opens the note for this occurrence, creating a prepared note if needed; never records */
prepare(eventId: string, day: number): Promise<StartResult>
@@ -297,7 +297,7 @@ export type YogurtApi = {
go(route: string): void
/** the page the app was last told to show, e.g. /note/<id>; empty for home */
current(): Promise<string>
- onGo(cb: (route: string) => void): () => void
+ onGo(cb: (route: string, resumeRequested?: boolean) => void): () => void
}
}
@@ -340,7 +340,7 @@ export type { CalEvent, CalendarSource, CalendarStatus } from '../main/calendar'
/** Calendar occurrence with its saved note, if one exists. No inferred or sample meetings. */
export type AgendaEvent = CalEvent & { note?: { id: string; state: Meeting['state'] } }
/** Start notes: the meeting's id, or why it didn't start (gone: the event left the calendar) */
-export type StartResult = { id: string; alreadyRecording?: true } | { error: 'gone' | 'failed' }
+export type StartResult = { id: string; alreadyRecording?: true; resumeRequested?: true } | { error: 'gone' | 'failed' }
/** one meeting found: parts is a piece of its notes or transcript, hit on the words matched */
export type SearchResult = { meetingId: string; title: string; startedAt: number; parts: SnippetPart[]; confident?: boolean }
diff --git a/app/test/agendaNote.test.ts b/app/test/agendaNote.test.ts
index 15d5b758..03fd7aa8 100644
--- a/app/test/agendaNote.test.ts
+++ b/app/test/agendaNote.test.ts
@@ -1,8 +1,14 @@
import { describe, expect, it } from 'vitest'
-import { agendaNoteAction, unusedPreparedNote, DAY_MS } from '../src/shared/agendaNote'
+import { agendaNoteAction, resumesNote, unusedPreparedNote, DAY_MS } from '../src/shared/agendaNote'
import { openStore } from '../src/main/store'
import type { AgendaEvent } from '../src/shared/types'
const event: AgendaEvent = { id: 'event', title: 'Review', start: 100, end: 200, attendees: [{ name: 'Other', email: null }], url: null }
+it('resumes only stopped or completed notes', () => {
+ expect(resumesNote(undefined)).toBe(false)
+ for (const state of ['prepared', 'recording', 'stopped', 'done'] as const) {
+ expect(resumesNote({ id: 'note', state })).toBe(state === 'stopped' || state === 'done')
+ }
+})
it('offers one note action and leaves solo blocks alone', () => {
expect(agendaNoteAction(event, undefined, 50)).toBe('prepare')
expect(agendaNoteAction(event, undefined, 150)).toBe('start')
diff --git a/app/test/i18n-tables.test.ts b/app/test/i18n-tables.test.ts
index 139b1254..347438f5 100644
--- a/app/test/i18n-tables.test.ts
+++ b/app/test/i18n-tables.test.ts
@@ -55,7 +55,7 @@ it('translates agenda marker labels in every locale', () => {
it('translates the contextual recording action and menu timing in every locale', () => {
for (const { id } of LOCALES) {
const table = load(id)
- for (const key of ['Take notes · {title}', 'Take notes · {count} now', 'Now', 'in {count} min']) {
+ for (const key of ['Take notes · {title}', 'Resume notes · {title}', 'Take notes · {count} now', 'Now', 'in {count} min']) {
expect(keys).toContain(key)
expect(table[key]).toBeDefined()
expect(forms(table[key]).every(value => value.trim().length > 0)).toBe(true)
diff --git a/app/test/meeting.test.ts b/app/test/meeting.test.ts
index 55e3461c..c5d6bca2 100644
--- a/app/test/meeting.test.ts
+++ b/app/test/meeting.test.ts
@@ -11,6 +11,40 @@ beforeEach(() => { store = openStore(':memory:'); initMeetings(store) })
const event = { id: 'e1', title: 'Design review', start: 1000, end: 2000, attendees: [{ name: 'Ann', email: '[email protected]' }], url: null }
describe('meeting lifecycle', () => {
+ it.each(['stopped', 'done'] as const)('returns the existing %s event note without starting capture before the guarded resume', state => {
+ const original = startMeeting({ title: event.title, event, app: null })
+ stopMeeting(original.id)
+ store.updateMeeting(original.id, { state })
+ store.setNotes(original.id, { mine: 'Keep these notes.', enhanced: 'Keep this summary.' })
+ const starts = vi.fn(), off = onMeetingStart(starts)
+ try {
+ const same = startMeeting({ title: event.title, event: { ...event, id: 'calendar-copy', aliases: [event.id] }, app: null })
+ expect(same).toMatchObject({ id: original.id, state })
+ expect(store.meetings({ limit: 10 })).toHaveLength(1)
+ expect(store.notes(original.id)).toMatchObject({ mine: 'Keep these notes.', enhanced: 'Keep this summary.' })
+ expect(activeMeeting()).toBeNull()
+ expect(starts).not.toHaveBeenCalled()
+ } finally { off() }
+ })
+ it('uses the same newest non-trashed event note as the agenda, including ties', () => {
+ const create = (startedAt: number) => store.createMeeting({ title: 'Review fixture', startedAt, endedAt: startedAt + 1, eventId: event.id, attendees: [], app: null, state: 'done' })
+ create(100)
+ const latest = create(200), tied = create(200)
+ const start = () => startMeeting({ title: event.title, event, app: null })
+ expect(start().id).toBe(tied.id)
+ store.db.prepare('UPDATE meetings SET trashed_at = 300 WHERE id = ?').run(tied.id)
+ expect(start().id).toBe(latest.id)
+ expect(start().id).toBe(store.meetingForEvent(event.id)?.id)
+ })
+ it('starts fresh for an unlinked event and for each unattached recording', () => {
+ const first = startMeeting({ title: 'First fixture', event: null, app: null })
+ stopMeeting(first.id)
+ const second = startMeeting({ title: 'Second fixture', event: null, app: null })
+ expect(second.id).not.toBe(first.id)
+ stopMeeting(second.id)
+ expect(startMeeting({ title: event.title, event, app: null }).state).toBe('recording')
+ expect(store.meetings({ limit: 10 })).toHaveLength(3)
+ })
it('persists a late call binding only for the current unbound recording', () => {
const m = startMeeting({ title: 'Meeting', event: null, app: null })
expect(bindMeetingApp('other', 'Zoom')).toBeUndefined()
diff --git a/app/test/resumeRequest.test.ts b/app/test/resumeRequest.test.ts
new file mode 100644
index 00000000..75c421c8
--- /dev/null
+++ b/app/test/resumeRequest.test.ts
@@ -0,0 +1,109 @@
+import { afterEach, beforeEach, expect, it, vi } from 'vitest'
+import { isValidElement, type ReactElement, type ReactNode } from 'react'
+import { Note } from '../src/renderer/src/screens/Note'
+import type { MeetingView, NoteView } from '../src/shared/types'
+
+// Run the note's effects and handlers without mounting editors, a browser, or capture.
+const hooks = vi.hoisted(() => ({ values: [] as unknown[], refs: [] as { current: unknown }[],
+ memos: [] as unknown[], effects: [] as { deps?: unknown[]; run: () => void | (() => void); cleanup?: () => void; pending: boolean }[],
+ state: 0, ref: 0, memo: 0, effect: 0 }))
+vi.mock('react', async original => ({ ...await original<typeof import('react')>(),
+ useState: (initial: unknown) => {
+ const i = hooks.state++
+ if (!(i in hooks.values)) hooks.values[i] = typeof initial === 'function' ? initial() : initial
+ return [hooks.values[i], (next: unknown) => { hooks.values[i] = typeof next === 'function' ? next(hooks.values[i]) : next }]
+ },
+ useRef: (initial: unknown) => hooks.refs[hooks.ref++] ?? (hooks.refs[hooks.ref - 1] = { current: initial }),
+ useMemo: (make: () => unknown) => { const i = hooks.memo++; return hooks.memos[i] ?? (hooks.memos[i] = make()) },
+ useLayoutEffect: () => {},
+ useEffect: (run: () => void | (() => void), deps?: unknown[]) => {
+ const i = hooks.effect++, prev = hooks.effects[i]
+ hooks.effects[i] = { run, deps, cleanup: prev?.cleanup, pending: !prev || !deps || deps.some((dep, index) => dep !== prev.deps?.[index]) }
+ },
+}))
+vi.mock('../src/renderer/src/motion', async original => ({ ...await original<typeof import('../src/renderer/src/motion')>(), useReducedMotion: () => true }))
+let meeting: MeetingView, notes: NoteView
+let meetingChanged: () => void, notesChanged: (notes: NoteView) => void
+const resume = vi.fn(), consumed = vi.fn(), title = vi.fn(), source = vi.fn()
+let requested: (() => void) | undefined
+let tree: ReactNode
+const unmount = () => { hooks.effects.forEach(effect => effect.cleanup?.()); hooks.values = []; hooks.refs = []; hooks.memos = []; hooks.effects = [] }
+async function render() {
+ hooks.state = 0; hooks.ref = 0; hooks.memo = 0; hooks.effect = 0
+ tree = Note({ id: 'resume-fixture', onTitleChange: title, onSource: source, onResumeRequested: requested })
+ for (const effect of hooks.effects) if (effect.pending) {
+ effect.cleanup?.()
+ effect.cleanup = effect.run() || undefined
+ effect.pending = false
+ }
+ for (let i = 0; i < 6; i++) await Promise.resolve()
+}
+function find(node: ReactNode, id: string): ReactElement<Record<string, unknown>> | undefined {
+ if (Array.isArray(node)) return node.map(child => find(child, id)).find(Boolean)
+ if (!isValidElement<Record<string, unknown>>(node)) return
+ return node.props['data-testid'] === id || node.props.testId === id ? node : find(node.props.children as ReactNode, id)
+}
+beforeEach(() => {
+ vi.clearAllMocks()
+ meeting = { id: 'resume-fixture', title: 'Resume fixture', startedAt: 1, endedAt: 2, eventId: 'event', app: null, attendees: [], state: 'stopped', language: null, titleSource: 'calendar' }
+ notes = { meetingId: meeting.id, mine: '', enhanced: null, edited: false, status: 'writing', draft: '', peopleChanged: false }
+ requested = () => { consumed(); requested = undefined }
+ resume.mockResolvedValue({ id: meeting.id })
+ vi.stubGlobal('window', { matchMedia: () => ({ matches: true }), yogurt: {
+ meetings: { get: async () => meeting, onChange: (cb: typeof meetingChanged) => { meetingChanged = cb; return vi.fn() }, resume, stop: vi.fn() },
+ notes: { get: async () => notes, onChange: (cb: typeof notesChanged) => { notesChanged = cb; return vi.fn() } },
+ widget: { state: async () => null, onState: () => vi.fn() },
+ } })
+})
+afterEach(() => { unmount(); vi.unstubAllGlobals() })
+
+it.each(['', 'Keep this decision.'])('the note Resume button always lands on My notes with content %j', async mine => {
+ notes = { ...notes, status: 'done', mine }; requested = undefined
+ await render(); await render()
+ ;(find(tree, 'note-resume')!.props.onClick as () => void)()
+ await render(); await render()
+ expect(resume).toHaveBeenCalledExactlyOnceWith(meeting.id)
+ expect(find(tree, 'note-notes-tab')?.props['aria-selected']).toBe(true)
+})
+
+it('retains the request through queued and writing summaries, then resumes exactly once on My notes', async () => {
+ notes.status = 'waiting'
+ await render(); await render()
+ expect(consumed).not.toHaveBeenCalled()
+ expect(resume).not.toHaveBeenCalled()
+ notesChanged({ ...notes, status: 'writing' }); await render()
+ expect(consumed).not.toHaveBeenCalled()
+ notesChanged({ ...notes, status: 'done' }); await render(); await render()
+ expect(consumed).toHaveBeenCalledOnce()
+ expect(resume).toHaveBeenCalledExactlyOnceWith(meeting.id)
+ expect(find(tree, 'note-notes-tab')?.props['aria-selected']).toBe(true)
+ await render()
+ expect(resume).toHaveBeenCalledOnce()
+})
+
+it('drops a pending request when navigation unmounts the note, including when returning after the summary finishes', async () => {
+ await render(); await render()
+ unmount(); requested = undefined; notes.status = 'done'
+ await render(); await render()
+ expect(consumed).not.toHaveBeenCalled()
+ expect(resume).not.toHaveBeenCalled()
+})
+
+it('waits through Finish before the summary starts and still asks before replacing an edited summary', async () => {
+ meeting.state = 'recording'; notes.status = 'idle'; requested = undefined
+ await render(); await render()
+ ;(find(tree, 'note-stop')!.props.onClick as (e: { detail: number }) => void)({ detail: 0 })
+ meeting = { ...meeting, state: 'stopped' }; meetingChanged()
+ requested = () => { consumed(); requested = undefined }
+ await render(); await render()
+ expect(consumed).not.toHaveBeenCalled()
+ notesChanged({ ...notes, status: 'writing' }); await render(); await render()
+ expect(consumed).not.toHaveBeenCalled()
+ notesChanged({ ...notes, status: 'done', edited: true }); await render(); await render()
+ expect(consumed).toHaveBeenCalledOnce()
+ expect(resume).not.toHaveBeenCalled()
+ expect(find(tree, 'resume-confirm')).toBeDefined()
+ await (find(tree, 'resume-yes')!.props.onClick as () => Promise<void>)()
+ await render()
+ expect(resume).toHaveBeenCalledExactlyOnceWith(meeting.id)
+})
diff --git a/app/test/startRecordingActions.test.ts b/app/test/startRecordingActions.test.ts
index 32aa5cad..db8fd76e 100644
--- a/app/test/startRecordingActions.test.ts
+++ b/app/test/startRecordingActions.test.ts
@@ -32,6 +32,7 @@ const day = vi.fn()
const started = vi.fn()
const gone = vi.fn()
let calendarChanged: () => void
+let meetingsChanged: () => void
let widgetChanged: (view: WidgetView | null) => void
let cleanups: (() => void)[]
const flush = async () => { await Promise.resolve(); await Promise.resolve() }
@@ -62,7 +63,7 @@ beforeEach(async () => {
capabilities: { calendar: true },
widget: { state: async () => null, onState: (cb: typeof widgetChanged) => { widgetChanged = cb; return vi.fn() } },
calendar: { day, onChange: (cb: () => void) => { calendarChanged = cb; return vi.fn() } },
- meetings: { start },
+ meetings: { start, onChange: (cb: () => void) => { meetingsChanged = cb; return vi.fn() } },
} })
render(); run(hooks.layout[0]); await flush()
})
@@ -115,6 +116,43 @@ it('suggests an upcoming meeting but keeps the main action unattached', async ()
await click(find(tree, 'start-recording'))
expect(start).toHaveBeenCalledExactlyOnceWith(null)
})
+it.each(['stopped', 'done'] as const)('labels a %s note for resume in the title bar and menu without suggesting a new folder', async state => {
+ const live = { ...event('live'), note: { id: 'existing', state } }
+ const tree = await calendar([live])
+ expect(label(tree)).toContain('Resume notes · Planning live')
+ expect(find(tree, 'start-recording').props.title).toBe('Resume notes · Planning live')
+ const row = find(tree, 'recording-meeting')
+ const html = renderToStaticMarkup(row.props.children as ReactNode)
+ expect(html).toContain('Resume notes · Planning live')
+ expect(html).toContain('lucide-rotate-ccw')
+ expect(html).toContain('Now')
+ start.mockResolvedValue({ id: 'existing', resumeRequested: true })
+ await click(find(tree, 'start-recording'))
+ await click(row)
+ expect(start).toHaveBeenCalledTimes(2)
+ expect(start).toHaveBeenLastCalledWith(live.id)
+ expect(started).not.toHaveBeenCalled()
+})
+it('keeps the take-notes label and start path for a prepared note', async () => {
+ const tree = await calendar([{ ...event('prepared'), note: { id: 'prepared-note', state: 'prepared' } }])
+ expect(label(tree)).toContain('Take notes · Planning prepared')
+ const html = renderToStaticMarkup(find(tree, 'recording-meeting').props.children as ReactNode)
+ expect(html).not.toContain('Resume notes')
+ expect(html).not.toContain('lucide-rotate-ccw')
+ expect(html).toContain('<svg')
+ await click(find(tree, 'start-recording'))
+ expect(start).toHaveBeenCalledExactlyOnceWith('prepared')
+})
+it('refreshes the resume label when the linked note changes or is trashed', async () => {
+ const live = event('live')
+ await calendar([live])
+ day.mockResolvedValue({ status: 'granted', events: [{ ...live, note: { id: 'existing', state: 'done' } }] })
+ meetingsChanged(); await flush()
+ expect(label(render())).toContain('Resume notes · Planning live')
+ day.mockResolvedValue({ status: 'granted', events: [live] })
+ meetingsChanged(); await flush()
+ expect(label(render())).toContain('Take notes · Planning live')
+})
it('changes at the 15-minute, start and end boundaries and never offers a past event', async () => {
const upcoming = event('boundary', now + 16 * 60_000, now + 17 * 60_000)
await calendar([upcoming])