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.

Notes: the event picker shows which calendar each event is from, and a linked note's pill names the meeting

Eric Brownrout7c96fba83268
diff --git a/app/e2e/peopleCalendar.spec.ts b/app/e2e/peopleCalendar.spec.ts
index d5f2f811..ebe941fe 100644
--- a/app/e2e/peopleCalendar.spec.ts
+++ b/app/e2e/peopleCalendar.spec.ts
@@ -13,10 +13,12 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers st
await app.evaluate(() => (globalThis as unknown as { __fake__: { manyMeetings(o: unknown): void } }).__fake__.manyMeetings({ n: 1, clean: true }))
const [meeting] = await page.evaluate(() => window.yogurt.meetings.cards({ limit: 1 }))
await page.clock.setFixedTime(meeting.startedAt)
- const events = [{ id: 'linked-event', title: 'Planning with Jamie', start: new Date(meeting.startedAt).toISOString(), end: new Date(meeting.startedAt + 1_800_000).toISOString(),
- attendees: [{ name: 'Jamie Quill', email: '[email protected]' }], url: 'https://meet.google.com/fak-eeve-ntx', calendarId: 'work', calendar: 'Work', calendarSource: '[email protected]', me: '[email protected]' }]
+ const events = [{ id: 'linked-event', title: 'Launch planning', start: new Date(meeting.startedAt).toISOString(), end: new Date(meeting.startedAt + 1_800_000).toISOString(),
+ attendees: [{ name: 'Jamie Quill', email: '[email protected]' }], url: 'https://meet.google.com/fak-eeve-ntx', calendarId: 'work', calendar: 'Work', calendarColor: '#438879', calendarSource: '[email protected]', me: '[email protected]' }]
const next = new Date(meeting.startedAt); next.setDate(next.getDate() + 1)
- events.push({ ...events[0], id: 'next-day-event', title: 'Next day review', start: next.toISOString(), end: new Date(+next + 1_800_000).toISOString() })
+ const nextTitle = 'Next day review of the international launch and the engineering handover'
+ events.push({ ...events[0], id: 'next-day-event', title: nextTitle, calendarId: 'personal', calendar: 'Personal', calendarColor: '', start: next.toISOString(), end: new Date(+next + 1_800_000).toISOString() })
+ events.push({ ...events[1], id: 'next-day-focus', title: 'Focus time' })
await app.evaluate((_e, events) => (globalThis as unknown as { __fake__: { calendarEvents(events: unknown[]): void } }).__fake__.calendarEvents(events), events)
await page.evaluate(theme => window.yogurt.settings.setTheme(theme), theme)
await app.evaluate(({ BrowserWindow }) => BrowserWindow.getAllWindows().find(w => !w.webContents.getURL().includes('#'))!.setContentSize(720, 520))
@@ -25,6 +27,9 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers st
await page.getByTestId('note-date').click()
const date = page.getByTestId('note-date-card')
await expect(date.getByTestId('note-date-event')).toHaveCount(1)
+ const textStarts = await date.locator('h3, .note-date-event strong, .note-date-event small').evaluateAll(lines =>
+ lines.map(line => line.getBoundingClientRect().left))
+ expect(Math.max(...textStarts) - Math.min(...textStarts)).toBeLessThan(1)
await expect(date.getByTestId('note-date-events-toggle')).toHaveCount(0)
await expect(date.getByTestId('people-list')).toHaveCount(0)
await expect(date.getByRole('link')).toHaveCount(0)
@@ -43,15 +48,22 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers st
await expect(date.getByTestId('note-date-next')).toBeFocused()
await page.keyboard.press('Tab')
await expect(page.getByTestId('note-date-event').first()).toBeFocused()
- await expect(page.getByTestId('note-date-event').first()).toContainText('Jamie')
+ const choice = date.getByTestId('note-date-event').first()
+ await expect(choice).toContainText('Work')
+ await expect(choice).not.toContainText('Jamie')
+ const chip = page.getByTestId('note-date')
+ const noteDate = await chip.innerText()
// Access lost between listing and selection must be a retryable error.
await app.evaluate(() => (globalThis as any).__fake__.calendarStatus('denied'))
- await page.getByTestId('note-date-event').filter({ hasText: 'Planning with Jamie' }).press('Enter')
+ await page.getByTestId('note-date-event').filter({ hasText: 'Launch planning' }).press('Enter')
await expect(date.getByRole('alert')).toContainText("Yogurt couldn't update the calendar link")
expect((await page.evaluate(id => window.yogurt.meetings.get(id), meeting.id))?.eventId).toBeNull()
await app.evaluate(() => (globalThis as any).__fake__.calendarStatus('granted'))
- await page.getByTestId('note-date-event').filter({ hasText: 'Planning with Jamie' }).press('Enter')
- await expect(date).toContainText('Planning with Jamie')
+ await page.getByTestId('note-date-event').filter({ hasText: 'Launch planning' }).press('Enter')
+ await expect(date).toContainText('Launch planning')
+ await expect(chip.locator('.note-date-chip-dot')).toHaveCSS('background-color', 'rgb(67, 136, 121)')
+ await expect(chip).toHaveAccessibleName(`${noteDate} Launch planning`)
+ await expect(date.getByTestId('note-date-events-toggle')).not.toContainText('Jamie')
await expect(date).toContainText('Work')
await expect(date).not.toContainText('[email protected]')
await expect(date.getByRole('button', { name: 'Open note', exact: true })).toHaveCount(0)
@@ -80,8 +92,22 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers st
await expect(date.getByTestId('note-date-events-toggle')).toHaveCount(0)
await expect(date.getByTestId('note-date-event')).toHaveCount(1)
await page.getByTestId('note-date-next').click()
- await page.getByTestId('note-date-event').filter({ hasText: 'Next day review' }).click()
- await expect(page.getByTestId('note-title')).toHaveText('Next day review')
+ const choices = date.getByTestId('note-date-event')
+ await expect(choices).toHaveCount(2)
+ for (const row of await choices.all()) {
+ await expect(row).toContainText('Personal')
+ await expect(row).not.toContainText('Jamie')
+ }
+ await choices.filter({ hasText: 'Next day review' }).click()
+ await expect(chip.locator('.note-date-chip-dot')).toHaveCount(0)
+ await expect(chip).toContainText('·')
+ await expect(chip).toHaveAccessibleName(`${noteDate} ${nextTitle}`)
+ await expect(chip).toHaveAttribute('title', nextTitle)
+ const name = chip.locator('.note-date-chip-name')
+ await expect(name).toHaveText(nextTitle)
+ expect(await name.evaluate(el => el.scrollWidth > el.clientWidth)).toBe(true)
+ await expect(date.locator('.note-date-identity strong')).toHaveText(nextTitle)
+ await expect(page.getByTestId('note-title')).toHaveText(meeting.title)
await expect(date.getByRole('link', { name: 'Join meeting' })).toHaveCount(0)
await expect(date.locator('.note-date-actions')).toHaveCount(0)
await page.keyboard.press('Escape')
@@ -93,7 +119,7 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers st
await page.evaluate(() => window.dispatchEvent(new Event('focus')))
await expect(date.getByRole('button', { name: 'Open System Settings' })).toBeVisible()
await expect(date).toContainText('Next day review')
- await expect(date).toContainText('Work')
+ await expect(date).toContainText('Personal')
await expect(date).not.toContainText('[email protected]')
await app.evaluate(() => (globalThis as any).__fake__.calendarStatus('granted'))
await page.evaluate(() => window.dispatchEvent(new Event('focus')))
@@ -104,7 +130,7 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers st
await page.getByTestId('note-date-unlink').click()
await expect(date.getByTestId('note-date-events-toggle')).toHaveCount(0)
await expect(date.getByTestId('note-date-event')).toHaveCount(1)
- await expect(page.getByTestId('note-title')).toHaveText('Next day review')
+ await expect(page.getByTestId('note-title')).toHaveText(meeting.title)
expect((await page.evaluate(id => window.yogurt.meetings.get(id), meeting.id))?.startedAt).toBe(meeting.startedAt)
await page.getByTestId('note-attendees').click()
await expect(date).toHaveCount(0)
@@ -114,7 +140,7 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers st
await expect(people.getByRole('heading', { name: 'Example', exact: true })).toBeVisible()
await expect(people.getByRole('heading', { name: 'Other people', exact: true })).toHaveCount(0)
await expect(people.locator('.person-initials')).toHaveCount(2)
- await expect(people).not.toContainText('Planning with Jamie')
+ await expect(people).not.toContainText('Launch planning')
// a mouse-opened card shows no row actions until hovered or reached by keyboard
await expect(people.getByTestId('people-edit')).toHaveCSS('opacity', '0')
await people.getByTestId('people-name').focus()
diff --git a/app/src/main/calendar.ts b/app/src/main/calendar.ts
index 824c418b..663a522e 100644
--- a/app/src/main/calendar.ts
+++ b/app/src/main/calendar.ts
@@ -158,14 +158,15 @@ export function parseEvents(raw: unknown, hidden: string[] = []): CalEvent[] {
}
/** Events between two times. No Calendar access, or a helper that fails: none, never a crash. */
-export async function upcoming(fromMs: number, toMs: number, keep?: (event: CalEvent) => boolean): Promise<CalEvent[]> {
+export async function upcoming(fromMs: number, toMs: number, keep?: 'link-event' | ((event: CalEvent) => boolean)): Promise<CalEvent[]> {
if (await refreshCalendarStatus() !== 'granted') return []
try {
const fromMac = !links || (alongside && macStatus === 'granted')
const mac = fromMac ? await helper(['events', new Date(fromMs).toISOString(), new Date(toMs).toISOString()]) : []
const raw = [...(links ? await links.events(fromMs, toMs) : []), ...(Array.isArray(mac) ? mac : [])]
const selection = calendarSelection()
- return parseEvents(raw, selection.hiddenCalendarIds).filter(event =>
- selection.hideEventsWithoutCallLink !== true || event.url !== null || keep?.(event))
+ const events = parseEvents(raw, selection.hiddenCalendarIds)
+ if (keep === 'link-event' || selection.hideEventsWithoutCallLink !== true) return events
+ return events.filter(event => event.url !== null || keep?.(event))
} catch { status = 'error'; return [] }
}
diff --git a/app/src/main/index.ts b/app/src/main/index.ts
index dc0e9685..638130b7 100644
--- a/app/src/main/index.ts
+++ b/app/src/main/index.ts
@@ -259,7 +259,7 @@ let relaunched = 0
/** fake mode: how many times Yogurt would have restarted to install a new version */
let updateRestarts = 0
-async function readCalendar(from: number, to: number, keep?: (event: CalEvent) => boolean): Promise<CalEvent[]> {
+async function readCalendar(from: number, to: number, keep?: Parameters<typeof upcoming>[2]): Promise<CalEvent[]> {
const events = await upcoming(from, to, keep)
refreshEventSnapshots(events)
return events
@@ -273,10 +273,10 @@ async function comingUp(): Promise<CalEvent[]> {
}
/** The events on the day of this time, earliest first */
-async function eventsOn(at: number): Promise<CalEvent[]> {
+async function eventsOn(at: number, purpose?: 'link-event'): Promise<CalEvent[]> {
const from = new Date(at); from.setHours(0, 0, 0, 0)
const to = new Date(from); to.setDate(to.getDate() + 1)
- return (await readCalendar(from.getTime(), to.getTime(), event => eventIds(event).some(id => !!storeRef?.meetingForEvent(id)))).sort((a, b) => a.start - b.start)
+ return (await readCalendar(from.getTime(), to.getTime(), purpose ?? (event => eventIds(event).some(id => !!storeRef?.meetingForEvent(id))))).sort((a, b) => a.start - b.start)
}
/** the Mac's full name: who "You" is unless Settings says otherwise (fake mode: a fixed one) */
@@ -946,7 +946,7 @@ app.whenReady().then(() => {
if (typeof eventId !== 'string') return
const at = day ?? m.eventStartedAt ?? m.startedAt
if (typeof at !== 'number' || !Number.isFinite(at) || !Number.isFinite(new Date(at).getTime())) throw new Error('Invalid calendar day')
- const event = (await eventsOn(at)).find((e) => matchesEvent(e, eventId))
+ const event = (await eventsOn(at, 'link-event')).find((e) => matchesEvent(e, eventId))
if (!event) throw new Error('Calendar event unavailable')
if (linkEvent(m.id, event)) notes.applyPeople(m.id)
})
@@ -1024,9 +1024,9 @@ app.whenReady().then(() => {
win?.webContents.send('calendar:changed')
return true
})
- ipcMain.handle('calendar:day', async (_e, at: unknown) => {
+ ipcMain.handle('calendar:day', async (_e, at: unknown, purpose?: unknown) => {
if (typeof at !== 'number' || !Number.isFinite(at) || !Number.isFinite(new Date(at).getTime())) return { status: 'error', events: [] }
- const events = (await eventsOn(at)).map((event) => {
+ const events = (await eventsOn(at, purpose === 'link-event' ? 'link-event' : undefined)).map((event) => {
const meeting = eventIds(event).map((id) => store.meetingForEvent(id)).find(Boolean)
const note = meeting && withStopState(meeting)
return { ...event, attendees: resolvePeople(store.db, event.attendees), ...(note ? { note: { id: note.id, state: note.state, ...(note.source ? { source: note.source } : {}) } } : {}) }
diff --git a/app/src/main/meeting.ts b/app/src/main/meeting.ts
index f70dc190..a9a4946a 100644
--- a/app/src/main/meeting.ts
+++ b/app/src/main/meeting.ts
@@ -196,7 +196,7 @@ export function setAttendees(id: string, people: unknown): Meeting | undefined {
const name = tidy(p?.name, TITLE_MAX)
return name ? [{ name, email: tidy(p?.email, TITLE_MAX) || null }] : []
})
- return update(id, { attendees })
+ return update(id, { attendees, keepAttendees: true })
}
/** The note belongs to this calendar event: its title and people */
@@ -204,7 +204,12 @@ export function linkEvent(id: string, event: CalEvent): Meeting | undefined {
const meeting = store?.meeting(id)
if (!store || !meeting) return undefined
if (meeting.state === 'prepared') store.markPrepared(id, event.end)
- return update(id, { eventId: event.id, eventStartedAt: event.start, eventEndedAt: event.end, eventTitle: event.title, ownEmail: event.ownEmail ?? null, eventCalendarName: event.calendar?.name ?? null, eventCalendarSource: event.calendar?.source ?? null, title: event.title || meeting.title, ...(event.title ? { titleSource: 'calendar' as const } : {}), attendees: event.attendees })
+ return update(id, {
+ eventId: event.id, eventStartedAt: event.start, eventEndedAt: event.end, eventTitle: event.title,
+ ownEmail: event.ownEmail ?? null, eventCalendarName: event.calendar?.name ?? null, eventCalendarSource: event.calendar?.source ?? null,
+ ...(event.title && meeting.titleSource !== 'user' ? { title: event.title, titleSource: 'calendar' } : {}),
+ ...(meeting.keepAttendees ? {} : { attendees: event.attendees }),
+ })
}
/** Reading a calendar updates its snapshot, never the person's title, attendees or notes. */
diff --git a/app/src/main/store.ts b/app/src/main/store.ts
index 253bb5a3..281435dd 100644
--- a/app/src/main/store.ts
+++ b/app/src/main/store.ts
@@ -35,6 +35,8 @@ export type Meeting = {
language: string | null
/** where the title came from: only a generic or auto one is replaced by a title from the notes */
titleSource: TitleSource
+ /** Preserve the saved list on calendar links after a manual edit or an import without edit history. */
+ keepAttendees?: boolean
/** Recorded duration when pauses or resumed sessions make wall duration inaccurate. */
durationMs?: number
/** Some recorded audio still needs a saved transcript, including earlier sessions. */
@@ -61,6 +63,7 @@ const toMeeting = (r: Row): Meeting => ({
id: String(r.id), title: String(r.title), startedAt: Number(r.started_at), endedAt: r.ended_at == null ? null : Number(r.ended_at),
eventId: r.event_id == null ? null : String(r.event_id), app: r.app == null ? null : String(r.app),
attendees: JSON.parse(String(r.attendees)), state: r.state as Meeting['state'], language: r.language == null ? null : String(r.language),
+ ...(r.keep_attendees ? { keepAttendees: true } : {}),
titleSource: (r.title_source ?? 'user') as TitleSource,
...(r.source == null ? {} : { source: String(r.source) }),
...(r.source_id == null ? {} : { sourceId: String(r.source_id) }),
@@ -227,6 +230,8 @@ export class Store {
if (!meetingCols.includes('duration_ms')) this.db.exec('ALTER TABLE meetings ADD COLUMN duration_ms INTEGER')
if (!meetingCols.includes('language')) this.db.exec('ALTER TABLE meetings ADD COLUMN language TEXT')
if (!meetingCols.includes('trashed_at')) this.db.exec('ALTER TABLE meetings ADD COLUMN trashed_at INTEGER')
+ // Existing notes and older backups have no attendee edit history, including lists cleared by hand.
+ if (!meetingCols.includes('keep_attendees')) this.db.exec('ALTER TABLE meetings ADD COLUMN keep_attendees INTEGER NOT NULL DEFAULT 1')
if (!meetingCols.includes('title_source')) {
// meetings from before: worked out from the title and the event, as a new one would be
this.db.exec("ALTER TABLE meetings ADD COLUMN title_source TEXT NOT NULL DEFAULT 'user'")
@@ -298,6 +303,7 @@ export class Store {
this.db.prepare('UPDATE meetings SET attendees = ? WHERE id = ?').run(JSON.stringify(people), id)
this.db.prepare('UPDATE notes SET written_with = ? WHERE meeting_id = ? AND written_with = ?').run(attendeeMembership(people), id, previous)
}
+ this.db.prepare('UPDATE meetings SET keep_attendees = 1 WHERE id = ?').run(id)
this.db.exec('RELEASE rename_person')
return true
} catch (e) { this.db.exec('ROLLBACK TO rename_person; RELEASE rename_person'); throw e }
@@ -316,18 +322,22 @@ export class Store {
const ownEmail = m.eventId ? ownAddress(m.ownEmail) : null
this.rememberOwnEmail(ownEmail)
const titleSource = m.titleSource ?? sourceOf(m.title, m.eventId)
- this.db.prepare('INSERT INTO meetings (id, title, started_at, ended_at, event_id, app, attendees, state, language, title_source, duration_ms, event_started_at, event_ended_at, event_title, event_calendar_name, event_calendar_source, source, transcription_pending, own_email) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)')
- .run(id, m.title, m.startedAt, m.endedAt, m.eventId, m.app, JSON.stringify(m.attendees), m.state, language, titleSource, m.durationMs ?? null, m.eventStartedAt ?? null, m.eventEndedAt ?? null, m.eventTitle ?? null, m.eventCalendarName ?? null, m.eventCalendarSource ?? null, m.source ?? null, Number(!!m.transcriptionPending), ownEmail)
+ this.db.prepare('INSERT INTO meetings (id, title, started_at, ended_at, event_id, app, attendees, state, language, title_source, duration_ms, event_started_at, event_ended_at, event_title, event_calendar_name, event_calendar_source, source, transcription_pending, own_email, keep_attendees) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)')
+ .run(id, m.title, m.startedAt, m.endedAt, m.eventId, m.app, JSON.stringify(m.attendees), m.state, language, titleSource, m.durationMs ?? null, m.eventStartedAt ?? null, m.eventEndedAt ?? null, m.eventTitle ?? null, m.eventCalendarName ?? null, m.eventCalendarSource ?? null, m.source ?? null, Number(!!m.transcriptionPending), ownEmail, Number(!!m.keepAttendees))
rememberPeople(this.db, m.attendees)
return this.meeting(id)!
}
updateMeeting(id: string, patch: Partial<Omit<Meeting, 'id'>>) {
if (patch.ownEmail) this.rememberOwnEmail(patch.ownEmail)
if (patch.attendees) rememberPeople(this.db, patch.attendees)
- const col: Record<string, string> = { title: 'title', startedAt: 'started_at', endedAt: 'ended_at', eventId: 'event_id', eventStartedAt: 'event_started_at', eventEndedAt: 'event_ended_at', eventTitle: 'event_title', eventCalendarName: 'event_calendar_name', eventCalendarSource: 'event_calendar_source', ownEmail: 'own_email', app: 'app', attendees: 'attendees', state: 'state', language: 'language', titleSource: 'title_source', durationMs: 'duration_ms', transcriptionPending: 'transcription_pending', transcriptionState: 'transcription_state', transcriptionAgain: 'transcription_again' }
+ const col: Record<string, string> = { title: 'title', startedAt: 'started_at', endedAt: 'ended_at', eventId: 'event_id', eventStartedAt: 'event_started_at', eventEndedAt: 'event_ended_at', eventTitle: 'event_title', eventCalendarName: 'event_calendar_name', eventCalendarSource: 'event_calendar_source', ownEmail: 'own_email', app: 'app', attendees: 'attendees', keepAttendees: 'keep_attendees', state: 'state', language: 'language', titleSource: 'title_source', durationMs: 'duration_ms', transcriptionPending: 'transcription_pending', transcriptionState: 'transcription_state', transcriptionAgain: 'transcription_again' }
const keys = Object.keys(patch).filter((k) => k in col && (patch as Row)[k] !== undefined)
if (!keys.length) return
- const vals = keys.map((k) => (k === 'attendees' ? JSON.stringify(patch.attendees) : (k === 'transcriptionPending' || k === 'transcriptionAgain') ? Number(k === 'transcriptionPending' ? patch.transcriptionPending : patch.transcriptionAgain) : (patch as Row)[k]) as string | number | null)
+ const vals = keys.map(k => {
+ const value = (patch as Row)[k]
+ if (k === 'attendees') return JSON.stringify(value)
+ return typeof value === 'boolean' ? Number(value) : value as string | number | null
+ })
this.db.prepare(`UPDATE meetings SET ${keys.map((k) => `${col[k]} = ?`).join(', ')} WHERE id = ?`).run(...vals, id)
}
/** Refresh every note still linked to this occurrence, including alternate calendar IDs. */
diff --git a/app/src/preload/index.ts b/app/src/preload/index.ts
index 95bb1120..ffab7b53 100644
--- a/app/src/preload/index.ts
+++ b/app/src/preload/index.ts
@@ -196,7 +196,7 @@ const api: YogurtApi = {
onChange: (cb) => { ipcRenderer.on('calendar:changed', cb); return () => { ipcRenderer.off('calendar:changed', cb) } },
comingUp: () => ipcRenderer.invoke('calendar:coming-up'),
connect: () => ipcRenderer.invoke('calendar:connect'),
- day: (at) => ipcRenderer.invoke('calendar:day', at),
+ day: (at, purpose) => ipcRenderer.invoke('calendar:day', at, purpose),
links: () => ipcRenderer.invoke('calendar:links'),
addLink: (url) => ipcRenderer.invoke('calendar:add-link', url),
removeLink: (id) => ipcRenderer.invoke('calendar:remove-link', id),
diff --git a/app/src/renderer/src/components/NoteDate.tsx b/app/src/renderer/src/components/NoteDate.tsx
index b97570b0..ab2e6300 100644
--- a/app/src/renderer/src/components/NoteDate.tsx
+++ b/app/src/renderer/src/components/NoteDate.tsx
@@ -1,7 +1,7 @@
import { usePopoverPresence } from '../motion'
import { Component, createRef, useCallback, useEffect, useLayoutEffect, useRef, useState, type ReactNode, type RefObject } from 'react'
import { ScrollFade } from './ScrollFade'
-import { CalendarDays, ChevronDown, ChevronLeft, ChevronRight, Clock, ExternalLink, Link2Off } from 'lucide-react'
+import { CalendarDays, Plus, ChevronDown, ChevronLeft, ChevronRight, Clock, ExternalLink, Link2Off } from 'lucide-react'
import type { CalEvent, CalendarStatus, Meeting } from '../../../shared/types'
import { language, t } from '../../../shared/i18n'
import { noteDateLabel, timeOf } from '../dates'
@@ -11,24 +11,31 @@ import { useNoteCalendar, type NoteCalendar } from '../useNoteCalendar'
import { useNotePopover } from '../useNotePopover'
import { useLoadingState } from '../useLoadingState'
import { nearestEvents, shiftCalendarDay } from '../../../shared/calendarPicker'
-import { peopleSummary, useMyName } from './People'
export function NoteDate({ m }: { m: Meeting }) {
const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)
const presence = usePopoverPresence(open)
const chip = useRef<HTMLButtonElement>(null)
const { details, refresh } = useNoteCalendar(m)
+ const event = details?.result.events.find(e => e.id === m.eventId || (m.eventId && e.aliases?.includes(m.eventId)))
+ const eventTitle = m.eventId ? event?.title || m.eventTitle || (m.titleSource === 'calendar' && m.title) || t('Meeting') : undefined
+ const color = event?.calendar?.id ? details?.colors[event.calendar.id] : undefined
+ const date = noteDateLabel(m.startedAt)
const close = useCallback(() => { setOpen(false); chip.current?.focus({ preventScroll: true }) }, [])
- return <div className="relative">
- <button ref={chip} data-testid="note-date" aria-haspopup="dialog" aria-expanded={!!open} onClick={e => setOpen(o => o ? false : e.detail > 0 ? 'pointer' : 'keyboard')}
- className="note-chip flex items-center gap-1.5 rounded-md border border-line px-2.5 text-[13px] text-muted">
- <CalendarDays size={14} strokeWidth={1.75} aria-hidden="true" />{noteDateLabel(m.startedAt)}
+ return <div className="relative note-date-anchor">
+ <button ref={chip} title={eventTitle} data-testid="note-date" aria-label={eventTitle ? `${date} ${eventTitle}` : undefined} aria-haspopup="dialog" aria-expanded={!!open} onClick={e => setOpen(o => o ? false : e.detail > 0 ? 'pointer' : 'keyboard')}
+ className="note-chip note-date-chip flex items-center gap-1.5 rounded-md border border-line px-2.5 text-[13px] text-muted">
+ <CalendarDays size={14} strokeWidth={1.75} aria-hidden="true" /><span>{date}</span>
+ {eventTitle && <>
+ <span aria-hidden="true" className={color ? 'note-date-chip-dot' : undefined} style={{ backgroundColor: color }}>{color ? null : ' · '}</span>
+ <span className="note-date-chip-name" dir="auto">{eventTitle}</span>
+ </>}
</button>
- {presence.value && <DateCard key={m.id} m={m} details={details} refreshLinked={refresh} chip={chip} motionProps={presence.props} onClose={close} />}
+ {presence.value && <DateCard key={m.id} m={m} details={details} event={event} eventTitle={eventTitle} color={color} refreshLinked={refresh} chip={chip} motionProps={presence.props} onClose={close} />}
</div>
}
-function DateCard({ m, details, refreshLinked, chip, motionProps, onClose }: { m: Meeting; details?: NoteCalendar; refreshLinked: () => void; chip: RefObject<HTMLButtonElement | null>; motionProps: ReturnType<typeof usePopoverPresence>['props']; onClose: (restore?: boolean) => void }) {
+function DateCard({ m, details, event, eventTitle, color, refreshLinked, chip, motionProps, onClose }: { m: Meeting; details?: NoteCalendar; event?: CalEvent; eventTitle?: string; color?: string; refreshLinked: () => void; chip: RefObject<HTMLButtonElement | null>; motionProps: ReturnType<typeof usePopoverPresence>['props']; onClose: (restore?: boolean) => void }) {
const card = useRef<HTMLDivElement>(null)
// no calendar on this computer (Windows, Linux): the date and length only, as for a note with no event
const calendar = window.yogurt.capabilities.calendar
@@ -64,7 +71,7 @@ function DateCard({ m, details, refreshLinked, chip, motionProps, onClose }: { m
useEffect(() => {
if (!calendar || linked) return
let active = true
- void window.yogurt.calendar.day(day).catch(() => ({ status: 'error' as const, events: [] })).then(value => {
+ void window.yogurt.calendar.day(day, 'link-event').catch(() => ({ status: 'error' as const, events: [] })).then(value => {
if (!active) return
if (value.status !== 'granted') days.current.clear()
days.current.set(new Date(day).toDateString(), value)
@@ -79,9 +86,6 @@ function DateCard({ m, details, refreshLinked, chip, motionProps, onClose }: { m
useEffect(() => {
if (!picking) browse(m.eventStartedAt ?? m.startedAt)
}, [picking, m.eventStartedAt, m.startedAt])
- const eventDay = new Date(m.eventStartedAt ?? m.startedAt).toDateString()
- const eventResult = new Date(day).toDateString() === eventDay ? result : days.current.get(eventDay)
- const event = linked ? eventResult?.events.find(e => e.id === m.eventId || e.aliases?.includes(m.eventId!)) ?? (eventResult ? null : undefined) : null
useEffect(() => {
if (!calendar || linked) return
const refresh = () => setRevision(n => n + 1)
@@ -102,10 +106,10 @@ function DateCard({ m, details, refreshLinked, chip, motionProps, onClose }: { m
const minutes = Math.max(0, Math.round((m.durationMs ?? (m.endedAt ? m.endedAt - m.startedAt : m.state === 'recording' ? Date.now() - m.startedAt : 0)) / 60_000))
const joinable = useJoinWindow(at, eventEnd)
const url = joinable ? event?.url?.trim() : undefined
- const color = event?.calendar?.id ? details?.colors[event.calendar.id] : undefined
const date = new Date(browsing ? day : at)
+ const showDate = !linked || date.toDateString() !== new Date(m.startedAt).toDateString()
const dateOptions: Intl.DateTimeFormatOptions = { month: 'short', day: 'numeric', ...(date.getFullYear() === new Date().getFullYear() ? {} : { year: 'numeric' }) }
- const fullDate = date.toLocaleDateString(language(), { ...dateOptions, weekday: 'long' })
+ const fullDate = date.toLocaleDateString(language(), { ...dateOptions, weekday: 'long', month: 'long' })
const shortDate = date.toLocaleDateString(language(), { ...dateOptions, weekday: 'short' })
useLayoutEffect(() => {
const el = heading.current
@@ -119,7 +123,7 @@ function DateCard({ m, details, refreshLinked, chip, motionProps, onClose }: { m
const observer = new ResizeObserver(measure)
observer.observe(el)
return () => observer.disconnect()
- }, [fullDate, linked])
+ }, [fullDate, showDate])
const loading = loadingPhase !== 'skeleton' ? null : <div className="loading-content" data-loading-phase={loadingPhase} aria-busy="true">
<div className="loading-placeholder"><span role="status" className="sr-only">{t('Looking at your calendar…')}</span>
<div className="loading-mask" aria-hidden="true"><span className="loading-bar" style={{ width: '65%' }} /></div>
@@ -133,19 +137,17 @@ function DateCard({ m, details, refreshLinked, chip, motionProps, onClose }: { m
className="people-card menu-entry note-date-card absolute start-0 top-full z-30 mt-2 w-[min(340px,calc(100vw-48px))] rounded-lg border border-line bg-float text-ink shadow-[var(--shadow)]"
onKeyDown={e => { if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); if (linked && picking) { setPicking(false); toggle.current?.focus({ preventScroll: true }) } else onClose() } }}>
<NoteDateBody view={`${m.eventId ?? 'unlinked'}/${browsing ? 'picker' : 'details'}/${linked ? 'linked' : result?.status ?? (loadingPhase === 'skeleton' ? 'skeleton' : 'waiting')}`}>
- {!linked && <div className="agenda-inspector-heading">
- <h3 ref={heading} data-testid="note-date-heading" tabIndex={-1} aria-live="polite" aria-label={fullDate} title={fullDate}>{compactDate ? shortDate : fullDate}</h3>
- <div className="flex shrink-0 items-center gap-1">
- {(available || (picking && browsing)) && <>
- <button type="button" ref={previous} className="ghost-btn workspace-icon" data-testid="note-date-previous" aria-label={t('Previous day')} disabled={linking} onClick={e => { pickerKeyboard.current = e.detail === 0; setPicking(true); browse(shiftCalendarDay(day, -1)) }}><ChevronLeft size={15} aria-hidden="true" /></button>
- <button type="button" className="ghost-btn workspace-icon" data-testid="note-date-next" aria-label={t('Next day')} disabled={linking} onClick={e => { pickerKeyboard.current = e.detail === 0; setPicking(true); browse(shiftCalendarDay(day, 1)) }}><ChevronRight size={15} aria-hidden="true" /></button>
- </>}
- </div>
+ {showDate && <div className="agenda-inspector-heading">
+ <h3 ref={heading} data-testid="note-date-heading" tabIndex={linked ? undefined : -1} aria-live="polite" aria-label={fullDate} title={fullDate}>{compactDate ? shortDate : fullDate}</h3>
+ {browsing && (available || picking) && <div className="flex shrink-0 items-center gap-1">
+ <button type="button" ref={previous} className="ghost-btn workspace-icon" data-testid="note-date-previous" aria-label={t('Previous day')} disabled={linking} onClick={e => { pickerKeyboard.current = e.detail === 0; setPicking(true); browse(shiftCalendarDay(day, -1)) }}><ChevronLeft size={15} aria-hidden="true" /></button>
+ <button type="button" className="ghost-btn workspace-icon" data-testid="note-date-next" aria-label={t('Next day')} disabled={linking} onClick={e => { pickerKeyboard.current = e.detail === 0; setPicking(true); browse(shiftCalendarDay(day, 1)) }}><ChevronRight size={15} aria-hidden="true" /></button>
+ </div>}
</div>}
{linked && <div className="note-date-linked">
<button type="button" ref={toggle} data-testid="note-date-events-toggle" className="note-date-event-toggle" aria-expanded={picking} disabled={linking} onClick={e => { pickerKeyboard.current = e.detail === 0; setPicking(v => !v) }}>
<span className="note-date-color note-date-reveal" data-ready={!!color} aria-hidden="true" style={{ backgroundColor: color }} />
- <span className="note-date-identity"><strong title={event?.title || m.eventTitle || m.title}>{event?.title || m.eventTitle || m.title}</strong>
+ <span className="note-date-identity"><strong dir="auto">{eventTitle}</strong>
<span className="note-date-time">{eventEnd != null ? eventTimeRange(at, eventEnd) : `${timeOf(at)} · ${t('{count} min', { count: minutes })}`}</span>
{(eventCalendar?.name || reserveCalendar.current) && <span className="note-date-calendar note-date-reveal" data-ready={!!eventCalendar?.name} title={eventCalendar?.name}>{eventCalendar?.name}</span>}
</span>
@@ -159,9 +161,9 @@ function DateCard({ m, details, refreshLinked, chip, motionProps, onClose }: { m
<p>{timeOf(at)}{eventEnd != null ? ` – ${timeOf(eventEnd)}` : ` · ${t('{count} min', { count: minutes })}`}</p>
</div></div>
</div></div></div>}
- {linked && ((joinable && !result) || url || (result && (!available || event === null))) && <div className="note-date-actions" aria-busy={!result}>
+ {linked && ((joinable && !result) || url || (result && (!available || !event))) && <div className="note-date-actions" aria-busy={!result}>
<div className="note-date-reveal" data-ready={!!result}>
- {available && event === null && <div className="note-date-access flex items-center gap-3 text-xs text-muted">
+ {available && !event && <div className="note-date-access flex items-center gap-3 text-xs text-muted">
<p role="status">{t('Calendar event unavailable')}</p>
<button className="text-action ms-auto" onClick={refresh}>{t('Try again')}</button>
</div>}
@@ -181,7 +183,6 @@ function EventPicker({ open = true, keyboard, m, day, result, loading, previous,
const [linkError, setLinkError] = useState(false)
const list = useRef<HTMLDivElement>(null)
const unlink = useRef<HTMLButtonElement>(null)
- const me = useMyName()
useEffect(() => {
if (!open) return
if (list.current) list.current.scrollTop = 0
@@ -207,9 +208,10 @@ function EventPicker({ open = true, keyboard, m, day, result, loading, previous,
rows[next].focus({ preventScroll: true }); rows[next].scrollIntoView({ block: 'nearest', container: 'nearest' } as ScrollIntoViewOptions)
}}>
{!result ? loading
- : !result.events.length ? <p data-testid="note-date-events-none" title={t('No events')}>{t('No events')}</p>
+ : !result.events.length ? <p data-testid="note-date-events-none">{t('No events')}</p>
: nearestEvents(events!, m.startedAt).map(e => <button key={e.id} data-event-id={e.id} data-testid="note-date-event" className="note-date-event" disabled={linking} onClick={() => void link(e.id)}>
- <span><strong>{e.title || t('Meeting')}</strong><small>{timeOf(e.start)} – {timeOf(e.end)}</small>{!!e.attendees.length && <small>{peopleSummary(e.attendees, me)}</small>}</span>
+ <span><span className="sr-only">{t('Select calendar event')} </span><strong>{e.title || t('Meeting')}</strong><small>{timeOf(e.start)} – {timeOf(e.end)}</small>{e.calendar?.name && <small>{e.calendar.name}</small>}</span>
+ <Plus size={15} aria-hidden="true" className="shrink-0 text-muted" />
</button>)}
</div></ScrollFade>}
{m.eventId && <button ref={unlink} data-testid="note-date-unlink" className="note-date-link" disabled={linking} onClick={() => void link(null)}><Link2Off size={14} aria-hidden="true" /><span>{t('Unlink calendar event')}<small>{t('Keep the title, attendees and notes.')}</small></span></button>}
diff --git a/app/src/renderer/src/styles.css b/app/src/renderer/src/styles.css
index abc2f724..6c7cddb1 100644
--- a/app/src/renderer/src/styles.css
+++ b/app/src/renderer/src/styles.css
@@ -765,6 +765,11 @@ html:not(.widget) button:focus-visible, html:not(.widget) input:focus-visible {
:is(.line-who,.widget-preview-speaker)[data-folder-color] { color:var(--folder-ink); }
/* Calendar linking lives in the date popover; attendee editing stays in People. */
+.note-date-anchor { min-width:0;max-width:min(100%, 17rem); }
+.note-date-chip { max-width:100%;white-space:nowrap; }
+.note-date-chip>svg { flex:none; }
+.note-date-chip-dot { width:6px;height:6px;border-radius:50%;flex:none; }
+.note-date-chip-name { min-width:0;overflow:hidden;text-overflow:ellipsis; }
.note-date-card { --note-date-ms:var(--dur-base);--note-date-ease:var(--ease-out); }
.note-date-swap { position:relative;overflow:hidden; }
.note-date-retiring { position:absolute;inset:0 0 auto;pointer-events:none; }
@@ -796,8 +801,8 @@ html:not(.widget) button:focus-visible, html:not(.widget) input:focus-visible {
@media (prefers-reduced-motion:reduce) { .note-date-reveal { transition:none; } }
.note-date-identity { min-width:0;flex:1; }
-.note-date-identity>strong,.note-date-time,.note-date-calendar { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
-.note-date-identity>strong { font-size:14px;font-weight:600;line-height:21px; }
+.note-date-time,.note-date-calendar { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
+.note-date-identity>strong { display:block;overflow-wrap:anywhere;font-size:14px;font-weight:600;line-height:21px; }
.note-date-time { font-size:12px;line-height:18px;color:var(--written);margin-top:3px; }
.note-date-calendar { min-height:16px;font-size:11px;line-height:16px;color:var(--muted);margin-top:3px; }
.note-date-event-toggle>svg { flex:none;margin-top:4px;color:var(--muted);transition:transform var(--note-date-ms) var(--note-date-ease); }
@@ -812,7 +817,8 @@ html:not(.widget) button:focus-visible, html:not(.widget) input:focus-visible {
.note-date-link>svg { flex:none; }
.note-date-link small { display:block;margin-top:3px;font-size:11px;overflow:hidden;text-overflow:ellipsis; }
.note-date-events { max-height:240px;overflow-y:auto;overscroll-behavior:contain; }
-.note-date-events>p { padding:12px 8px;font-size:12px;color:var(--muted); }
+.note-date-events:has(>.note-date-event) { margin:-8px; }
+.note-date-events>p { font-size:12px;color:var(--muted); }
.note-date-event { display:flex;align-items:center;gap:8px;width:100%;padding:8px;border-radius:6px;text-align:start; }
.note-date-event>span { flex:1;min-width:0; }
.note-date-event strong,.note-date-event small { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
diff --git a/app/src/renderer/src/useNoteCalendar.ts b/app/src/renderer/src/useNoteCalendar.ts
index 6f97cd38..fee8f5cc 100644
--- a/app/src/renderer/src/useNoteCalendar.ts
+++ b/app/src/renderer/src/useNoteCalendar.ts
@@ -33,7 +33,7 @@ export function useNoteCalendar(m: Meeting) {
if (!enabled) return
let active = true
void Promise.all([
- window.yogurt.calendar.day(at).catch(() => ({ status: 'error' as const, events: [] })),
+ window.yogurt.calendar.day(at, 'link-event').catch(() => ({ status: 'error' as const, events: [] })),
calendarList().catch(() => null),
]).then(([result, list]) => {
if (active) setDetails({ key, result, colors: Object.fromEntries((list?.calendars ?? []).filter(c => /^#[0-9a-f]{6}$/i.test(c.color ?? '')).map(c => [c.id, c.color!])) })
diff --git a/app/src/shared/types.ts b/app/src/shared/types.ts
index c4bb4644..9065069f 100644
--- a/app/src/shared/types.ts
+++ b/app/src/shared/types.ts
@@ -244,7 +244,7 @@ export type YogurtApi = {
/** not asked yet: asks; turned off: opens the Mac's settings */
connect(): Promise<CalendarStatus>
/** the events on the day of this time, earliest first (none without Calendar access) */
- day(at: number): Promise<{ status: CalendarStatus; events: AgendaEvent[] }>
+ day(at: number, purpose?: 'link-event'): Promise<{ status: CalendarStatus; events: AgendaEvent[] }>
/** Windows and Linux: the calendar links connected (never their addresses) */
links(): Promise<CalendarLinkInfo[]>
/** connect a private calendar address; why not when it can't be */
diff --git a/app/test/backup.test.ts b/app/test/backup.test.ts
index 07fdbe8d..66f9640a 100644
--- a/app/test/backup.test.ts
+++ b/app/test/backup.test.ts
@@ -48,6 +48,13 @@ function fill(s: Store, title: string, word: string) {
}
describe('backup merge', () => {
+ it('preserves even an empty attendee list restored from before edit history was recorded', () => {
+ const from = fresh(), into = fresh()
+ const note = from.createMeeting({ ...base, title: 'Old note', startedAt: 1000, attendees: [] })
+ from.db.exec('ALTER TABLE meetings DROP COLUMN keep_attendees')
+ mergeBackup(into.db, from.db)
+ expect(into.meeting(note.id)).toMatchObject({ attendees: [], keepAttendees: true })
+ })
it('a backup from when voices had letters: its lines of the other side come in as Them', () => {
const from = fresh(), into = fresh()
const m = fill(from, 'Old', 'letters')
diff --git a/app/test/calendar.test.ts b/app/test/calendar.test.ts
index 7ab1edd6..9672206b 100644
--- a/app/test/calendar.test.ts
+++ b/app/test/calendar.test.ts
@@ -105,6 +105,21 @@ describe('upcoming', () => {
} finally { rmSync(dir, { recursive: true, force: true }) }
})
+ it.each([true, false])('includes enabled events for manual linking with the call-link filter set to %s', async hideEventsWithoutCallLink => {
+ const base = { start: '2026-11-03T18:00:00Z', end: '2026-11-03T19:00:00Z', calendarId: 'work' }
+ const rows = [
+ { ...base, id: 'call', url: 'https://meet.google.com/abc-defg-hij' },
+ { ...base, id: 'linked' }, { ...base, id: 'busy' },
+ { ...base, id: 'hidden-linked', calendarId: 'hidden' }, { ...base, id: 'hidden-call', calendarId: 'hidden', url: 'https://zoom.us/j/123456789' },
+ ]
+ setHelper(async args => args[0] === 'calendar-status' ? { status: 'granted' } : rows)
+ setCalendarSelection(() => ({ hideEventsWithoutCallLink, hiddenCalendarIds: ['hidden'] }))
+ const ids = (events: { id: string }[]) => events.map(e => e.id)
+ expect(ids(await upcoming(0, 1e12, 'link-event'))).toEqual(['call', 'linked', 'busy'])
+ expect(ids(await upcoming(0, 1e12, e => e.id.endsWith('linked')))).toEqual(hideEventsWithoutCallLink ? ['call', 'linked'] : ['call', 'linked', 'busy'])
+ expect(ids(await upcoming(0, 1e12))).toEqual(hideEventsWithoutCallLink ? ['call'] : ['call', 'linked', 'busy'])
+ })
+
it('keeps noted events by alias only when requested and never restores excluded calendars', async () => {
const row = { id: 'original', externalId: 'event', calendarId: 'work', start: '2026-11-03T18:00:00Z', end: '2026-11-03T19:00:00Z', url: 'https://example.com/document' }
setHelper(async args => args[0] === 'calendar-status' ? { status: 'granted' } : [row, { ...row, id: 'alias' }])
diff --git a/app/test/meeting.test.ts b/app/test/meeting.test.ts
index 906178c5..fcf8fdd3 100644
--- a/app/test/meeting.test.ts
+++ b/app/test/meeting.test.ts
@@ -304,6 +304,37 @@ describe('meeting lifecycle', () => {
expect(store.meeting(m.id)).toMatchObject({ eventId: 'e1', eventStartedAt: event.start, title: 'Design review' })
expect(unlinkEvent(m.id)?.eventStartedAt).toBeUndefined()
})
+ it.each(['generic', 'auto', 'calendar', 'imported'] as const)('adopts the event title on a %s title, including on relink', titleSource => {
+ const m = store.createMeeting({ title: 'Earlier title', titleSource, startedAt: 1, endedAt: 2, eventId: null, app: null, attendees: [], state: 'done' })
+ expect(linkEvent(m.id, { ...event, title: '' })).toMatchObject({ title: m.title, titleSource })
+ expect(linkEvent(m.id, event)).toMatchObject({ title: event.title, titleSource: 'calendar', eventTitle: event.title })
+ const next = { ...event, id: 'new', title: 'New event', attendees: [] }
+ expect(linkEvent(m.id, next)).toMatchObject({ title: next.title, titleSource: 'calendar', eventTitle: next.title, attendees: [] })
+ expect(unlinkEvent(m.id)).toMatchObject({ title: next.title, titleSource: 'calendar' })
+ })
+ it('keeps a manually named note through linking, relinking and unlinking', () => {
+ const m = startMeeting({ title: 'Meeting', event: null, app: null })
+ renameMeeting(m.id, 'Therapy')
+ const title = { title: 'Therapy', titleSource: 'user' }
+ expect(linkEvent(m.id, event)).toMatchObject({ ...title, eventTitle: event.title, eventId: event.id })
+ expect(linkEvent(m.id, { ...event, id: 'busy', title: 'Eric Busy' })).toMatchObject({ ...title, eventTitle: 'Eric Busy', eventId: 'busy' })
+ expect(unlinkEvent(m.id)).toMatchObject({ ...title, eventId: null })
+ expect(store.meeting(m.id)).not.toHaveProperty('eventTitle')
+ })
+ it('keeps a manually edited attendee list, including an intentional empty list', () => {
+ const m = startMeeting({ title: 'Meeting', event: null, app: null })
+ const guests = [{ name: 'Bo', email: null }]
+ setAttendees(m.id, guests)
+ expect(linkEvent(m.id, event)?.attendees).toEqual(guests)
+ setAttendees(m.id, [])
+ expect(unlinkEvent(m.id)?.attendees).toEqual([])
+ expect(linkEvent(m.id, { ...event, id: 'other' })?.attendees).toEqual([])
+ })
+ it.each([null, '[email protected]'])('preserves a person renamed on this note (%s)', email => {
+ const m = prepareMeeting({ ...event, attendees: [{ name: 'Old', email }] })
+ expect(store.renameAttendee(m.id, 0, 'Preferred name')).toBe(true)
+ expect(linkEvent(m.id, { ...event, id: 'other' })?.attendees).toEqual([{ name: 'Preferred name', email }])
+ })
it('relinking an empty prepared note uses the new event end for cleanup', () => {
const day = 86_400_000, now = Date.now()
const m = prepareMeeting({ ...event, start: now - 3 * day, end: now - 3 * day + 1000 })
@@ -363,12 +394,12 @@ it('calendar reads refresh active snapshots without changing manual edits or not
} finally { off() }
})
-it('links an uploaded note to the exact event time, title and people without changing its audio timeline', () => {
+it('links an uploaded note to the event time and people while keeping its title and audio timeline', () => {
const startedAt = +new Date(2026, 10, 16, 9, 15), durationMs = 45 * 60_000
const imported = store.createMeeting({ source: 'audio-file', title: 'Planning audio', titleSource: 'user', startedAt, endedAt: startedAt + durationMs, durationMs, state: 'done', eventId: null, app: null, attendees: [] })
store.setNotes(imported.id, { mine: 'Keep my notes.', enhanced: 'Keep this summary.' })
const invite = { id: 'sample-event', title: 'Project planning', start: +new Date(2026, 10, 16, 9), end: +new Date(2026, 10, 16, 10), attendees: [{ name: 'Alex', email: '[email protected]' }], url: null }
linkEvent(imported.id, invite)
- expect(store.meeting(imported.id)).toMatchObject({ source: 'audio-file', startedAt, durationMs, endedAt: startedAt + durationMs, eventId: invite.id, eventStartedAt: invite.start, eventEndedAt: invite.end, title: invite.title, titleSource: 'calendar', attendees: invite.attendees })
+ expect(store.meeting(imported.id)).toMatchObject({ source: 'audio-file', startedAt, durationMs, endedAt: startedAt + durationMs, eventId: invite.id, eventStartedAt: invite.start, eventEndedAt: invite.end, title: imported.title, titleSource: 'user', eventTitle: invite.title, attendees: invite.attendees })
expect(store.notes(imported.id)).toMatchObject({ mine: 'Keep my notes.', enhanced: 'Keep this summary.' })
})
diff --git a/app/test/noteCalendar.test.ts b/app/test/noteCalendar.test.ts
index 26c520b0..bb1f962b 100644
--- a/app/test/noteCalendar.test.ts
+++ b/app/test/noteCalendar.test.ts
@@ -49,7 +49,7 @@ it('prefetches a complete linked event and color together before the popover is
const { useNoteCalendar } = await import('../src/renderer/src/useNoteCalendar')
const note = renderer(useNoteCalendar)
expect(note.render(meeting).details).toBeUndefined()
- expect(api.day).toHaveBeenCalledWith(at)
+ expect(api.day).toHaveBeenCalledWith(at, 'link-event')
expect(api.list).toHaveBeenCalledOnce()
day.resolve(dayValue); await flush()
expect(note.render(meeting).details).toBeUndefined()
diff --git a/app/test/noteDateCard.test.ts b/app/test/noteDateCard.test.ts
index ae8f295b..4d393b0a 100644
--- a/app/test/noteDateCard.test.ts
+++ b/app/test/noteDateCard.test.ts
@@ -30,7 +30,7 @@ function render(status?: CalendarStatus, { picking = false, linked = false, cale
state.index = 0; state.keyboard = keyboard; state.focusEffect = undefined
const result = status ? { status, events: event ? [event, ...events.filter(e => e.id !== event.id)] : events } : undefined
state.details = linked && result ? { result, colors } : undefined
- state.values = ['keyboard', { value: 'keyboard', pointer: false }, 0, picking, day, status ? { status, events: event ? [event, ...events.filter(e => e.id !== event.id)] : events } : undefined, linking, compact, false, loading ? 'skeleton' : 'waiting', linked ? 'event' : null, Date.now()]
+ state.values = ['keyboard', { value: 'keyboard', pointer: false }, 0, picking, day, result, linking, compact, false, loading ? 'skeleton' : 'waiting', linked ? 'event' : null, Date.now()]
return renderToStaticMarkup(createElement(NoteDate, { m: { ...meeting, ...snapshot, eventId: linked ? 'event' : null } }))
}
@@ -41,7 +41,7 @@ it.each([
] as const)('keeps date and duration with a normal recovery action for %s', (status, message, action) => {
for (const picking of [false, true]) {
const html = render(status, { picking })
- expect(html).toContain('Tuesday, Nov 10')
+ expect(html).toContain('Tuesday, November 10')
expect(html).toContain('7 min')
expect(html).toContain(message.replaceAll("'", '&#x27;'))
expect(html).toContain(`class="workspace-button">${action}</button>`)
@@ -51,10 +51,24 @@ it.each([
expect(html).not.toContain('class="underline"')
}
})
+it.each([null, 'event'])('keeps the recording date inside the sole picker trigger (event %s)', eventId => {
+ state.values = []
+ state.index = 0
+ const nextDay = +new Date(2026, 10, 11, 12)
+ state.details = undefined
+ const m = { ...meeting, eventId, eventTitle: 'Launch planning', eventStartedAt: eventId ? nextDay : null }
+ const html = renderToStaticMarkup(createElement(NoteDate, { m }))
+ const buttons = html.match(/<button\b[^>]*>[\s\S]*?<\/button>/g) ?? []
+ expect(buttons).toHaveLength(1)
+ expect(buttons[0]).toContain('aria-haspopup="dialog"')
+ expect(buttons[0]?.replace(/<[^>]*>/g, '')).toBe(eventId ? 'Tue, Nov 10 · Launch planning' : 'Tue, Nov 10')
+})
+
it('shows empty-day choices and navigation immediately', () => {
const html = render('granted')
expect(html).not.toContain('7 min')
- expect(html).toContain('No events')
+ expect(html.match(/>No events</g)).toHaveLength(1)
+ expect(html).not.toContain('No event linked')
expect(html).not.toContain('Link to a calendar event')
expect(html).not.toContain('note-date-events-toggle')
expect(html).toContain('data-testid="note-date-events"')
@@ -73,6 +87,31 @@ it('keeps the unlinked picker ordered and separate from unlinking', () => {
expect(html).not.toContain('note-date-unlink')
expect(render('denied', { picking: true, linked: true })).toContain('note-date-unlink')
})
+it.each([1, 3])('shows title, time and calendar without guests for %i choices', count => {
+ const events = Array.from({ length: count }, (_, i) => ({
+ id: String(i), title: `Planning ${i}`, start: at, end: at + 3_600_000,
+ calendar: { id: 'work', name: 'Work', source: 'Account' }, attendees: [{ name: 'Avery Guest', email: '[email protected]' }], url: null,
+ }))
+ const html = render('granted', { events })
+ expect(html.match(/>Work<\/small>/g)).toHaveLength(count)
+ for (const event of events) expect(html).toContain(`>${event.title}</strong>`)
+ expect(html).not.toMatch(/Avery|[email protected]/)
+})
+it('shows a choice on a one-event day and only the event details once linked', () => {
+ const event = { id: 'event', title: 'Eric Busy', start: at, end: at + 3_600_000, attendees: [], url: null }
+ const choose = render('granted', { events: [event] })
+ expect(choose).not.toContain('No event linked')
+ expect(choose).toContain('Select calendar event')
+ expect(choose).toContain('lucide-plus')
+ expect(choose).not.toMatch(/aria-(checked|selected)="true"|Linked event|note-date-unlink/)
+ for (const html of [choose, render('granted')]) expect(html).not.toContain('Only calendars enabled in Settings appear here.')
+ const linked = render('granted', { linked: true, event, picking: true, snapshot: { title: 'Therapy' } })
+ expect(linked).not.toMatch(/Linked event|lucide-check/)
+ expect(linked).toContain('Eric Busy')
+ expect(linked).toContain('Unlink calendar event')
+ expect(linked).not.toContain('No event linked')
+})
+
it('shows loading without a premature connect action and omits controls on unsupported computers', () => {
expect(render()).not.toContain('Looking at your calendar…')
expect(render()).not.toContain('Connect calendar')
@@ -89,7 +128,7 @@ it('uses existing short translations for every recovery and empty state in all 3
expect(LOCALES).toHaveLength(32)
for (const { id } of LOCALES) {
setLanguage(id)
- for (const key of ['Calendar access is off', "Yogurt couldn't read your calendar", 'Connect calendar', 'Open System Settings', 'Try again', 'No events', 'Previous day', 'Next day']) {
+ for (const key of ['Calendar access is off', "Yogurt couldn't read your calendar", 'Connect calendar', 'Open System Settings', 'Try again', 'No events', 'Select calendar event', 'Previous day', 'Next day']) {
expect(t(key)).toBeTruthy()
expect(t(key)).not.toMatch(/[::—\n]/)
if (id !== 'en') expect(t(key)).not.toBe(key)
@@ -101,19 +140,22 @@ it('shows the selected date once with day buttons and no close button', () => {
const day = +new Date(2026, 10, 11, 12, 24)
const html = render('granted', { picking: true, day })
const header = html.match(/<div class="agenda-inspector-heading">[\s\S]*?<\/h3>[\s\S]*?<\/div><\/div>/)?.[0] ?? ''
- expect(header).toContain('Wednesday, Nov 11')
+ expect(header).toContain('Wednesday, November 11')
expect(header).toContain('aria-live="polite"')
expect(header).toContain('note-date-previous')
expect(header.indexOf('note-date-previous')).toBeLessThan(header.indexOf('note-date-next'))
expect(html).not.toContain('note-date-close')
expect(html).not.toContain('aria-label="Close"')
- expect(html.match(/>Wednesday, Nov 11<\/h3>/g)).toHaveLength(1)
- expect(html).not.toContain('Tuesday, Nov 10')
+ expect(html.match(/>Wednesday, November 11<\/h3>/g)).toHaveLength(1)
+ expect(html).not.toContain('Tuesday, November 10')
expect(html).not.toContain('note-date-days')
})
-it('keeps the date on the chip when linked and locks unlinked navigation while linking', () => {
- const html = render('granted', { linked: true })
- expect(html).not.toContain('note-date-heading')
+it('heads the linked card with the event day and keeps navigation in the unlinked picker', () => {
+ const start = +new Date(2026, 10, 11, 12)
+ const snapshot = { eventStartedAt: start, eventTitle: 'Eric Busy', eventCalendarName: 'Work' }
+ const html = render('granted', { linked: true, snapshot })
+ expect(html).toMatch(/>Tue, Nov 10<.*>Eric Busy<\/span><\/button>/)
+ expect(html).toMatch(/>Wednesday, November 11<\/h3>.*>Eric Busy<\/strong>.*>Work</)
expect(html).not.toContain('note-date-next')
expect(html).not.toContain('note-date-previous')
expect(html).toContain('note-date-events-toggle')
@@ -121,10 +163,26 @@ it('keeps the date on the chip when linked and locks unlinked navigation while l
for (const direction of ['previous', 'next']) expect(busy).toMatch(new RegExp(`data-testid="note-date-${direction}"[^>]*disabled=""`))
})
+it('uses the live event title for the pill and tooltip, including calendar aliases', () => {
+ const title = 'Launch planning and coordination with the international operations team'
+ const event = { id: 'canonical', aliases: ['event'], title, start: at, end: at + 3_600_000, attendees: [], url: null }
+ const html = render('granted', { linked: true, event, snapshot: { title: 'Therapy', eventTitle: 'Old name' } })
+ expect(html).toContain(`title="${title}" data-testid="note-date"`)
+ expect(html).toContain(`class="note-date-chip-name" dir="auto">${title}</span>`)
+ expect(html).toContain(`<strong dir="auto">${title}</strong>`)
+ expect(html.indexOf('class="note-date-color')).toBeLessThan(html.indexOf('class="note-date-identity"'))
+ expect(html).not.toMatch(/Old name|Therapy|data-testid="note-date-heading"/)
+})
+it('uses the localized meeting label when an untitled event is linked to a manually named note', () => {
+ const html = render('denied', { linked: true, snapshot: { title: 'Therapy', titleSource: 'user', eventTitle: '' } })
+ expect(html).toContain('title="Meeting" data-testid="note-date"')
+ expect(html).not.toContain('Therapy')
+})
+
it('places the linked actions directly under the title before details and access recovery', () => {
const event = { id: 'event', title: 'Planning', start: at, end: at + 1_800_000, attendees: [], url: null }
for (const status of ['granted', 'denied'] as const) {
- const html = render(status, { linked: true, picking: true, events: [event, { ...event, id: 'alias', aliases: ['event'] }], event: status === 'granted' ? event : null })
+ const html = render(status, { linked: true, picking: true, snapshot: { eventTitle: 'Planning' }, events: [event, { ...event, id: 'alias', aliases: ['event'] }], event: status === 'granted' ? event : null })
expect(html.match(/>Planning<\/strong>/g)).toHaveLength(1)
expect(html).not.toContain('data-event-id="event"')
expect(html).not.toContain('data-event-id="alias"')
@@ -149,7 +207,7 @@ it('keeps the year for dates outside the current year', () => {
it('uses an abbreviated weekday while retaining the full accessible date when space is tight', () => {
setLanguage('pt-BR')
const html = render('granted', { picking: true, day: +new Date(2025, 2, 24), compact: true })
- expect(html).toContain('aria-label="segunda-feira, 24 de mar. de 2025"')
+ expect(html).toContain('aria-label="segunda-feira, 24 de março de 2025"')
expect(html).toContain('>seg., 24 de mar. de 2025</h3>')
})
@@ -226,7 +284,9 @@ it('joins calendar color by id without a grey fallback and keeps the active call
vi.setSystemTime(at)
const event = { id: 'event', title: 'Planning', start: at, end: at + 1_800_000, attendees: [], url: 'https://call.example/meeting', calendar: { id: 'work', name: 'Work', source: 'Account' } }
const html = render('granted', { linked: true, event, colors: { work: '#438879', other: '#112233' } })
- expect(html).toContain('background-color:#438879')
+ expect(html).toContain('aria-label="Today Planning"')
+ expect(html).toContain('<span aria-hidden="true" class="note-date-chip-dot" style="background-color:#438879"></span>')
+ expect(html).toContain('class="note-date-color note-date-reveal" data-ready="true" aria-hidden="true" style="background-color:#438879"')
expect(html).toContain('href="https://call.example/meeting"')
expect(html).toContain('Join meeting')
expect(html).toContain('class="note-date-actions" aria-busy="false"')
@@ -234,6 +294,9 @@ it('joins calendar color by id without a grey fallback and keeps the active call
expect(html).not.toContain('Open calendar')
const missing = render('granted', { linked: true, event, colors: { other: '#112233' } })
expect(missing).toContain('class="note-date-color note-date-reveal" data-ready="false"')
+ expect(missing).toContain('<span aria-hidden="true"> · </span>')
+ expect(missing).toContain('aria-label="Today Planning"')
+ expect(missing).not.toContain('note-date-chip-dot')
expect(missing).not.toContain('background-color:var(--muted)')
})
diff --git a/app/test/noteDateRead.test.ts b/app/test/noteDateRead.test.ts
index d32e47d7..474dc521 100644
--- a/app/test/noteDateRead.test.ts
+++ b/app/test/noteDateRead.test.ts
@@ -42,15 +42,19 @@ function setup(day: ReturnType<typeof vi.fn>, onClose = vi.fn()) {
vi.stubGlobal('requestAnimationFrame', vi.fn())
vi.stubGlobal('window', { yogurt: { capabilities: { calendar: true }, calendar: { day, onChange: () => () => {} } }, matchMedia: () => ({ matches: false, addEventListener() {}, removeEventListener() {} }), addEventListener() {}, removeEventListener() {} })
h.details = undefined
- h.values = ['pointer']; h.index = 0
- const first = NoteDate({ m: linked }) as any
- const cardElement = first.props.children[1]
- h.index = 0
- expect((NoteDate({ m: unlinked }) as any).props.children[1].key).toBe(cardElement.key)
+ function cardFor(m: Meeting) {
+ const cardState = h.values
+ h.values = ['pointer']; h.index = 0
+ const card = (NoteDate({ m }) as any).props.children[1]
+ h.values = cardState
+ return card
+ }
+ expect(cardFor(unlinked).key).toBe(cardFor(linked).key)
h.values = []; h.effects.clear()
return (m: Meeting) => {
+ const card = cardFor(m)
let tree: any
- do { h.dirty = false; h.index = 0; h.pending = []; tree = cardElement.type({ ...cardElement.props, m, details: m.eventId ? h.details : undefined, chip: { current: null }, onClose }) } while (h.dirty)
+ do { h.dirty = false; h.index = 0; h.pending = []; tree = card.type({ ...card.props, chip: { current: null }, onClose }) } while (h.dirty)
for (const effect of h.pending) {
const old = h.effects.get(effect.index)
if (!old || !effect.deps || effect.deps.some((dep: unknown, i: number) => !Object.is(dep, old.deps?.[i]))) {
@@ -211,7 +215,7 @@ it('opens choices on the note day, browses another day and keeps empty days navi
tree = render(unlinked)
expect(picker(tree).props.day).toBe(nextDay)
expect(picker(tree).props.result.events).toEqual([other])
- expect(byId(tree, 'note-date-heading').props['aria-label']).toContain('Nov 11')
+ expect(byId(tree, 'note-date-heading').props['aria-label']).toContain('November 11')
byId(tree, 'note-date-next').props.onClick({ detail: 1 })
render(unlinked)
await Promise.resolve(); await Promise.resolve()
@@ -229,7 +233,7 @@ it('opens an uploaded note on its inferred start day and offers that day’s cal
render(imported)
await vi.advanceTimersByTimeAsync(0)
const choices = picker(render(imported))
- expect(day).toHaveBeenCalledWith(startedAt)
+ expect(day).toHaveBeenCalledWith(startedAt, 'link-event')
expect(choices.props.day).toBe(startedAt)
expect(choices.props.result.events).toEqual([dayEvent])
})
diff --git a/app/test/store.test.ts b/app/test/store.test.ts
index 1e646650..0ede884d 100644
--- a/app/test/store.test.ts
+++ b/app/test/store.test.ts
@@ -486,7 +486,7 @@ it('migrates old meetings with nullable snapshot columns and preserves them acro
expect(schema.find(c => c.name === name)).toMatchObject({ notnull: 0, dflt_value: null })
expect(row[name]).toBeNull()
}
- expect(migrated.meeting('old')).toMatchObject({ title: 'My old note', startedAt: 50, eventId: 'event', eventStartedAt: 100 })
+ expect(migrated.meeting('old')).toMatchObject({ title: 'My old note', keepAttendees: true, attendees: [], startedAt: 50, eventId: 'event', eventStartedAt: 100 })
expect(migrated.meeting('old')).not.toHaveProperty('eventEndedAt')
migrated.rememberEvent({ id: 'event', title: 'Event', start: 100, end: 200, attendees: [], url: null, calendar: { id: 'work', name: 'Work', source: 'Calendar' } })
} finally { migrated.close() }