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.
TypeScript ai-meeting-assistantai-notetakerelectrongranola-alternativelinuxllama-cpplocal-ailocal-firstmacosmcpmeeting-minutesmeeting-notesoffline-firstopen-sourceprivacyspeech-to-texttranscriptionwhisperwhisper-cppwindows
Notes: the date popover shows the date once with day arrows, offers only Unlink for a linked event, and closes like People
Eric Brownrout5237c1fad114
diff --git a/app/e2e/noteDateStates.spec.ts b/app/e2e/noteDateStates.spec.tsnew file mode 100644index 00000000..5f4a2026--- /dev/null+++ b/app/e2e/noteDateStates.spec.ts@@ -0,0 +1,82 @@+import { _electron as electron, expect, test } from '@playwright/test'+import { mkdtempSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { join } from 'node:path'++for (const theme of ['light', 'dark'] as const) for (const status of ['notDetermined', 'denied', 'error', 'granted'] as const) {+ test(`date popover recovers from ${status} (${theme})`, async () => {+ const app = await electron.launch({ args: [join(import.meta.dirname, '../out/main/index.js')], env: {+ ...process.env, YOGURT_FAKE: '1', YOGURT_FAKE_CALENDAR: status,+ YOGURT_USER_DATA: mkdtempSync(join(tmpdir(), 'yogurt-date-states-')),+ } })+ try {+ const page = await app.firstWindow()+ await expect(page.getByTestId('home')).toBeVisible()+ await app.evaluate(() => {+ const fake = (globalThis as any).__fake__+ fake.manyMeetings({ n: 1, clean: true }); fake.calendarEvents([])+ })+ await page.evaluate(theme => window.yogurt.settings.setTheme(theme), theme)+ await page.reload()+ await page.getByTestId('past-note').click()+ await page.getByTestId('note-date').click()+ const card = page.getByTestId('note-date-card')+ await expect(card.getByRole('button', { name: 'Close', exact: true })).toHaveCount(0)+ await expect(card).toContainText('25 min')+ if (status !== 'granted') await expect(card.getByTestId('note-date-previous')).toHaveCount(0)+ await expect(card.getByTestId('note-date-heading')).toBeVisible()+ const label = status === 'error' ? 'Try again' : status === 'denied' ? 'Open System Settings' : status === 'notDetermined' ? 'Connect calendar' : 'Link event'+ const action = card.getByRole('button', { name: label, exact: true })+ await expect(action).toHaveClass('workspace-button agenda-open-note')+ await expect(action).toHaveCSS('height', '28px')+ if (status === 'denied') {+ await action.click()+ await expect.poll(() => app.evaluate(() => (globalThis as any).__fake__.main().settingsOpened)).toBe(1)+ await expect(card).toContainText('Calendar access is off')+ await app.evaluate(() => (globalThis as any).__fake__.calendarStatus('granted'))+ await page.evaluate(() => window.dispatchEvent(new Event('focus')))+ } else if (status === 'error') {+ await expect(card).toContainText("Yogurt couldn't read your calendar")+ await app.evaluate(() => (globalThis as any).__fake__.calendarStatus('granted'))+ await action.click()+ } else if (status === 'notDetermined') {+ await expect(card).toContainText('Calendar access is off')+ await action.click()+ }+ await expect(card.getByTestId('note-date-events-none')).toHaveText('No events')+ await card.getByTestId('note-date-events-toggle').press('Enter')+ await expect(card.getByTestId('note-date-previous')).toBeFocused()+ const header = card.locator('.agenda-inspector-heading')+ const meetingDay = await header.getByTestId('note-date-heading').textContent()+ await expect(header.getByTestId('note-date-previous')).toBeVisible()+ await expect(header.getByTestId('note-date-next')).toBeVisible()+ await expect(card.locator('.note-date-days')).toHaveCount(0)+ const headingBounds = await header.getByTestId('note-date-heading').boundingBox()+ for (const id of ['note-date-previous', 'note-date-next']) {+ const bounds = await header.getByTestId(id).boundingBox()+ expect(Math.abs(bounds!.y - headingBounds!.y)).toBeLessThan(8)+ }+ await header.getByTestId('note-date-next').press('Enter')+ await expect(header.getByTestId('note-date-heading')).not.toHaveText(meetingDay!)+ await expect(card.getByTestId('note-date-events-none')).toBeVisible()+ await header.getByTestId('note-date-previous').press('Enter')+ await expect(header.getByTestId('note-date-heading')).toHaveText(meetingDay!)+ // Revoking access while browsing restores the date/time layout and removes the header arrows.+ await app.evaluate(() => {+ const fake = (globalThis as any).__fake__+ fake.calendarStatus('denied'); fake.calendarEvents([])+ })+ await page.evaluate(() => window.dispatchEvent(new Event('focus')))+ await expect(card.getByRole('button', { name: 'Open System Settings' })).toBeFocused()+ await expect(card).toContainText('25 min')+ await expect(card.getByTestId('note-date-next')).toHaveCount(0)+ await page.keyboard.press('Escape')+ await expect(page.getByTestId('note-date')).toBeFocused()+ await page.getByTestId('note-date').press('Enter')+ await expect(card).toBeVisible()+ await page.getByTestId('note-title').dispatchEvent('pointerdown')+ await expect(card).toHaveCount(0)+ await expect(page.getByTestId('note-date')).toBeFocused()+ } finally { await app.close() }+ })+}diff --git a/app/e2e/peopleCalendar.spec.ts b/app/e2e/peopleCalendar.spec.tsindex 15b07050..9ffdc294 100644--- a/app/e2e/peopleCalendar.spec.ts+++ b/app/e2e/peopleCalendar.spec.ts@@ -33,15 +33,15 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers stawait expect(page.getByTestId('people-card')).not.toContainText('Who was there')await page.keyboard.press('Escape')await page.getByTestId('note-date').click()- await page.getByTestId('note-date-events-toggle').click()+ await page.getByTestId('note-date-events-toggle').press('Enter')await expect(page.getByTestId('note-date-event').first()).toBeFocused()await expect(page.getByTestId('note-date-event').first()).toContainText('Jamie')- // An event disappearing between listing and selection must be a retryable error.- await app.evaluate(() => (globalThis as any).__fake__.calendarEvents([]))+ // 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 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((_e, events) => (globalThis as any).__fake__.calendarEvents(events), events)+ 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 expect(date).toContainText('Work')@@ -53,6 +53,21 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers stawait expect(date.locator('.agenda-inspector-actions')).toHaveCSS('justify-content', 'flex-end')await expect(date.getByTestId('people-list')).toHaveCount(0)await page.getByTestId('note-date-events-toggle').click()+ await expect(page.getByTestId('note-date-unlink')).not.toBeFocused()+ await expect(date.getByTestId('note-date-event')).toHaveCount(0)+ await expect(date).not.toContainText('Switch to')+ await expect(date.getByTestId('note-date-unlink')).toContainText('Keep the title, attendees and notes.')+ const linkedDay = await date.getByTestId('note-date-heading').textContent()+ await page.getByTestId('note-date-next').click()+ await expect(date.getByTestId('note-date-heading')).not.toHaveText(linkedDay!)+ await page.getByTestId('note-date-events-toggle').click()+ await expect(date.getByTestId('note-date-heading')).toHaveText(linkedDay!)+ await page.getByTestId('note-date-events-toggle').press('Enter')+ await expect(date.getByTestId('note-date-unlink')).toBeFocused()+ await date.getByTestId('note-date-unlink').press('Enter')+ await expect(date.getByTestId('note-date-events-toggle')).toHaveText('Link event')+ await expect(date.getByTestId('note-date-event')).toHaveCount(0)+ await page.getByTestId('note-date-events-toggle').press('Enter')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')@@ -61,11 +76,20 @@ for (const theme of ['light', 'dark'] as const) test(`split metadata popovers stawait page.getByTestId('note-date').click()await expect(date).toContainText('Next day review')await expect(date).not.toContainText('Calendar event unavailable')+ await app.evaluate(() => (globalThis as any).__fake__.calendarStatus('denied'))+ 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('[email protected]')+ await app.evaluate(() => (globalThis as any).__fake__.calendarStatus('granted'))+ await page.evaluate(() => window.dispatchEvent(new Event('focus')))+ await expect(date.getByTestId('note-date-next')).toBeVisible()await page.getByTestId('note-date-events-toggle').click()await page.getByTestId('note-date-previous').click()- await expect(page.getByTestId('note-date-event').first()).toContainText('Planning with Jamie')+ await expect(date.getByTestId('note-date-event')).toHaveCount(0)await page.getByTestId('note-date-unlink').click()- await expect(page.getByTestId('note-date-events-toggle')).toHaveText('Link to a calendar event')+ await expect(page.getByTestId('note-date-events-toggle')).toHaveText('Link event')await expect(page.getByTestId('note-date-events-toggle')).toHaveClass('workspace-button agenda-open-note')await expect(page.getByTestId('note-title')).toHaveText('Next day review')expect((await page.evaluate(id => window.yogurt.meetings.get(id), meeting.id))?.startedAt).toBe(meeting.startedAt)diff --git a/app/src/main/index.ts b/app/src/main/index.tsindex d1377547..b2874341 100644--- a/app/src/main/index.ts+++ b/app/src/main/index.ts@@ -42,7 +42,7 @@ import { calendars, eventIds, matchesEvent, setCalendarSelection, calendarStatusimport { createSignals } from './detectSignals'import { Watcher } from './watch'import { createPrompts } from './prompts'-import { activeMeeting, bindMeetingApp, getMeeting, initMeetings, onMeetingChange, onMeetingStart, onMeetingStop, onMeetingStopSaved, linkEvent, unlinkEvent, prepareMeeting, startPreparedMeeting, resumeMeeting, pauseMeetingClock, renameMeeting, retryStopSave, setAttendees, startMeeting, stopMeeting, stopSavePending, withStopState } from './meeting'+import { activeMeeting, bindMeetingApp, getMeeting, initMeetings, onMeetingChange, onMeetingStart, onMeetingStop, onMeetingStopSaved, refreshEventSnapshots, linkEvent, unlinkEvent, prepareMeeting, startPreparedMeeting, resumeMeeting, pauseMeetingClock, renameMeeting, retryStopSave, setAttendees, startMeeting, stopMeeting, stopSavePending, withStopState } from './meeting'import { deleteMeeting } from './deleteMeeting'import { emptyTrash, moveToTrash, purgeTrash } from './trash'import { isId, text } from './ipcArgs'@@ -246,18 +246,24 @@ 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): Promise<CalEvent[]> {+ const events = await upcoming(from, to)+ refreshEventSnapshots(events)+ return events+}+/** What is still to come today and tomorrow (meetings on now included), soonest first */async function comingUp(): Promise<CalEvent[]> {const now = isFake() ? fakeNow() : Date.now()const end = new Date(now); end.setDate(end.getDate() + 2); end.setHours(0, 0, 0, 0)- return (await upcoming(now, end.getTime())).filter((e) => e.end > now && e.start < end.getTime()).sort((a, b) => a.start - b.start)+ return (await readCalendar(now, end.getTime())).filter((e) => e.end > now && e.start < end.getTime()).sort((a, b) => a.start - b.start)}/** The events on the day of this time, earliest first */async function eventsOn(at: number): 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 upcoming(from.getTime(), to.getTime())).sort((a, b) => a.start - b.start)+ return (await readCalendar(from.getTime(), to.getTime())).sort((a, b) => a.start - b.start)}/** the Mac's full name: who "You" is unless Settings says otherwise (fake mode: a fixed one) */@@ -276,7 +282,7 @@ let indexerRef: { schedule(): Promise<unknown> } | undefined/** Notice calls, offer to take notes, stop when the call ends (or ask, with that setting off). Starts nothing without a click. */function startDetection() {if (isFake()) setHelper(fakeHelper)- const signals = createSignals({ helper: runHelper, events: upcoming })+ const signals = createSignals({ helper: runHelper, events: readCalendar })refreshCalendarConsumers = () => signals.invalidateCalendar()const now = isFake() ? fakeNow : Date.nowconst watcher: Watcher = new Watcher({diff --git a/app/src/main/meeting.ts b/app/src/main/meeting.tsindex 67b9ac41..50d6d4e9 100644--- a/app/src/main/meeting.ts+++ b/app/src/main/meeting.ts@@ -56,12 +56,15 @@ export function startMeeting(p: { title: string; event: CalEvent | null; app: stif (!store) throw new Error('Meetings are not ready yet')if (active) return activeconst existing = p.event && eventIds(p.event).map((id) => store!.meetingForEvent(id)).find(Boolean)+ if (existing) refreshEventSnapshots([p.event!])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)+ if (existing) return withStopState(store.meeting(existing.id)!)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,+ ...(p.event ? { eventStartedAt: p.event.start, eventEndedAt: p.event.end, eventTitle: p.event.title,+ ...(p.event.calendar ? { eventCalendarName: p.event.calendar.name, eventCalendarSource: p.event.calendar.source } : {}) } : {}),app: p.app, attendees: p.event?.attendees ?? [], state: 'recording',})active = m@@ -80,10 +83,11 @@ export function bindMeetingApp(id: string, app: string): Meeting | undefined {export function prepareMeeting(event: CalEvent): Meeting {if (!store) throw new Error('Meetings are not ready yet')const existing = eventIds(event).map((id) => store!.meetingForEvent(id)).find(Boolean)- if (existing) return existing+ if (existing) { refreshEventSnapshots([event]); return store.meeting(existing.id)! }const m = store.createMeeting({title: event.title || t('Meeting'), titleSource: 'calendar', startedAt: event.start, endedAt: null,- eventId: event.id, app: null, attendees: event.attendees, state: 'prepared',+ eventId: event.id, eventStartedAt: event.start, eventEndedAt: event.end, eventTitle: event.title,+ ...(event.calendar ? { eventCalendarName: event.calendar.name, eventCalendarSource: event.calendar.source } : {}), app: null, attendees: event.attendees, state: 'prepared',})store.markPrepared(m.id, event.end)run(changes, m)@@ -196,13 +200,26 @@ export function linkEvent(id: string, event: CalEvent): Meeting | undefined {const meeting = store?.meeting(id)if (!store || !meeting) return undefinedif (meeting.state === 'prepared') store.markPrepared(id, event.end)- return update(id, { eventId: event.id, eventStartedAt: event.start, 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, eventCalendarName: event.calendar?.name ?? null, eventCalendarSource: event.calendar?.source ?? null, title: event.title || meeting.title, ...(event.title ? { titleSource: 'calendar' as const } : {}), attendees: event.attendees })+}++/** Reading a calendar updates its snapshot, never the person's title, attendees or notes. */+export function refreshEventSnapshots(events: CalEvent[]) {+ if (!store) return+ for (const event of events) {+ try {+ for (const m of store.rememberEvent(event)) {+ if (active?.id === m.id) active = m+ run(changes, m)+ }+ } catch (e) { console.warn('could not save calendar snapshot', e) }+ }}/** Remove only the calendar association; the title, people and notes belong to the person now. */export function unlinkEvent(id: string): Meeting | undefined {if (!store || !store.meeting(id)) return undefined- return update(id, { eventId: null, eventStartedAt: null })+ return update(id, { eventId: null, eventStartedAt: null, eventEndedAt: null, eventTitle: null, eventCalendarName: null, eventCalendarSource: null })}function update(id: string, patch: Partial<Omit<Meeting, 'id'>>): Meeting {diff --git a/app/src/main/store.ts b/app/src/main/store.tsindex a2047025..6f0b00c4 100644--- a/app/src/main/store.ts+++ b/app/src/main/store.ts@@ -1,3 +1,4 @@+import { eventIds, type CalEvent } from './calendar'import { matchSearchPeople, searchPersonKey, uniqueSearchPeople } from '../shared/searchPeople'import { oneEdit, parseSearchQuery, type SearchOptions } from '../shared/searchQuery'import { echoConfidence } from './asr/echo'@@ -19,6 +20,11 @@ export type Meeting = {id: string; title: string; startedAt: number; endedAt: number | null; eventId: string | null/** Calendar lookup date can differ from the recording date after manual linking. */eventStartedAt?: number | null+ /** Last successfully read calendar details remain available without calendar access. */+ eventEndedAt?: number | null+ eventTitle?: string | null+ eventCalendarName?: string | null+ eventCalendarSource?: string | nullsource?: stringsourceId?: stringapp: string | null; attendees: Person[]; state: 'prepared' | 'recording' | 'stopped' | 'done'@@ -52,6 +58,10 @@ const toMeeting = (r: Row): Meeting => ({...(r.source == null ? {} : { source: String(r.source) }),...(r.source_id == null ? {} : { sourceId: String(r.source_id) }),...(r.event_started_at == null ? {} : { eventStartedAt: Number(r.event_started_at) }),+ ...(r.event_ended_at == null ? {} : { eventEndedAt: Number(r.event_ended_at) }),+ ...(r.event_title == null ? {} : { eventTitle: String(r.event_title) }),+ ...(r.event_calendar_name == null ? {} : { eventCalendarName: String(r.event_calendar_name) }),+ ...(r.event_calendar_source == null ? {} : { eventCalendarSource: String(r.event_calendar_source) }),...(r.duration_ms == null ? {} : { durationMs: Number(r.duration_ms) }),...(r.trashed_at == null ? {} : { trashedAt: Number(r.trashed_at) }),})@@ -146,6 +156,7 @@ export class Store {id TEXT PRIMARY KEY, title TEXT NOT NULL, started_at INTEGER NOT NULL, ended_at INTEGER, event_id TEXT, app TEXT,attendees TEXT NOT NULL DEFAULT '[]', state TEXT NOT NULL, language TEXT);CREATE INDEX IF NOT EXISTS meetings_started ON meetings(started_at);+ CREATE INDEX IF NOT EXISTS meetings_event ON meetings(event_id);CREATE TABLE IF NOT EXISTS segments (id INTEGER PRIMARY KEY AUTOINCREMENT, meeting_id TEXT NOT NULL REFERENCES meetings(id) ON DELETE CASCADE,track TEXT NOT NULL, start_ms INTEGER NOT NULL, end_ms INTEGER NOT NULL, text TEXT NOT NULL, speaker TEXT);@@ -195,6 +206,9 @@ export class Store {if (!meetingCols.includes('last_opened_at')) this.db.exec('ALTER TABLE meetings ADD COLUMN last_opened_at INTEGER')if (!meetingCols.includes('speaker_order')) this.db.exec("ALTER TABLE meetings ADD COLUMN speaker_order TEXT NOT NULL DEFAULT '[]'")for (const name of ['source', 'source_id']) if (!meetingCols.includes(name)) this.db.exec(`ALTER TABLE meetings ADD COLUMN ${name} TEXT`)+ for (const [name, type] of [['event_ended_at', 'INTEGER'], ['event_title', 'TEXT'], ['event_calendar_name', 'TEXT'], ['event_calendar_source', 'TEXT']]) {+ if (!meetingCols.includes(name)) this.db.exec(`ALTER TABLE meetings ADD COLUMN ${name} ${type}`)+ }if (!meetingCols.includes('event_started_at')) this.db.exec('ALTER TABLE meetings ADD COLUMN event_started_at INTEGER')if (!meetingCols.includes('transcription_pending')) this.db.exec('ALTER TABLE meetings ADD COLUMN transcription_pending INTEGER NOT NULL DEFAULT 0')if (!meetingCols.includes('duration_ms')) this.db.exec('ALTER TABLE meetings ADD COLUMN duration_ms INTEGER')@@ -271,19 +285,29 @@ export class Store {const id = randomUUID()const language = m.language ?? nullconst 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) 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)+ 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) 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)rememberPeople(this.db, m.attendees)return { ...m, id, language, titleSource, attendees: resolvePeople(this.db, m.attendees) }}updateMeeting(id: string, patch: Partial<Omit<Meeting, 'id'>>) {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', app: 'app', attendees: 'attendees', state: 'state', language: 'language', titleSource: 'title_source', durationMs: 'duration_ms', transcriptionPending: 'transcription_pending' }+ 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', app: 'app', attendees: 'attendees', state: 'state', language: 'language', titleSource: 'title_source', durationMs: 'duration_ms', transcriptionPending: 'transcription_pending' }const keys = Object.keys(patch).filter((k) => k in col && (patch as Row)[k] !== undefined)if (!keys.length) returnconst vals = keys.map((k) => (k === 'attendees' ? JSON.stringify(patch.attendees) : k === 'transcriptionPending' ? Number(patch.transcriptionPending) : (patch as Row)[k]) 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. */+ rememberEvent(event: CalEvent): Meeting[] {+ const ids = eventIds(event)+ const values = [event.start, event.end, event.title, event.calendar?.name ?? null, event.calendar?.source ?? null]+ const columns = ['event_started_at', 'event_ended_at', 'event_title', 'event_calendar_name', 'event_calendar_source']+ const rows = this.db.prepare(`UPDATE meetings SET ${columns.map(c => `${c} = ?`).join(', ')}+ WHERE event_id IN (${ids.map(() => '?').join(', ')}) AND (${columns.map(c => `${c} IS NOT ?`).join(' OR ')}) RETURNING *`)+ .all(...values, ...ids, ...values) as Row[]+ return rows.map(r => this.readMeeting(r))+ }/** Gone for good: its lines, notes and chat go with it (ON DELETE CASCADE; the search tables follow by trigger) */markPrepared(id: string, end: number) { this.db.prepare('UPDATE meetings SET prepared_event_end = ?, last_opened_at = ? WHERE id = ?').run(end, Date.now(), id) }noteOpened(id: string) { this.db.prepare('UPDATE meetings SET last_opened_at = ? WHERE id = ?').run(Date.now(), id) }diff --git a/app/src/renderer/src/components/NoteDate.tsx b/app/src/renderer/src/components/NoteDate.tsxindex 946463f3..ac44bfa5 100644--- a/app/src/renderer/src/components/NoteDate.tsx+++ b/app/src/renderer/src/components/NoteDate.tsx@@ -1,11 +1,12 @@import { usePopoverPresence } from '../motion'-import { useCallback, useEffect, useRef, useState, type RefObject } from 'react'+import { Component, createRef, useCallback, useEffect, useLayoutEffect, useRef, useState, type ReactNode, type RefObject } from 'react'import { ScrollFade } from './ScrollFade'-import { CalendarDays, Check, ChevronDown, ChevronLeft, ChevronRight, Clock, ExternalLink, Link2, Link2Off, X } from 'lucide-react'+import { CalendarDays, ChevronDown, ChevronLeft, ChevronRight, Clock, ExternalLink, Link2, Link2Off } from 'lucide-react'import type { CalEvent, CalendarStatus, Meeting } from '../../../shared/types'import { language, t } from '../../../shared/i18n'import { noteDateLabel, timeOf } from '../dates'import { useNotePopover } from '../useNotePopover'+import { useLoadingState } from '../useLoadingState'import { nearestEvents, shiftCalendarDay } from '../../../shared/calendarPicker'import { peopleSummary, useMyName } from './People'@@ -13,13 +14,13 @@ export function NoteDate({ m }: { m: Meeting }) {const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)const presence = usePopoverPresence(open, open === 'pointer')const chip = useRef<HTMLButtonElement>(null)- const close = useCallback((restore = true) => { setOpen(false); if (restore) chip.current?.focus({ preventScroll: true }) }, [])+ 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)}</button>- {presence.value && <DateCard key={`${m.id}/${m.eventId}`} m={m} chip={chip} motionProps={presence.props} onClose={close} />}+ {presence.value && <DateCard key={m.id} m={m} chip={chip} motionProps={presence.props} onClose={close} />}</div>}@@ -28,88 +29,158 @@ function DateCard({ m, chip, motionProps, onClose }: { m: Meeting; chip: RefObje// no calendar on this computer (Windows, Linux): the date and length only, as for a note with no eventconst calendar = window.yogurt.capabilities.calendarconst linked = calendar && !!m.eventId- const [event, setEvent] = useState<CalEvent | null>()const [revision, setRevision] = useState(0)const [picking, setPicking] = useState(false)+ const [day, setDay] = useState(m.eventStartedAt ?? m.startedAt)+ const [result, setResult] = useState<Awaited<ReturnType<typeof window.yogurt.calendar.day>>>()+ const [linking, setLinking] = useState(false)+ const heading = useRef<HTMLHeadingElement>(null)+ const [compactDate, setCompactDate] = useState(false)+ const loadingPhase = useLoadingState(calendar && !result)+ const pickerKeyboard = useRef(false)+ const previous = useRef<HTMLButtonElement>(null)const toggle = useRef<HTMLButtonElement>(null)+ const recovery = useRef<HTMLButtonElement>(null)useNotePopover(card, chip, onClose, !motionProps.inert)+ const days = useRef(new Map<string, Awaited<ReturnType<typeof window.yogurt.calendar.day>>>())+ const [selection, setSelection] = useState(m.eventId)+ // Keep the card mounted, but never commit the previous link's picker or day.+ if (selection !== m.eventId) {+ const nextDay = m.eventStartedAt ?? m.startedAt+ setSelection(m.eventId); setPicking(false); setDay(nextDay)+ setResult(days.current.get(new Date(nextDay).toDateString()))+ }useEffect(() => {- if (!linked) return+ if (!calendar) returnlet active = true- setEvent(undefined)- void window.yogurt.calendar.day(m.eventStartedAt ?? m.startedAt).then(day => {- if (active) setEvent(day.status === 'granted' ? day.events.find(e => e.id === m.eventId || e.aliases?.includes(m.eventId!)) ?? null : null)- }, () => { if (active) setEvent(null) })+ void window.yogurt.calendar.day(day).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)+ setResult(value)+ })return () => { active = false }- }, [linked, m.eventId, m.eventStartedAt, m.startedAt, revision])- const at = event?.start ?? m.startedAt+ }, [calendar, day, revision])+ const browse = (nextDay: number) => {+ setResult(days.current.get(new Date(nextDay).toDateString()))+ setDay(nextDay)+ }+ 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) return+ const refresh = () => setRevision(n => n + 1)+ const off = window.yogurt.calendar.onChange(refresh)+ window.addEventListener('focus', refresh)+ return () => { off(); window.removeEventListener('focus', refresh) }+ }, [calendar])+ const connect = () => void window.yogurt.calendar.connect().then(() => setRevision(n => n + 1), () => setResult({ status: 'error', events: [] }))+ const available = result?.status === 'granted'+ const browsing = picking && (!result || available)+ useEffect(() => {+ if (picking && pickerKeyboard.current && !linked && result && !available) recovery.current?.focus({ preventScroll: true })+ }, [picking, linked, result, available])+ const otherDay = new Date(day).toDateString() !== new Date(m.eventStartedAt ?? m.startedAt).toDateString()+ const at = event?.start ?? (linked ? m.eventStartedAt : null) ?? m.startedAt+ const eventEnd = event?.end ?? (linked ? m.eventEndedAt : null)+ const eventCalendar = event?.calendar ?? (linked && m.eventCalendarName ? { name: m.eventCalendarName, source: m.eventCalendarSource } : null)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 url = event?.url?.trim()- return <div ref={card} data-testid="note-date-card" {...motionProps} data-anchor="start" role="dialog" aria-label={t('Date')}+ const date = new Date(browsing ? day : at)+ const dateOptions: Intl.DateTimeFormatOptions = { month: 'short', day: 'numeric', ...(date.getFullYear() === new Date().getFullYear() ? {} : { year: 'numeric' }) }+ const fullDate = date.toLocaleDateString(language(), { ...dateOptions, weekday: 'long' })+ const shortDate = date.toLocaleDateString(language(), { ...dateOptions, weekday: 'short' })+ useLayoutEffect(() => {+ const el = heading.current+ if (!el) return+ const context = document.createElement('canvas').getContext('2d')!+ const measure = () => {+ context.font = getComputedStyle(el).font+ setCompactDate(context.measureText(fullDate).width > el.clientWidth)+ }+ measure()+ const observer = new ResizeObserver(measure)+ observer.observe(el)+ return () => observer.disconnect()+ }, [fullDate])+ 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>+ </div>+ </div>+ return <div ref={card} data-testid="note-date-card" {...motionProps} data-anchor="start" data-picking={picking} role="dialog" aria-label={t('Date')}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(); onClose() } }}>- <div className="agenda-inspector-content">+ <NoteDateBody view={`${m.eventId ?? 'unlinked'}/${!linked && picking ? 'picker' : 'details'}/${result?.status ?? (loadingPhase === 'skeleton' ? 'skeleton' : 'waiting')}`}><div className="agenda-inspector-heading">- <h3 data-testid="note-date-heading" tabIndex={linked ? undefined : -1}>{linked- ? <button ref={toggle} data-testid="note-date-events-toggle" className="note-date-event-toggle" aria-expanded={picking} onClick={() => setPicking(v => !v)}><span>{event?.title || m.title}</span><ChevronDown size={15} aria-hidden="true" /></button>- : new Date(at).toLocaleDateString(language(), { weekday: 'long', month: 'short', day: 'numeric', year: 'numeric' })}</h3>- <button className="workspace-icon" data-testid="note-date-close" aria-label={t('Close')} onClick={() => onClose()}><X size={16} aria-hidden="true" /></button>+ <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 || browsing) && <>+ <button type="button" ref={previous} className="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="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>- {!picking && <><div className="agenda-inspector-line"><Clock size={15} aria-hidden="true" /><div>- <p>{timeOf(at)}{event ? ` – ${timeOf(event.end)}` : ` · ${t('{count} min', { count: minutes })}`}</p>- {linked && <p className="agenda-inspector-muted">{new Date(at).toLocaleDateString(language(), { weekday: 'long', month: 'short', day: 'numeric' })}</p>}+ {linked && <div className="note-date-linked">+ <button ref={toggle} data-testid="note-date-events-toggle" className="note-date-event-toggle text-sm font-medium" aria-expanded={picking} disabled={linking} onClick={e => { pickerKeyboard.current = e.detail === 0; if (otherDay) { browse(m.eventStartedAt ?? m.startedAt); setPicking(false) } else setPicking(v => !v) }}><span>{event?.title || m.eventTitle || m.title}</span><ChevronDown size={15} aria-hidden="true" /></button>+ <div className="accordion note-date-motion note-date-picker-motion" data-open={picking} aria-hidden={!picking} inert={!picking}>+ <div><div className="note-date-picker-space"><EventPicker keyboard={pickerKeyboard.current} open={picking} m={m} day={day} result={result} loading={loading} previous={toggle} linking={linking} onLinking={setLinking} onLinked={() => requestAnimationFrame(() => toggle.current?.focus({ preventScroll: true }))} /></div></div>+ </div>+ </div>}+ {(!browsing || linked) && <div className="accordion note-date-motion note-date-details-motion" data-open={true}><div><div className="note-date-details"><div className="agenda-inspector-line"><Clock size={15} aria-hidden="true" /><div>+ <p>{timeOf(at)}{eventEnd != null ? ` – ${timeOf(eventEnd)}` : ` · ${t('{count} min', { count: minutes })}`}</p></div></div>- {linked && !event && <p role="status" className="text-xs text-muted">{event === undefined ? t('Looking at your calendar…') : t('Calendar event unavailable')}- {event === null && <button className="ms-2 underline" onClick={() => setRevision(n => n + 1)}>{t('Try again')}</button>}+ {linked && available && event === null && <p role="status" className="text-xs text-muted">{t('Calendar event unavailable')}+ <button className="ms-2 underline" onClick={() => setRevision(n => n + 1)}>{t('Try again')}</button></p>}- {event && (event.calendar || url) && <div className="agenda-inspector-footer">- {event.calendar && <div className="agenda-inspector-line"><CalendarDays size={15} aria-hidden="true" /><p>{event.calendar.name}<span className="agenda-inspector-muted">{event.calendar.source}</span></p></div>}+ {(eventCalendar || url) && <div className="agenda-inspector-footer">+ {eventCalendar && <div className="agenda-inspector-line"><CalendarDays size={15} aria-hidden="true" /><p>{eventCalendar.name}<span className="agenda-inspector-muted">{eventCalendar.source}</span></p></div>}{url && <div className="agenda-inspector-actions"><a className="workspace-button agenda-open-note" title={t('Join meeting')} href={url} target="_blank" rel="noreferrer"><span>{t('Join meeting')}</span><ExternalLink size={12} aria-hidden="true" /></a></div>}</div>}- {calendar && !m.eventId && <div className="agenda-inspector-actions"><button ref={toggle} data-testid="note-date-events-toggle" className="workspace-button agenda-open-note" title={t('Link to a calendar event')} aria-expanded={picking} onClick={() => setPicking(true)}><Link2 size={13} aria-hidden="true" /><span>{t('Link to a calendar event')}</span></button></div>}+ </div></div></div>}+ {calendar && result?.status !== 'unsupported' && !browsing && <>+ {!result ? loading+ : !available ? <div className="flex flex-wrap items-center gap-x-3 gap-y-2">+ <p role="status" className="text-xs text-muted">{result.status === 'error' ? t("Yogurt couldn't read your calendar") : t('Calendar access is off')}</p>+ <div className="agenda-inspector-actions"><button ref={recovery} className="workspace-button agenda-open-note" onClick={result.status === 'error' ? () => setRevision(n => n + 1) : connect}>{result.status === 'error' ? t('Try again') : result.status === 'denied' ? t('Open System Settings') : t('Connect calendar')}</button></div>+ </div>+ : !linked && <div className="note-date-empty-row">+ {!result.events.length && <p role="status" className="text-xs text-muted" data-testid="note-date-events-none" title={t('No events')}>{t('No events')}</p>}+ <div className="ms-auto flex shrink-0"><button ref={toggle} data-testid="note-date-events-toggle" className="workspace-button agenda-open-note" title={t('Link to a calendar event')} aria-expanded={browsing} onClick={e => { pickerKeyboard.current = e.detail === 0; setPicking(true) }}><Link2 size={13} aria-hidden="true" /><span>{t('Link event')}</span></button></div>+ </div>}</>}- {picking && <EventPicker m={m} onLinked={() => { setPicking(false); toggle.current?.focus({ preventScroll: true }) }} />}- </div>+ {picking && !linked && <EventPicker keyboard={pickerKeyboard.current} m={m} day={day} result={result} loading={loading} previous={previous} linking={linking} onLinking={setLinking} onLinked={() => requestAnimationFrame(() => toggle.current?.focus({ preventScroll: true }))} />}+ </NoteDateBody></div>}-function EventPicker({ m, onLinked }: { m: Meeting; onLinked: () => void }) {- const [day, setDay] = useState(m.eventStartedAt ?? m.startedAt)- const [result, setResult] = useState<{ status: CalendarStatus; events: CalEvent[] }>()- const [revision, setRevision] = useState(0)- const [linking, setLinking] = useState(false), [linkError, setLinkError] = useState(false)+function EventPicker({ open = true, keyboard, m, day, result, loading, previous, linking, onLinking, onLinked }: { open?: boolean; keyboard: boolean; m: Meeting; day: number; result: { status: CalendarStatus; events: CalEvent[] } | undefined; loading: ReactNode; previous: RefObject<HTMLButtonElement | null>; linking: boolean; onLinking: (linking: boolean) => void; onLinked: () => void }) {+ const [linkError, setLinkError] = useState(false)const list = useRef<HTMLDivElement>(null)- const previous = useRef<HTMLButtonElement>(null)+ const unlink = useRef<HTMLButtonElement>(null)const me = useMyName()useEffect(() => {- let active = true- setResult(undefined)- void window.yogurt.calendar.day(day).then(value => {- if (active) setResult({ ...value, events: nearestEvents(value.events, m.startedAt) })- }, () => { if (active) setResult({ status: 'error', events: [] }) })- return () => { active = false }- }, [day, revision, m.startedAt])- useEffect(() => {+ if (!open) returnif (list.current) list.current.scrollTop = 0- ;(list.current?.querySelector<HTMLButtonElement>('[data-event-id]') ?? previous.current)?.focus({ preventScroll: true })- }, [result])+ if (keyboard) (list.current?.querySelector<HTMLButtonElement>('[data-event-id]') ?? unlink.current ?? previous.current)?.focus({ preventScroll: true })+ }, [open, keyboard, result, previous])+ useEffect(() => { if (open) setLinkError(false) }, [open])const link = async (eventId: string | null) => {if (linking) return- setLinking(true); setLinkError(false)+ onLinking(true); setLinkError(false)try { await window.yogurt.meetings.linkEvent(m.id, eventId, day); onLinked() }catch { setLinkError(true) }- finally { setLinking(false) }+ finally { onLinking(false) }}- const connect = () => void window.yogurt.calendar.connect().then(() => setRevision(n => n + 1), () => setResult({ status: 'error', events: [] }))+ const events = result?.eventsreturn <div className="note-date-picker">- <div className="note-date-days">- <button type="button" ref={previous} className="workspace-icon" data-testid="note-date-previous" aria-label={t('Previous day')} disabled={linking} onClick={() => setDay(d => shiftCalendarDay(d, -1))}><ChevronLeft size={15} aria-hidden="true" /></button>- <span aria-live="polite">{new Date(day).toLocaleDateString(language(), { weekday: 'short', month: 'short', day: 'numeric', year: 'numeric' })}</span>- <button type="button" className="workspace-icon" data-testid="note-date-next" aria-label={t('Next day')} disabled={linking} onClick={() => setDay(d => shiftCalendarDay(d, 1))}><ChevronRight size={15} aria-hidden="true" /></button>- </div>- <ScrollFade enabled={!!result?.events.length}><div ref={list} data-testid="note-date-events" className="note-date-events" role="group" aria-label={t('Select calendar event')} onKeyDown={e => {+ {!m.eventId && (!result || result.status === 'granted') && <ScrollFade enabled={!!events?.length}><div ref={list} data-testid="note-date-events" className="note-date-events" role="group" aria-label={t('Select calendar event')} onKeyDown={e => {if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(e.key)) returnconst rows = Array.from(e.currentTarget.querySelectorAll<HTMLButtonElement>('button[data-event-id]:not(:disabled)'))if (!rows.length) return@@ -118,15 +189,57 @@ function EventPicker({ m, onLinked }: { m: Meeting; onLinked: () => void }) {const next = e.key === 'Home' ? 0 : e.key === 'End' ? rows.length - 1 : (index + (e.key === 'ArrowDown' ? 1 : -1) + rows.length) % rows.lengthrows[next].focus({ preventScroll: true }); rows[next].scrollIntoView({ block: 'nearest', container: 'nearest' } as ScrollIntoViewOptions)}}>- {!result ? <p role="status">{t('Looking at your calendar…')}</p>- : result.status !== 'granted' ? <div className="note-date-calendar-error"><p>{result.status === 'error' ? t("Yogurt couldn't read your calendar") : t('Calendar access is off')}</p><button className="underline" onClick={result.status === 'error' ? () => setRevision(n => n + 1) : connect}>{result.status === 'error' ? t('Try again') : t('Connect calendar')}</button></div>- : !result.events.length ? <p data-testid="note-date-events-none">{t('No calendar events on this day.')}</p>- : result.events.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)}>+ {!result ? loading+ : !result.events.length ? <p data-testid="note-date-events-none" title={t('No events')}>{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>- {(m.eventId === e.id || e.aliases?.includes(m.eventId!)) && <Check size={14} aria-hidden="true" />}</button>)}- </div></ScrollFade>- {m.eventId && <button 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>}+ </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>}{linkError && <p role="alert" className="text-xs text-danger">{t("Yogurt couldn't update the calendar link. Try again.")}</p>}</div>}++// Capture before DOM changes so the exit copy never remounts React controls or their effects.+type DateBodySnapshot = { height: number; copy: HTMLDivElement } | null+export class NoteDateBody extends Component<{ view: string; children: ReactNode }> {+ private shell = createRef<HTMLDivElement>()+ private body = createRef<HTMLDivElement>()+ private animations: Animation[] = []+ private copy: HTMLDivElement | null = null+ private stop = () => {+ this.animations.forEach(animation => animation.cancel())+ this.animations = []+ this.copy?.remove(); this.copy = null+ }+ getSnapshotBeforeUpdate(previous: Readonly<{ view: string; children: ReactNode }>): DateBodySnapshot {+ const shell = this.shell.current, body = this.body.current+ if (previous.view === this.props.view || !shell || !body || window.matchMedia('(prefers-reduced-motion: reduce)').matches || !parseFloat(getComputedStyle(shell).getPropertyValue('--note-date-ms'))) return null+ const copy = body.cloneNode(true) as HTMLDivElement+ copy.inert = true; copy.setAttribute('aria-hidden', 'true')+ copy.querySelectorAll('[id],[data-testid],[autofocus]').forEach(node => { node.removeAttribute('id'); node.removeAttribute('data-testid'); node.removeAttribute('autofocus') })+ copy.classList.add('note-date-retiring')+ return { height: shell.getBoundingClientRect().height, copy }+ }+ componentDidUpdate(_previous: unknown, _state: unknown, snapshot: DateBodySnapshot) {+ if (!snapshot) {+ if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) this.stop()+ return+ }+ this.stop()+ const shell = this.shell.current!, body = this.body.current!+ this.copy = snapshot.copy+ shell.append(snapshot.copy)+ const style = getComputedStyle(shell)+ const options = { duration: parseFloat(style.getPropertyValue('--note-date-ms')), easing: style.getPropertyValue('--note-date-ease').trim() }+ const animations = [+ shell.animate([{ height: `${snapshot.height}px` }, { height: `${body.getBoundingClientRect().height}px` }], options),+ body.animate([{ opacity: 0 }, { opacity: 1 }], options),+ snapshot.copy.animate([{ opacity: 1 }, { opacity: 0 }], options),+ ]+ this.animations = animations+ void Promise.all(animations.map(animation => animation.finished)).then(() => { if (this.animations === animations) this.stop() }, () => {})+ }+ componentWillUnmount() { this.stop() }+ render() { return <div ref={this.shell} className="note-date-swap"><div ref={this.body} className="agenda-inspector-content">{this.props.children}</div></div> }+}diff --git a/app/src/renderer/src/styles.css b/app/src/renderer/src/styles.cssindex 534ad4db..c05273d2 100644--- a/app/src/renderer/src/styles.css+++ b/app/src/renderer/src/styles.css@@ -730,21 +730,39 @@ 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-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; }+.note-date-retiring,.note-date-retiring * { animation:none!important;transition:none!important; }+@media (prefers-reduced-motion:reduce) { .note-date-card { --note-date-ms:0ms; } }+.note-date-card .agenda-inspector-heading h3 { flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }+.note-date-linked { display:flex;flex-direction:column; }+.note-date-picker-space { padding-top:8px; }+.note-date-motion,.note-date-motion[data-open=true] { transition:grid-template-rows var(--note-date-ms) var(--note-date-ease),margin-top var(--note-date-ms) var(--note-date-ease); }+.note-date-motion>* { filter:none;transition:opacity var(--note-date-ms) var(--note-date-ease),visibility 0s var(--note-date-ms); }+.note-date-motion[data-open=true]>* { filter:none;transition:opacity var(--note-date-ms) var(--note-date-ease),visibility 0s; }+/* Cancel the parent's row gap as the compact switcher replaces the details. */+.note-date-details-motion[data-open=false] { margin-top:-16px; }+.note-date-linked .note-date-picker { border:1px solid var(--line);border-radius:6px;padding:4px;background:var(--card); }+.note-date-details { display:flex;flex-direction:column;gap:16px; }+.note-date-empty-row { display:flex;align-items:center;justify-content:space-between;gap:8px;white-space:nowrap; }+.note-date-empty-row>p { min-width:0;overflow:hidden;text-overflow:ellipsis; }+.note-date-event-toggle[aria-expanded=true]>svg { transform:rotate(180deg); }.note-date-event-toggle { display:flex;align-items:center;gap:8px;width:100%;text-align:start;border-radius:4px; }-.note-date-event-toggle>span { flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis; }-.note-date-event-toggle>svg { flex:none;color:var(--muted); }+.note-date-event-toggle>span { white-space:nowrap;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis; }+.note-date-event-toggle>svg { flex:none;color:var(--muted);transition:transform var(--note-date-ms) var(--note-date-ease); }+@media (prefers-reduced-motion:reduce) { .note-date-motion,.note-date-motion[data-open=true],.note-date-motion>*,.note-date-motion[data-open=true]>*,.note-date-event-toggle>svg { transition:none; } }.note-date-link { display:flex;align-items:center;gap:8px;width:100%;padding:8px;border-radius:6px;text-align:start;font-size:12px;color:var(--muted); }.note-date-link:hover,.note-date-event:hover { background:var(--card);color:var(--ink); }+.note-date-card .note-date-picker button:focus-visible { outline-offset:-2px; }.note-date-link small { display:block;margin-top:3px;font-size:11px; }-.note-date-days { display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;font-size:12px; }.note-date-events { max-height:240px;overflow-y:auto;overscroll-behavior:contain; }-.note-date-events>p,.note-date-calendar-error { padding:12px 8px;font-size:12px;color:var(--muted); }+.note-date-events>p { padding:12px 8px;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; }.note-date-event strong { font-size:13px;font-weight:500; }.note-date-event small { margin-top:3px;font-size:11px;color:var(--muted); }-.note-date-event>svg { flex:none;color:var(--accent); }/* Data changes opacity, never the geometry of its reading surface. */diff --git a/app/src/shared/locales/ar.json b/app/src/shared/locales/ar.jsonindex 25cfca47..a4f9cae8 100644--- a/app/src/shared/locales/ar.json+++ b/app/src/shared/locales/ar.json@@ -1,4 +1,6 @@{+ "Link event": "ربط حدث",+ "No events": "لا أحداث","Go to {date}": "انتقل إلى {date}","Resume notes · {title}": "متابعة تدوين الملاحظات · {title}","Take notes · {title}": "تدوين الملاحظات · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "تعذّر على Yogurt تحديث رابط التقويم. حاول مرة أخرى.","Keep the title, attendees and notes.": "الاحتفاظ بالعنوان والحضور والملاحظات.","Unlink calendar event": "إلغاء ربط حدث التقويم",- "No calendar events on this day.": "لا أحداث في التقويم في هذا اليوم.","Select calendar event": "اختيار حدث من التقويم","(me)": "(أنا)","A folder keeps related meetings together. A meeting can be in more than one.": "يجمع المجلد الاجتماعات المترابطة معًا. يمكن أن يكون الاجتماع في أكثر من مجلد.",diff --git a/app/src/shared/locales/bn.json b/app/src/shared/locales/bn.jsonindex 5b65f6e1..667bb4ef 100644--- a/app/src/shared/locales/bn.json+++ b/app/src/shared/locales/bn.json@@ -1,4 +1,6 @@{+ "Link event": "ইভেন্ট লিঙ্ক করুন",+ "No events": "কোনো ইভেন্ট নেই","Go to {date}": "{date} তারিখে যান","Resume notes · {title}": "নোট নেওয়া চালিয়ে যান · {title}","Take notes · {title}": "নোট নিন · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt ক্যালেন্ডারের লিংক আপডেট করতে পারেনি। আবার চেষ্টা করুন।","Keep the title, attendees and notes.": "শিরোনাম, অংশগ্রহণকারী ও নোট রাখুন।","Unlink calendar event": "ক্যালেন্ডার ইভেন্টের সংযোগ সরান",- "No calendar events on this day.": "এই দিনে কোনো ক্যালেন্ডার ইভেন্ট নেই।","Select calendar event": "ক্যালেন্ডার ইভেন্ট বেছে নিন","(me)": "(আমি)","A folder keeps related meetings together. A meeting can be in more than one.": "ফোল্ডার সম্পর্কিত মিটিংগুলো একসাথে রাখে। একটি মিটিং একাধিক ফোল্ডারে থাকতে পারে।",diff --git a/app/src/shared/locales/cs.json b/app/src/shared/locales/cs.jsonindex 8088c22b..5a424a49 100644--- a/app/src/shared/locales/cs.json+++ b/app/src/shared/locales/cs.json@@ -1,4 +1,6 @@{+ "Link event": "Propojit událost",+ "No events": "Žádné události","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}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt nemohl aktualizovat propojení s kalendářem. Zkuste to znovu.","Keep the title, attendees and notes.": "Zachovat název, účastníky a poznámky.","Unlink calendar event": "Odpojit událost z kalendáře",- "No calendar events on this day.": "V tento den nejsou žádné události.","Select calendar event": "Vybrat událost z kalendáře","(me)": "(já)","A folder keeps related meetings together. A meeting can be in more than one.": "Složka drží související schůzky pohromadě. Schůzka může být ve více složkách.",diff --git a/app/src/shared/locales/da.json b/app/src/shared/locales/da.jsonindex 1ebb6a00..56c50de1 100644--- a/app/src/shared/locales/da.json+++ b/app/src/shared/locales/da.json@@ -1,4 +1,6 @@{+ "Link event": "Tilknyt begivenhed",+ "No events": "Ingen begivenheder","Go to {date}": "Gå til {date}","Resume notes · {title}": "Fortsæt noter · {title}","Take notes · {title}": "Tag noter · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt kunne ikke opdatere koblingen til kalenderen. Prøv igen.","Keep the title, attendees and notes.": "Behold titel, deltagere og noter.","Unlink calendar event": "Fjern kobling til kalenderbegivenhed",- "No calendar events on this day.": "Ingen kalenderbegivenheder denne dag.","Select calendar event": "Vælg kalenderbegivenhed","(me)": "(mig)","A folder keeps related meetings together. A meeting can be in more than one.": "En mappe holder møder, der hører sammen, samlet. Et møde kan ligge i flere mapper.",diff --git a/app/src/shared/locales/de.json b/app/src/shared/locales/de.jsonindex bb4aa08e..8e8618a8 100644--- a/app/src/shared/locales/de.json+++ b/app/src/shared/locales/de.json@@ -1,4 +1,6 @@{+ "Link event": "Termin verknüpfen",+ "No events": "Keine Termine","Go to {date}": "Zum {date} springen","Resume notes · {title}": "Notizen fortsetzen · {title}","Take notes · {title}": "Notizen machen · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt konnte die Kalenderverknüpfung nicht aktualisieren. Versuch es noch einmal.","Keep the title, attendees and notes.": "Titel, Teilnehmende und Notizen behalten.","Unlink calendar event": "Kalendertermin trennen",- "No calendar events on this day.": "An diesem Tag gibt es keine Termine.","Select calendar event": "Kalendertermin auswählen","(me)": "(ich)","A folder keeps related meetings together. A meeting can be in more than one.": "Ein Ordner hält zusammengehörige Meetings beisammen. Ein Meeting kann in mehreren sein.",diff --git a/app/src/shared/locales/el.json b/app/src/shared/locales/el.jsonindex 0ed9eb62..4e846eb2 100644--- a/app/src/shared/locales/el.json+++ b/app/src/shared/locales/el.json@@ -1,4 +1,6 @@{+ "Link event": "Σύνδεση συμβάντος",+ "No events": "Κανένα συμβάν","Go to {date}": "Μετάβαση στις {date}","Resume notes · {title}": "Συνέχιση σημειώσεων · {title}","Take notes · {title}": "Κράτηση σημειώσεων · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Το Yogurt δεν μπόρεσε να ενημερώσει τη σύνδεση με το ημερολόγιο. Δοκιμάστε ξανά.","Keep the title, attendees and notes.": "Διατήρηση τίτλου, συμμετεχόντων και σημειώσεων.","Unlink calendar event": "Αποσύνδεση συμβάντος ημερολογίου",- "No calendar events on this day.": "Κανένα συμβάν αυτή την ημέρα.","Select calendar event": "Επιλογή συμβάντος ημερολογίου","(me)": "(εγώ)","A folder keeps related meetings together. A meeting can be in more than one.": "Ένας φάκελος κρατά μαζί σχετικές συσκέψεις. Μια σύσκεψη μπορεί να είναι σε περισσότερους από έναν.",diff --git a/app/src/shared/locales/en.json b/app/src/shared/locales/en.jsonindex 421aa99c..6db7a0f7 100644--- a/app/src/shared/locales/en.json+++ b/app/src/shared/locales/en.json@@ -1,4 +1,6 @@{+ "Link event": "Link event",+ "No events": "No events","Go to {date}": "Go to {date}","Previous day": "Previous day","Next day": "Next day",diff --git a/app/src/shared/locales/es.json b/app/src/shared/locales/es.jsonindex 08ee8e84..7185563f 100644--- a/app/src/shared/locales/es.json+++ b/app/src/shared/locales/es.json@@ -1,4 +1,6 @@{+ "Link event": "Vincular evento",+ "No events": "No hay eventos","Go to {date}": "Ir al {date}","Resume notes · {title}": "Continuar tomando notas · {title}","Take notes · {title}": "Tomar notas · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt no pudo actualizar el vínculo con el calendario. Inténtalo de nuevo.","Keep the title, attendees and notes.": "Conservar el título, los asistentes y las notas.","Unlink calendar event": "Desvincular evento del calendario",- "No calendar events on this day.": "No hay eventos este día.","Select calendar event": "Elegir evento del calendario","(me)": "(yo)","A folder keeps related meetings together. A meeting can be in more than one.": "Una carpeta reúne reuniones relacionadas. Una reunión puede estar en más de una.",diff --git a/app/src/shared/locales/fi.json b/app/src/shared/locales/fi.jsonindex 4f360708..27d4ec77 100644--- a/app/src/shared/locales/fi.json+++ b/app/src/shared/locales/fi.json@@ -1,4 +1,6 @@{+ "Link event": "Liitä tapahtuma",+ "No events": "Ei tapahtumia","Go to {date}": "Siirry päivään {date}","Resume notes · {title}": "Jatka muistiinpanoja · {title}","Take notes · {title}": "Tee muistiinpanoja · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt ei voinut päivittää kalenterilinkkiä. Yritä uudelleen.","Keep the title, attendees and notes.": "Säilytä otsikko, osallistujat ja muistiinpanot.","Unlink calendar event": "Irrota kalenteritapahtuma",- "No calendar events on this day.": "Tälle päivälle ei ole tapahtumia.","Select calendar event": "Valitse kalenteritapahtuma","(me)": "(minä)","A folder keeps related meetings together. A meeting can be in more than one.": "Kansio pitää toisiinsa liittyvät kokoukset yhdessä. Kokous voi olla useammassa kansiossa.",diff --git a/app/src/shared/locales/fil.json b/app/src/shared/locales/fil.jsonindex adde20d6..b8238562 100644--- a/app/src/shared/locales/fil.json+++ b/app/src/shared/locales/fil.json@@ -1,4 +1,6 @@{+ "Link event": "I-link ang event",+ "No events": "Walang event","Go to {date}": "Pumunta sa {date}","Resume notes · {title}": "Ipagpatuloy ang mga tala · {title}","Take notes · {title}": "Mag-note · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Hindi ma-update ng Yogurt ang link sa calendar. Subukan ulit.","Keep the title, attendees and notes.": "Panatilihin ang pamagat, mga kalahok at mga note.","Unlink calendar event": "Alisin ang link sa event ng calendar",- "No calendar events on this day.": "Walang event sa araw na ito.","Select calendar event": "Pumili ng event sa calendar","(me)": "(ako)","A folder keeps related meetings together. A meeting can be in more than one.": "Pinagsasama-sama ng folder ang magkakaugnay na meeting. Puwedeng nasa higit sa isang folder ang isang meeting.",diff --git a/app/src/shared/locales/fr.json b/app/src/shared/locales/fr.jsonindex 913d5db3..54844c33 100644--- a/app/src/shared/locales/fr.json+++ b/app/src/shared/locales/fr.json@@ -1,4 +1,6 @@{+ "Link event": "Lier un événement",+ "No events": "Aucun événement","Go to {date}": "Aller au {date}","Resume notes · {title}": "Reprendre les notes · {title}","Take notes · {title}": "Prendre des notes · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt n’a pas pu mettre à jour le lien avec le calendrier. Réessayez.","Keep the title, attendees and notes.": "Garder le titre, les participants et les notes.","Unlink calendar event": "Dissocier l’événement du calendrier",- "No calendar events on this day.": "Aucun événement ce jour-là.","Select calendar event": "Choisir un événement du calendrier","(me)": "(moi)","A folder keeps related meetings together. A meeting can be in more than one.": "Un dossier regroupe des réunions liées. Une réunion peut se trouver dans plusieurs dossiers.",diff --git a/app/src/shared/locales/he.json b/app/src/shared/locales/he.jsonindex e0802bdb..2a628cb6 100644--- a/app/src/shared/locales/he.json+++ b/app/src/shared/locales/he.json@@ -1,4 +1,6 @@{+ "Link event": "קישור אירוע",+ "No events": "אין אירועים","Go to {date}": "מעבר אל {date}","Resume notes · {title}": "המשך כתיבת הערות · {title}","Take notes · {title}": "רישום הערות · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt לא הצליח לעדכן את הקישור ליומן. כדאי לנסות שוב.","Keep the title, attendees and notes.": "לשמור את הכותרת, המשתתפים וההערות.","Unlink calendar event": "ניתוק אירוע היומן",- "No calendar events on this day.": "אין אירועים ביום הזה.","Select calendar event": "בחירת אירוע ביומן","(me)": "(אני)","A folder keeps related meetings together. A meeting can be in more than one.": "תיקייה מרכזת פגישות קשורות. פגישה יכולה להיות ביותר מתיקייה אחת.",diff --git a/app/src/shared/locales/hi.json b/app/src/shared/locales/hi.jsonindex 7d909465..c72e8275 100644--- a/app/src/shared/locales/hi.json+++ b/app/src/shared/locales/hi.json@@ -1,4 +1,6 @@{+ "Link event": "इवेंट लिंक करें",+ "No events": "कोई इवेंट नहीं","Go to {date}": "{date} पर जाएँ","Resume notes · {title}": "नोट्स लेना जारी रखें · {title}","Take notes · {title}": "नोट्स लें · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt कैलेंडर लिंक अपडेट नहीं कर सका। फिर से कोशिश करें।","Keep the title, attendees and notes.": "टाइटल, भाग लेने वाले और नोट्स रखें।","Unlink calendar event": "कैलेंडर इवेंट से अलग करें",- "No calendar events on this day.": "इस दिन कोई कैलेंडर इवेंट नहीं है।","Select calendar event": "कैलेंडर इवेंट चुनें","(me)": "(मैं)","A folder keeps related meetings together. A meeting can be in more than one.": "फ़ोल्डर जुड़ी हुई मीटिंग्स को साथ रखता है। एक मीटिंग एक से ज़्यादा फ़ोल्डर में हो सकती है।",diff --git a/app/src/shared/locales/hu.json b/app/src/shared/locales/hu.jsonindex c73d000e..84c231ca 100644--- a/app/src/shared/locales/hu.json+++ b/app/src/shared/locales/hu.json@@ -1,4 +1,6 @@{+ "Link event": "Esemény csatolása",+ "No events": "Nincs esemény","Go to {date}": "Ugrás erre a napra: {date}","Resume notes · {title}": "Jegyzetelés folytatása · {title}","Take notes · {title}": "Jegyzetelés · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "A Yogurt nem tudta frissíteni a naptárkapcsolatot. Próbáld újra.","Keep the title, attendees and notes.": "A cím, a résztvevők és a jegyzetek megtartása.","Unlink calendar event": "Naptáresemény leválasztása",- "No calendar events on this day.": "Ezen a napon nincs esemény.","Select calendar event": "Naptáresemény kiválasztása","(me)": "(én)","A folder keeps related meetings together. A meeting can be in more than one.": "A mappa egyben tartja az összetartozó megbeszéléseket. Egy megbeszélés több mappában is lehet.",diff --git a/app/src/shared/locales/id.json b/app/src/shared/locales/id.jsonindex c94d41b8..2cbdb206 100644--- a/app/src/shared/locales/id.json+++ b/app/src/shared/locales/id.json@@ -1,4 +1,6 @@{+ "Link event": "Tautkan acara",+ "No events": "Tidak ada acara","Go to {date}": "Buka tanggal {date}","Resume notes · {title}": "Lanjutkan catatan · {title}","Take notes · {title}": "Catat · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt tidak bisa memperbarui tautan kalender. Coba lagi.","Keep the title, attendees and notes.": "Pertahankan judul, peserta, dan catatan.","Unlink calendar event": "Lepaskan tautan acara kalender",- "No calendar events on this day.": "Tidak ada acara kalender pada hari ini.","Select calendar event": "Pilih acara kalender","(me)": "(saya)","A folder keeps related meetings together. A meeting can be in more than one.": "Folder menyatukan rapat yang saling terkait. Satu rapat bisa ada di lebih dari satu folder.",diff --git a/app/src/shared/locales/it.json b/app/src/shared/locales/it.jsonindex 193ea6df..627f2801 100644--- a/app/src/shared/locales/it.json+++ b/app/src/shared/locales/it.json@@ -1,4 +1,6 @@{+ "Link event": "Collega evento",+ "No events": "Nessun evento","Go to {date}": "Vai al {date}","Resume notes · {title}": "Riprendi gli appunti · {title}","Take notes · {title}": "Prendi appunti · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt non è riuscito ad aggiornare il collegamento al calendario. Riprova.","Keep the title, attendees and notes.": "Mantieni titolo, partecipanti e note.","Unlink calendar event": "Scollega evento del calendario",- "No calendar events on this day.": "Nessun evento in questo giorno.","Select calendar event": "Scegli evento del calendario","(me)": "(io)","A folder keeps related meetings together. A meeting can be in more than one.": "Una cartella tiene insieme riunioni collegate. Una riunione può stare in più cartelle.",diff --git a/app/src/shared/locales/ja.json b/app/src/shared/locales/ja.jsonindex d3ce11bb..855a7976 100644--- a/app/src/shared/locales/ja.json+++ b/app/src/shared/locales/ja.json@@ -1,4 +1,6 @@{+ "Link event": "予定にリンク",+ "No events": "予定はありません","Go to {date}": "{date}に移動","Resume notes · {title}": "メモを再開 · {title}","Take notes · {title}": "メモを取る · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurtはカレンダーとのリンクを更新できませんでした。もう一度お試しください。","Keep the title, attendees and notes.": "タイトル、参加者、メモは残します。","Unlink calendar event": "カレンダーの予定とのリンクを解除",- "No calendar events on this day.": "この日の予定はありません。","Select calendar event": "カレンダーの予定を選択","(me)": "(自分)","A folder keeps related meetings together. A meeting can be in more than one.": "フォルダで関連するミーティングをまとめられます。1つのミーティングを複数のフォルダに入れることもできます。",diff --git a/app/src/shared/locales/ko.json b/app/src/shared/locales/ko.jsonindex 42e99b5b..f0ba23bf 100644--- a/app/src/shared/locales/ko.json+++ b/app/src/shared/locales/ko.json@@ -1,4 +1,6 @@{+ "Link event": "일정 연결",+ "No events": "일정 없음","Go to {date}": "{date}로 이동","Resume notes · {title}": "메모 재개 · {title}","Take notes · {title}": "노트 기록 · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt가 캘린더 연결을 업데이트하지 못했어요. 다시 시도하세요.","Keep the title, attendees and notes.": "제목, 참석자, 노트를 유지해요.","Unlink calendar event": "캘린더 일정 연결 해제",- "No calendar events on this day.": "이날은 캘린더 일정이 없어요.","Select calendar event": "캘린더 일정 선택","(me)": "(나)","A folder keeps related meetings together. A meeting can be in more than one.": "폴더는 관련 있는 회의를 한곳에 모아 둬요. 한 회의를 여러 폴더에 넣을 수도 있어요.",diff --git a/app/src/shared/locales/ms.json b/app/src/shared/locales/ms.jsonindex 2d4874fd..28a2c7d9 100644--- a/app/src/shared/locales/ms.json+++ b/app/src/shared/locales/ms.json@@ -1,4 +1,6 @@{+ "Link event": "Pautkan acara",+ "No events": "Tiada acara","Go to {date}": "Pergi ke {date}","Resume notes · {title}": "Sambung catatan · {title}","Take notes · {title}": "Ambil nota · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt tidak dapat mengemas kini pautan kalendar. Cuba lagi.","Keep the title, attendees and notes.": "Kekalkan tajuk, peserta dan nota.","Unlink calendar event": "Nyahpaut acara kalendar",- "No calendar events on this day.": "Tiada acara kalendar pada hari ini.","Select calendar event": "Pilih acara kalendar","(me)": "(saya)","A folder keeps related meetings together. A meeting can be in more than one.": "Folder menghimpunkan mesyuarat yang berkaitan. Satu mesyuarat boleh berada dalam lebih daripada satu folder.",diff --git a/app/src/shared/locales/nb.json b/app/src/shared/locales/nb.jsonindex 1de0181f..2bcd205a 100644--- a/app/src/shared/locales/nb.json+++ b/app/src/shared/locales/nb.json@@ -1,4 +1,6 @@{+ "Link event": "Koble til hendelse",+ "No events": "Ingen hendelser","Go to {date}": "Gå til {date}","Resume notes · {title}": "Fortsett notater · {title}","Take notes · {title}": "Ta notater · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt kunne ikke oppdatere koblingen til kalenderen. Prøv igjen.","Keep the title, attendees and notes.": "Behold tittel, deltakere og notater.","Unlink calendar event": "Koble fra kalenderhendelse",- "No calendar events on this day.": "Ingen kalenderhendelser denne dagen.","Select calendar event": "Velg kalenderhendelse","(me)": "(meg)","A folder keeps related meetings together. A meeting can be in more than one.": "En mappe holder møter som hører sammen, samlet. Et møte kan ligge i flere mapper.",diff --git a/app/src/shared/locales/nl.json b/app/src/shared/locales/nl.jsonindex f6349bc4..9d1fc914 100644--- a/app/src/shared/locales/nl.json+++ b/app/src/shared/locales/nl.json@@ -1,4 +1,6 @@{+ "Link event": "Afspraak koppelen",+ "No events": "Geen afspraken","Go to {date}": "Ga naar {date}","Resume notes · {title}": "Notities hervatten · {title}","Take notes · {title}": "Notities maken · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt kon de koppeling met de agenda niet bijwerken. Probeer het opnieuw.","Keep the title, attendees and notes.": "Titel, deelnemers en notities behouden.","Unlink calendar event": "Agenda-item ontkoppelen",- "No calendar events on this day.": "Geen agenda-items op deze dag.","Select calendar event": "Agenda-item kiezen","(me)": "(ik)","A folder keeps related meetings together. A meeting can be in more than one.": "Een map houdt verwante meetings bij elkaar. Een meeting kan in meer dan één map staan.",diff --git a/app/src/shared/locales/pl.json b/app/src/shared/locales/pl.jsonindex 71ad4ad9..2642fcd7 100644--- a/app/src/shared/locales/pl.json+++ b/app/src/shared/locales/pl.json@@ -1,4 +1,6 @@{+ "Link event": "Połącz wydarzenie",+ "No events": "Brak wydarzeń","Go to {date}": "Przejdź do {date}","Resume notes · {title}": "Wznów notowanie · {title}","Take notes · {title}": "Rób notatki · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt nie mógł zaktualizować połączenia z kalendarzem. Spróbuj ponownie.","Keep the title, attendees and notes.": "Zachowaj tytuł, uczestników i notatki.","Unlink calendar event": "Odłącz wydarzenie z kalendarza",- "No calendar events on this day.": "Brak wydarzeń tego dnia.","Select calendar event": "Wybierz wydarzenie z kalendarza","(me)": "(ja)","A folder keeps related meetings together. A meeting can be in more than one.": "Folder trzyma razem powiązane spotkania. Spotkanie może być w kilku folderach.",diff --git a/app/src/shared/locales/pt-BR.json b/app/src/shared/locales/pt-BR.jsonindex ad5a7870..6e1944cb 100644--- a/app/src/shared/locales/pt-BR.json+++ b/app/src/shared/locales/pt-BR.json@@ -1,4 +1,6 @@{+ "Link event": "Vincular evento",+ "No events": "Nenhum evento","Go to {date}": "Ir para {date}","Resume notes · {title}": "Retomar anotações · {title}","Take notes · {title}": "Fazer anotações · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "O Yogurt não conseguiu atualizar o vínculo com o calendário. Tente de novo.","Keep the title, attendees and notes.": "Manter o título, os participantes e as notas.","Unlink calendar event": "Desvincular evento do calendário",- "No calendar events on this day.": "Nenhum evento neste dia.","Select calendar event": "Escolher evento do calendário","(me)": "(eu)","A folder keeps related meetings together. A meeting can be in more than one.": "Uma pasta reúne reuniões relacionadas. Uma reunião pode estar em mais de uma.",diff --git a/app/src/shared/locales/ro.json b/app/src/shared/locales/ro.jsonindex 7b7c53c0..057bef57 100644--- a/app/src/shared/locales/ro.json+++ b/app/src/shared/locales/ro.json@@ -1,4 +1,6 @@{+ "Link event": "Leagă eveniment",+ "No events": "Niciun eveniment","Go to {date}": "Mergi la {date}","Resume notes · {title}": "Reia notițele · {title}","Take notes · {title}": "Luați notițe · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt nu a putut actualiza legătura cu calendarul. Încercați din nou.","Keep the title, attendees and notes.": "Păstrați titlul, participanții și notițele.","Unlink calendar event": "Dezlegați evenimentul din calendar",- "No calendar events on this day.": "Niciun eveniment în această zi.","Select calendar event": "Alegeți un eveniment din calendar","(me)": "(eu)","A folder keeps related meetings together. A meeting can be in more than one.": "Un dosar ține împreună întâlnirile legate între ele. O întâlnire poate fi în mai multe dosare.",diff --git a/app/src/shared/locales/ru.json b/app/src/shared/locales/ru.jsonindex e2dcf5c3..413935d7 100644--- a/app/src/shared/locales/ru.json+++ b/app/src/shared/locales/ru.json@@ -1,4 +1,6 @@{+ "Link event": "Связать событие",+ "No events": "Нет событий","Go to {date}": "Перейти к {date}","Resume notes · {title}": "Продолжить заметки · {title}","Take notes · {title}": "Вести заметки · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt не смог обновить связь с календарём. Попробуйте снова.","Keep the title, attendees and notes.": "Оставить название, участников и заметки.","Unlink calendar event": "Отвязать событие календаря",- "No calendar events on this day.": "В этот день нет событий.","Select calendar event": "Выбрать событие календаря","(me)": "(я)","A folder keeps related meetings together. A meeting can be in more than one.": "Папка собирает связанные встречи вместе. Встреча может быть в нескольких папках.",diff --git a/app/src/shared/locales/sv.json b/app/src/shared/locales/sv.jsonindex 666fc92a..e9ac2ee3 100644--- a/app/src/shared/locales/sv.json+++ b/app/src/shared/locales/sv.json@@ -1,4 +1,6 @@{+ "Link event": "Länka händelse",+ "No events": "Inga händelser","Go to {date}": "Gå till {date}","Resume notes · {title}": "Fortsätt anteckna · {title}","Take notes · {title}": "Anteckna · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt kunde inte uppdatera kopplingen till kalendern. Försök igen.","Keep the title, attendees and notes.": "Behåll titel, deltagare och anteckningar.","Unlink calendar event": "Koppla bort kalenderhändelse",- "No calendar events on this day.": "Inga kalenderhändelser den här dagen.","Select calendar event": "Välj kalenderhändelse","(me)": "(jag)","A folder keeps related meetings together. A meeting can be in more than one.": "En mapp håller ihop möten som hör ihop. Ett möte kan ligga i flera mappar.",diff --git a/app/src/shared/locales/th.json b/app/src/shared/locales/th.jsonindex 694fdf1d..615acb0f 100644--- a/app/src/shared/locales/th.json+++ b/app/src/shared/locales/th.json@@ -1,4 +1,6 @@{+ "Link event": "เชื่อมโยงกิจกรรม",+ "No events": "ไม่มีกิจกรรม","Go to {date}": "ไปที่ {date}","Resume notes · {title}": "จดบันทึกต่อ · {title}","Take notes · {title}": "จดโน้ต · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt อัปเดตลิงก์ปฏิทินไม่ได้ ลองอีกครั้ง","Keep the title, attendees and notes.": "เก็บชื่อ ผู้เข้าร่วม และโน้ตไว้","Unlink calendar event": "ยกเลิกการลิงก์กิจกรรมในปฏิทิน",- "No calendar events on this day.": "ไม่มีกิจกรรมในวันนี้","Select calendar event": "เลือกกิจกรรมในปฏิทิน","(me)": "(ฉัน)","A folder keeps related meetings together. A meeting can be in more than one.": "โฟลเดอร์รวบรวมการประชุมที่เกี่ยวข้องไว้ด้วยกัน การประชุมหนึ่งอยู่ได้หลายโฟลเดอร์",diff --git a/app/src/shared/locales/tr.json b/app/src/shared/locales/tr.jsonindex 449f32c2..0e2b7f00 100644--- a/app/src/shared/locales/tr.json+++ b/app/src/shared/locales/tr.json@@ -1,4 +1,6 @@{+ "Link event": "Etkinlik bağla",+ "No events": "Etkinlik yok","Go to {date}": "Şu tarihe git: {date}","Resume notes · {title}": "Not almaya devam et · {title}","Take notes · {title}": "Not al · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt takvim bağlantısını güncelleyemedi. Yeniden deneyin.","Keep the title, attendees and notes.": "Başlığı, katılımcıları ve notları koru.","Unlink calendar event": "Takvim etkinliği bağlantısını kaldır",- "No calendar events on this day.": "Bu günde takvim etkinliği yok.","Select calendar event": "Takvim etkinliği seç","(me)": "(ben)","A folder keeps related meetings together. A meeting can be in more than one.": "Klasör, birbiriyle ilgili toplantıları bir arada tutar. Bir toplantı birden fazla klasörde olabilir.",diff --git a/app/src/shared/locales/uk.json b/app/src/shared/locales/uk.jsonindex b038bb25..22feca5c 100644--- a/app/src/shared/locales/uk.json+++ b/app/src/shared/locales/uk.json@@ -1,4 +1,6 @@{+ "Link event": "Пов’язати подію",+ "No events": "Немає подій","Go to {date}": "Перейти до {date}","Resume notes · {title}": "Продовжити нотатки · {title}","Take notes · {title}": "Вести нотатки · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt не зміг оновити зв’язок із календарем. Спробуйте ще раз.","Keep the title, attendees and notes.": "Залишити назву, учасників і нотатки.","Unlink calendar event": "Відв’язати подію календаря",- "No calendar events on this day.": "Цього дня немає подій.","Select calendar event": "Вибрати подію календаря","(me)": "(я)","A folder keeps related meetings together. A meeting can be in more than one.": "Папка тримає пов’язані зустрічі разом. Зустріч може бути в кількох папках.",diff --git a/app/src/shared/locales/vi.json b/app/src/shared/locales/vi.jsonindex de08e1ba..99c5899f 100644--- a/app/src/shared/locales/vi.json+++ b/app/src/shared/locales/vi.json@@ -1,4 +1,6 @@{+ "Link event": "Liên kết sự kiện",+ "No events": "Không có sự kiện","Go to {date}": "Đi đến {date}","Resume notes · {title}": "Tiếp tục ghi chú · {title}","Take notes · {title}": "Ghi chú · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt không cập nhật được liên kết lịch. Hãy thử lại.","Keep the title, attendees and notes.": "Giữ tiêu đề, người tham dự và ghi chú.","Unlink calendar event": "Bỏ liên kết sự kiện lịch",- "No calendar events on this day.": "Không có sự kiện nào trong ngày này.","Select calendar event": "Chọn sự kiện lịch","(me)": "(tôi)","A folder keeps related meetings together. A meeting can be in more than one.": "Thư mục gom các cuộc họp liên quan lại với nhau. Một cuộc họp có thể nằm trong nhiều thư mục.",diff --git a/app/src/shared/locales/zh-CN.json b/app/src/shared/locales/zh-CN.jsonindex 61067342..41b53bf3 100644--- a/app/src/shared/locales/zh-CN.json+++ b/app/src/shared/locales/zh-CN.json@@ -1,4 +1,6 @@{+ "Link event": "关联活动",+ "No events": "没有活动","Go to {date}": "转到{date}","Resume notes · {title}": "继续记笔记 · {title}","Take notes · {title}": "记笔记 · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt 无法更新日历链接。请重试。","Keep the title, attendees and notes.": "保留标题、参会人和笔记。","Unlink calendar event": "取消关联日历事件",- "No calendar events on this day.": "这一天没有日历事件。","Select calendar event": "选择日历事件","(me)": "(我)","A folder keeps related meetings together. A meeting can be in more than one.": "文件夹把相关的会议放在一起。一个会议可以放进多个文件夹。",diff --git a/app/src/shared/locales/zh-TW.json b/app/src/shared/locales/zh-TW.jsonindex 9e158631..7950212a 100644--- a/app/src/shared/locales/zh-TW.json+++ b/app/src/shared/locales/zh-TW.json@@ -1,4 +1,6 @@{+ "Link event": "連結活動",+ "No events": "沒有活動","Go to {date}": "前往{date}","Resume notes · {title}": "繼續記筆記 · {title}","Take notes · {title}": "做筆記 · {title}",@@ -18,7 +20,6 @@"Yogurt couldn't update the calendar link. Try again.": "Yogurt 無法更新行事曆連結。請再試一次。","Keep the title, attendees and notes.": "保留標題、與會者和筆記。","Unlink calendar event": "取消連結行事曆活動",- "No calendar events on this day.": "這一天沒有行事曆活動。","Select calendar event": "選擇行事曆活動","(me)": "(我)","A folder keeps related meetings together. A meeting can be in more than one.": "資料夾能把相關的會議放在一起。一個會議可以放進多個資料夾。",diff --git a/app/test/backup.test.ts b/app/test/backup.test.tsindex 78e71d1f..3d8758ae 100644--- a/app/test/backup.test.ts+++ b/app/test/backup.test.ts@@ -60,7 +60,7 @@ describe('backup merge', () => {const from = fresh(), into = fresh()const shared = fill(from, 'Weekly sync', 'budget')const fresh1 = fill(from, 'Pricing', 'pricing')- from.updateMeeting(fresh1.id, { eventId: 'next-day-event', eventStartedAt: 86_401_000 })+ from.updateMeeting(fresh1.id, { eventId: 'next-day-event', eventStartedAt: 86_401_000, eventEndedAt: 88_201_000, eventTitle: 'Pricing meeting', eventCalendarName: 'Work', eventCalendarSource: 'Calendar' })const colours = from.speakerOrder(fresh1.id)// the same meeting is already here, with notes the person changed since: never overwritteninto.db.prepare('INSERT INTO meetings (id, title, started_at, attendees, state) VALUES (?, ?, ?, ?, ?)').run(shared.id, 'My own title', 1, '[]', 'done')@@ -71,7 +71,7 @@ describe('backup merge', () => {expect(r).toEqual({ added: [fresh1.id], skipped: 1 })expect(into.meeting(shared.id)?.title).toBe('My own title')expect(into.notes(shared.id).mine).toBe('kept as it is')- expect(into.meeting(fresh1.id)).toMatchObject({ eventId: 'next-day-event', eventStartedAt: 86_401_000, title: 'Pricing', attendees: [{ name: 'Ann Lee', email: null }], state: 'done' })+ expect(into.meeting(fresh1.id)).toMatchObject({ eventId: 'next-day-event', eventStartedAt: 86_401_000, eventEndedAt: 88_201_000, eventTitle: 'Pricing meeting', eventCalendarName: 'Work', eventCalendarSource: 'Calendar', title: 'Pricing', attendees: [{ name: 'Ann Lee', email: null }], state: 'done' })expect(into.segments(fresh1.id).map((s) => s.text)).toEqual(['We talked about the pricing plan'])expect(into.segments(fresh1.id, { hidden: true })).toHaveLength(2)expect(into.segments(fresh1.id).map((s) => s.speaker)).toEqual(['Bo Park'])diff --git a/app/test/meeting.test.ts b/app/test/meeting.test.tsindex c5d6bca2..6e90e9ca 100644--- a/app/test/meeting.test.ts+++ b/app/test/meeting.test.ts@@ -3,7 +3,7 @@ import { EventEmitter } from 'node:events'import { PassThrough } from 'node:stream'import { Capture, activeCapture, hookCapture, recordingFinished, type CaptureProc } from '../src/main/capture'import { openStore, type Store } from '../src/main/store'-import { activeMeeting, bindMeetingApp, getMeeting, initMeetings, onMeetingChange, onMeetingStart, onMeetingStop, onMeetingStopSaved, prepareMeeting, startPreparedMeeting, resumeMeeting, pauseMeetingClock, renameMeeting, retryStopSave, setAttendees, linkEvent, unlinkEvent, startMeeting, stopMeeting, withStopState } from '../src/main/meeting'+import { activeMeeting, bindMeetingApp, getMeeting, initMeetings, onMeetingChange, onMeetingStart, onMeetingStop, onMeetingStopSaved, prepareMeeting, startPreparedMeeting, resumeMeeting, pauseMeetingClock, renameMeeting, retryStopSave, setAttendees, refreshEventSnapshots, linkEvent, unlinkEvent, startMeeting, stopMeeting, withStopState } from '../src/main/meeting'let store: StorebeforeEach(() => { store = openStore(':memory:'); initMeetings(store) })@@ -171,7 +171,7 @@ describe('meeting lifecycle', () => {renameMeeting(m.id, 'My edited title')setAttendees(m.id, [{ name: 'Bo', email: '[email protected]' }])store.setNotes(m.id, { mine: 'Keep these notes.' })- const before = getMeeting(m.id)!+ const { eventStartedAt, eventEndedAt, eventTitle, eventCalendarName, eventCalendarSource, ...before } = getMeeting(m.id)!expect(unlinkEvent(m.id)).toEqual({ ...before, eventId: null })expect(activeMeeting()).toEqual({ ...before, eventId: null })expect(store.notes(m.id).mine).toBe('Keep these notes.')@@ -326,3 +326,39 @@ describe('meeting lifecycle', () => {expect(renameMeeting('nope', 'Hello')).toBeUndefined()})})++it('captures event details on prepare, recording and relink, and clears them on unlink', () => {+ const scheduled = { ...event, calendar: { id: 'work', name: 'Work', source: 'Calendar' } }+ const snapshot = { eventStartedAt: event.start, eventEndedAt: event.end, eventTitle: event.title, eventCalendarName: 'Work', eventCalendarSource: 'Calendar' }+ const prepared = prepareMeeting(scheduled)+ expect(store.meeting(prepared.id)).toMatchObject(snapshot)+ const recording = startMeeting({ title: 'A note', event: { ...scheduled, id: 'other' }, app: null })+ expect(store.meeting(recording.id)).toMatchObject(snapshot)+ linkEvent(recording.id, { ...event, title: 'New event', end: 4000 })+ expect(store.meeting(recording.id)).toMatchObject({ eventEndedAt: 4000, eventTitle: 'New event' })+ expect(store.meeting(recording.id)?.eventCalendarName).toBeUndefined()+ expect(store.meeting(recording.id)?.eventCalendarSource).toBeUndefined()+ unlinkEvent(recording.id)+ for (const key of Object.keys(snapshot)) expect(store.meeting(recording.id)).not.toHaveProperty(key)+})+it('calendar reads refresh active snapshots without changing manual edits or notifying on identical reads', () => {+ const m = startMeeting({ title: 'My title', event, app: null })+ setAttendees(m.id, [{ name: 'My person', email: null }])+ store.setNotes(m.id, { mine: 'Keep my notes' })+ const heard = vi.fn(), off = onMeetingChange(heard)+ try {+ const changed = { ...event, title: 'Renamed event', start: 1500, end: 5000, calendar: { id: 'work', name: 'Work', source: 'Calendar' } }+ refreshEventSnapshots([changed])+ expect(activeMeeting()).toMatchObject({ title: 'My title', eventTitle: 'Renamed event', eventStartedAt: 1500, eventEndedAt: 5000, eventCalendarName: 'Work', attendees: [{ name: 'My person', email: null }] })+ expect(store.notes(m.id).mine).toBe('Keep my notes')+ expect(heard).toHaveBeenCalledTimes(1)+ refreshEventSnapshots([changed])+ expect(heard).toHaveBeenCalledTimes(1)+ refreshEventSnapshots([])+ expect(store.meeting(m.id)?.eventEndedAt).toBe(5000)+ const fail = vi.spyOn(store, 'rememberEvent').mockImplementation(() => { throw new Error('disk full') })+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})+ try { expect(() => refreshEventSnapshots([event])).not.toThrow(); expect(warn).toHaveBeenCalled() }+ finally { fail.mockRestore(); warn.mockRestore() }+ } finally { off() }+})diff --git a/app/test/noteDateCard.test.ts b/app/test/noteDateCard.test.tsnew file mode 100644index 00000000..cd71b8ef--- /dev/null+++ b/app/test/noteDateCard.test.ts@@ -0,0 +1,218 @@+import { afterEach, beforeEach, expect, it, vi } from 'vitest'+import { createElement } from 'react'+import { renderToStaticMarkup } from 'react-dom/server'+import { timeOf } from '../src/renderer/src/dates'+import { NoteDate } from '../src/renderer/src/components/NoteDate'+import type { CalEvent, CalendarStatus, Meeting } from '../src/shared/types'+import { LOCALES, setLanguage, t } from '../src/shared/i18n'++// SSR supplies settled hook states; interactions and async reads are covered by the CI spec.+const state = vi.hoisted(() => ({ values: [] as unknown[], index: 0, keyboard: false, focusEffect: undefined as undefined | { run: () => void; previous: { current: unknown } } }))+vi.mock('react', async importOriginal => {+ const react = await importOriginal<typeof import('react')>()+ return { ...react,+ useState: (initial: unknown) => react.useState(state.index < state.values.length ? state.values[state.index++] : initial),+ useRef: (initial: unknown) => react.useRef(initial === false ? state.keyboard : initial),+ useEffect: (effect: () => void, deps?: unknown[]) => {+ // Capture the picker's focus effect; browser refs are absent during SSR, so it uses its fallback.+ if (deps?.length === 4 && typeof deps[1] === 'boolean' && deps[3] && typeof deps[3] === 'object' && 'current' in deps[3]) state.focusEffect = { run: effect, previous: deps[3] }+ react.useEffect(effect, deps)+ },+ }+})+beforeEach(() => { vi.useFakeTimers(); vi.setSystemTime(new Date(2026, 10, 13)) })+afterEach(() => { vi.useRealTimers(); vi.unstubAllGlobals(); setLanguage('en') })+const at = +new Date(2026, 10, 10, 12, 24)+const meeting = { id: 'note', title: 'Planning', startedAt: at, durationMs: 420_000, eventId: null, attendees: [], state: 'done' } as unknown as Meeting+function render(status?: CalendarStatus, { picking = false, linked = false, calendar = true, day = at, linking = false, loading = false, compact = false, keyboard = false, snapshot = {} as Partial<Meeting>, event = null as CalEvent | null, events = [] as CalEvent[] } = {}) {+ vi.stubGlobal('window', { yogurt: { capabilities: { calendar } }, matchMedia: () => ({ matches: false }) })+ state.index = 0; state.keyboard = keyboard; state.focusEffect = 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]+ return renderToStaticMarkup(createElement(NoteDate, { m: { ...meeting, ...snapshot, eventId: linked ? 'event' : null } }))+}++it.each([+ ['notDetermined', 'Calendar access is off', 'Connect calendar'],+ ['denied', 'Calendar access is off', 'Open System Settings'],+ ['error', "Yogurt couldn't read your calendar", 'Try again'],+] 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('7 min')+ expect(html).toContain(message.replaceAll("'", '''))+ expect(html).toContain(`class="workspace-button agenda-open-note">${action}</button>`)+ expect(html).not.toContain('note-date-days')+ expect(html).not.toContain('note-date-previous')+ expect(html).not.toContain('note-date-next')+ expect(html).not.toContain('class="underline"')+ }+})+it('keeps empty-day navigation in the same header before and during browsing', () => {+ const html = render('granted')+ expect(html).toContain('7 min')+ expect(html).toContain('No events')+ expect(html).toContain('Link to a calendar event')+ expect(html).not.toContain('note-date-days')+ expect(html).toContain('note-date-next')+ const picker = render('granted', { picking: true })+ expect(picker).toContain('No events')+ expect(picker).toContain('note-date-next')+ expect(picker).toContain('note-date-previous')+})+it('keeps the unlinked picker ordered and separate from unlinking', () => {+ const events = [20, 1].map(n => ({ id: String(n), title: `Event ${n}`, start: at + n * 60_000, end: at + (n + 30) * 60_000, attendees: [], url: null }))+ const html = render('granted', { picking: true, events })+ expect(html).toContain('data-event-id="1"')+ expect(html.indexOf('data-event-id="1"')).toBeLessThan(html.indexOf('data-event-id="20"'))+ expect(html).not.toContain('note-date-unlink')+ expect(render('denied', { picking: true, linked: true })).toContain('note-date-unlink')+})+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')+ for (const html of [render('unsupported'), render(undefined, { calendar: false })]) {+ expect(html).toContain('7 min')+ expect(html).not.toContain('Connect calendar')+ expect(html).not.toContain('note-date-days')+ expect(html).not.toContain('note-date-previous')+ expect(html).not.toContain('note-date-next')+ expect(html).not.toContain('Looking at your calendar…')+ }+})+it('uses existing short translations for every recovery and empty state in all 32 locales', () => {+ 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', 'Link event', 'Previous day', 'Next day']) {+ expect(t(key)).toBeTruthy()+ expect(t(key)).not.toMatch(/[::—\n]/)+ if (id !== 'en') expect(t(key)).not.toBe(key)+ }+ }+})++it('shows the selected date once with day buttons and no close button', () => {+ const day = +new Date(2026, 10, 11, 12, 24)+ for (const linked of [false, true]) {+ const html = render('granted', { picking: true, linked, 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('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).not.toContain('note-date-days')+ }+})+it('keeps the meeting date as the linked detail heading and locks navigation while linking', () => {+ const html = render('granted', { linked: true })+ expect(html.match(/>Tuesday, Nov 10<\/h3>/g)).toHaveLength(1)+ expect(html).toContain('note-date-events-toggle')+ const busy = render('granted', { picking: true, linking: true })+ for (const direction of ['previous', 'next']) expect(busy).toMatch(new RegExp(`data-testid="note-date-${direction}"[^>]*disabled=""`))+})++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 })+ expect(html.match(/Planning/g)).toHaveLength(1)+ expect(html).not.toContain('data-event-id="event"')+ expect(html).not.toContain('data-event-id="alias"')+ expect(html.indexOf('note-date-events-toggle')).toBeLessThan(html.indexOf('note-date-unlink'))+ expect(html.indexOf('note-date-unlink')).toBeLessThan(html.indexOf('note-date-details'))+ if (status === 'denied') expect(html.indexOf('note-date-unlink')).toBeLessThan(html.indexOf('Open System Settings'))+ }+})+it('omits the waiting placeholder entirely, then uses the delayed app skeleton', () => {+ expect(render()).not.toContain('loading-placeholder')+ const html = render(undefined, { loading: true })+ expect(html).toContain('data-loading-phase="skeleton"')+ expect(html).toContain('loading-mask')+ expect(html).toContain('loading-bar')+ expect(html).not.toContain('Connect calendar')+})+it('keeps the year for dates outside the current year', () => {+ expect(render('granted', { picking: true, day: +new Date(2025, 10, 11) })).toContain('2025')+})++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('>seg., 24 de mar. de 2025</h3>')+})++it('shows only Unlink and its description for linked notes, regardless of calendar results', () => {+ const event = { id: 'other', title: 'Design review', start: at, end: at + 1_800_000, attendees: [], url: null }+ for (const status of [undefined, 'granted', 'denied', 'error'] as const) {+ for (const events of [[], [event]]) {+ const html = render(status, { linked: true, picking: true, events })+ expect(html).not.toContain('data-testid="note-date-events"')+ expect(html).not.toContain('data-testid="note-date-event"')+ expect(html).not.toContain('Switch to')+ expect(html).not.toContain('Design review')+ expect(html).toContain('Unlink calendar event')+ expect(html).toContain('Keep the title, attendees and notes.')+ }+ }+ const unlinked = render('granted', { events: [event] })+ expect(unlinked).toContain('Link event')+ expect(unlinked).not.toContain('data-testid="note-date-events"')+ const choosing = render('granted', { picking: true, events: [event] })+ expect(choosing).toContain('Design review')+ expect(choosing).not.toContain('note-date-unlink')+})+it('keeps A details visible while the attached picker stays mounted and becomes inert when closed', () => {+ for (const picking of [false, true]) {+ const html = render('granted', { linked: true, picking })+ const picker = html.match(/class="accordion note-date-motion note-date-picker-motion"[^>]*>/)?.[0]+ const details = html.match(/class="accordion note-date-motion note-date-details-motion"[^>]*>/)?.[0]+ expect(picker).toContain(`data-open="${picking}"`)+ expect(details).toContain('data-open="true"')+ expect(details).not.toContain('inert=')+ expect(details).not.toContain('aria-hidden="true"')+ expect(picker).toContain(`aria-hidden="${!picking}"`)+ if (picking) expect(picker).not.toContain('inert=')+ else expect(picker).toContain('inert=""')+ expect(html).toContain('note-date-unlink')+ expect(html).toContain('7 min')+ }+})++it('keeps the linked title, time range and calendar when access is off, using the saved snapshot', () => {+ const snapshot = { title: 'My renamed note', eventTitle: 'Calendar title', eventStartedAt: at + 3_600_000, eventEndedAt: at + 5_400_000, eventCalendarName: 'Work', eventCalendarSource: 'Team calendar' }+ const event = { id: 'event', title: snapshot.eventTitle, start: snapshot.eventStartedAt, end: snapshot.eventEndedAt, attendees: [], url: null, calendar: { id: 'work', name: 'Work', source: 'Team calendar' } }+ for (const status of ['granted', 'denied'] as const) {+ const html = render(status, { linked: true, snapshot, event: status === 'granted' ? event : null })+ expect(html).toContain('Calendar title')+ expect(html).not.toContain('My renamed note')+ expect(html).toContain(`${timeOf(event.start)} – ${timeOf(event.end)}`)+ expect(html).toContain('Work')+ expect(html).toContain('Team calendar')+ expect(html).not.toContain('7 min')+ if (status === 'denied') {+ expect(html).toContain('Calendar access is off')+ expect(html).toContain('Open System Settings')+ }+ }+ const legacy = render('denied', { linked: true })+ expect(legacy).toContain('7 min')+ expect(legacy).not.toContain('agenda-inspector-footer')+})++it.each([false, true])('only moves picker focus for keyboard activation, keyboard=%s', keyboard => {+ for (const picking of [false, true]) {+ render('granted', { linked: true, picking, keyboard })+ const effect = state.focusEffect!+ expect(effect).toBeDefined()+ const focus = vi.fn()+ effect.previous.current = { focus }+ effect.run()+ expect(focus).toHaveBeenCalledTimes(keyboard && picking ? 1 : 0)+ }+})diff --git a/app/test/noteDateMotion.test.ts b/app/test/noteDateMotion.test.tsnew file mode 100644index 00000000..e9b58970--- /dev/null+++ b/app/test/noteDateMotion.test.ts@@ -0,0 +1,61 @@+import { afterEach, expect, it, vi } from 'vitest'+import { NoteDateBody } from '../src/renderer/src/components/NoteDate'++afterEach(() => vi.unstubAllGlobals())+function setup(reduced = false, duration = '180ms') {+ vi.stubGlobal('window', { matchMedia: () => ({ matches: reduced }) })+ vi.stubGlobal('getComputedStyle', () => ({ getPropertyValue: (key: string) => key === '--note-date-ms' ? duration : 'cubic-bezier(.22,1,.36,1)' }))+ const animations: { cancel: ReturnType<typeof vi.fn>; finished: Promise<void>; finish: () => void }[] = []+ const animate = vi.fn(() => {+ let finish!: () => void+ const animation = { cancel: vi.fn(), finished: new Promise<void>(resolve => { finish = resolve }), finish: () => finish() }+ animations.push(animation)+ return animation+ })+ const target = { removeAttribute: vi.fn() }+ const copy = { inert: false, setAttribute: vi.fn(), querySelectorAll: () => [target], classList: { add: vi.fn() }, remove: vi.fn(), animate }+ const body = { cloneNode: () => copy, getBoundingClientRect: () => ({ height: 180 }), animate }+ const shell = { getBoundingClientRect: () => ({ height: 320 }), append: vi.fn(), animate }+ const component = new NoteDateBody({ view: 'linked/details/granted', children: null })+ // DOM geometry and Web Animations are supplied directly; no browser runner is required.+ Object.assign((component as any).body, { current: body })+ Object.assign((component as any).shell, { current: shell })+ return { component, body, shell, copy, target, animate, animations }+}+it('cross-fades over the measured old/new heights with the shared 180 ms token, then removes the inert copy', async () => {+ const { component, copy, target, shell, animate, animations } = setup()+ const snapshot = component.getSnapshotBeforeUpdate({ view: 'unlinked/picker/granted', children: null })!+ expect(snapshot.height).toBe(320)+ expect(copy.inert).toBe(true)+ expect(copy.setAttribute).toHaveBeenCalledWith('aria-hidden', 'true')+ for (const attr of ['id', 'data-testid', 'autofocus']) expect(target.removeAttribute).toHaveBeenCalledWith(attr)+ component.componentDidUpdate(null, null, snapshot)+ expect(shell.append).toHaveBeenCalledWith(copy)+ const timing = { duration: 180, easing: 'cubic-bezier(.22,1,.36,1)' }+ expect(animate).toHaveBeenNthCalledWith(1, [{ height: '320px' }, { height: '180px' }], timing)+ expect(animate).toHaveBeenNthCalledWith(2, [{ opacity: 0 }, { opacity: 1 }], timing)+ expect(animate).toHaveBeenNthCalledWith(3, [{ opacity: 1 }, { opacity: 0 }], timing)+ animations.forEach(a => a.finish())+ await Promise.all(animations.map(a => a.finished)); await Promise.resolve()+ expect(copy.remove).toHaveBeenCalledOnce()+ expect(animations.every(a => a.cancel.mock.calls.length === 1)).toBe(true)+})+it('cancels an interrupted transition and cleans up on unmount', () => {+ const { component, animations, copy } = setup()+ const snapshot = component.getSnapshotBeforeUpdate({ view: 'unlinked/picker/granted', children: null })!+ component.componentDidUpdate(null, null, snapshot)+ component.componentDidUpdate(null, null, snapshot)+ expect(animations.slice(0, 3).every(a => a.cancel.mock.calls.length === 1)).toBe(true)+ component.componentWillUnmount()+ expect(copy.remove).toHaveBeenCalledTimes(2)+ expect(animations.every(a => a.cancel.mock.calls.length === 1)).toBe(true)+})+it('skips copies and motion for unchanged views, reduced motion and static review frames', () => {+ for (const [reduced, duration] of [[true, '180ms'], [false, '0ms']] as const) {+ const { component, animate } = setup(reduced, duration)+ expect(component.getSnapshotBeforeUpdate({ view: 'unlinked/details/granted', children: null })).toBeNull()+ expect(animate).not.toHaveBeenCalled()+ }+ const { component } = setup()+ expect(component.getSnapshotBeforeUpdate(component.props)).toBeNull()+})diff --git a/app/test/noteDateRead.test.ts b/app/test/noteDateRead.test.tsnew file mode 100644index 00000000..4b6108ad--- /dev/null+++ b/app/test/noteDateRead.test.ts@@ -0,0 +1,134 @@+import { afterEach, expect, it, vi } from 'vitest'+import { NoteDate } from '../src/renderer/src/components/NoteDate'+import type { Meeting } from '../src/shared/types'++// Exercise this component's hooks and effects without mounting a browser or its child components.+const h = vi.hoisted(() => ({ values: [] as any[], index: 0, dirty: false, pending: [] as any[], effects: new Map<number, any>() }))+vi.mock('react', async original => {+ const react = await original<typeof import('react')>()+ const effect = (run: () => unknown, deps?: unknown[]) => {+ const index = h.index+++ h.pending.push({ index, run, deps })+ }+ return { ...react,+ useState: (initial: any) => {+ const index = h.index+++ if (!(index in h.values)) h.values[index] = typeof initial === 'function' ? initial() : initial+ return [h.values[index], (value: any) => {+ const next = typeof value === 'function' ? value(h.values[index]) : value+ if (!Object.is(next, h.values[index])) { h.values[index] = next; h.dirty = true }+ }]+ },+ useRef: (initial: unknown) => { const index = h.index++; return h.values[index] ??= { current: initial } },+ useCallback: (fn: unknown) => fn,+ useEffect: effect, useLayoutEffect: effect,+ }+})+const at = +new Date(2026, 10, 10, 12, 24)+const event = { id: 'event', title: 'Planning', start: at, end: at + 1_800_000, attendees: [], url: null }+const linked = { id: 'note', title: 'Planning', startedAt: at, durationMs: 420_000, eventId: 'event', eventStartedAt: at, eventEndedAt: event.end } as Meeting+const unlinked = { ...linked, eventId: null, eventStartedAt: null, eventEndedAt: null }+function find(node: any, match: (node: any) => boolean): any {+ if (!node || typeof node !== 'object') return undefined+ if (match(node)) return node+ for (const child of [node.props?.children].flat(Infinity)) { const found = find(child, match); if (found) return found }+}+const byId = (tree: any, id: string) => find(tree, node => node.props?.['data-testid'] === id)+const picker = (tree: any) => find(tree, node => node.type?.name === 'EventPicker')+function setup(day: ReturnType<typeof vi.fn>, onClose = vi.fn()) {+ vi.useFakeTimers()+ vi.stubGlobal('requestAnimationFrame', vi.fn())+ vi.stubGlobal('window', { yogurt: { capabilities: { calendar: true }, calendar: { day, onChange: () => () => {} } }, matchMedia: () => ({ matches: false, addEventListener() {}, removeEventListener() {} }), addEventListener() {}, removeEventListener() {} })+ 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)+ h.values = []; h.effects.clear()+ return (m: Meeting) => {+ let tree: any+ do { h.dirty = false; h.index = 0; h.pending = []; tree = cardElement.type({ ...cardElement.props, m, 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]))) {+ old?.cleanup?.()+ h.effects.set(effect.index, { deps: effect.deps, cleanup: effect.run() })+ }+ }+ return tree+ }+}+afterEach(() => { for (const effect of h.effects.values()) effect.cleanup?.(); h.effects.clear(); vi.useRealTimers(); vi.unstubAllGlobals() })+it('keeps the card and cached results through unlink, Link event and selecting the event again', async () => {+ const value = { status: 'granted', events: [event] }+ const day = vi.fn().mockResolvedValue(value)+ const render = setup(day)+ render(linked)+ await Promise.resolve(); await Promise.resolve()+ let tree = render(linked)+ byId(tree, 'note-date-events-toggle').props.onClick({ detail: 1 })+ tree = render(linked)+ picker(tree).props.onLinked()+ expect(byId(render(linked), 'note-date-events-toggle').props['aria-expanded']).toBe(true)+ tree = render(unlinked)+ expect(byId(tree, 'note-date-events-toggle').props['aria-expanded']).toBe(false)+ byId(tree, 'note-date-events-toggle').props.onClick({ detail: 1 })+ tree = render(unlinked)+ expect(picker(tree).props.result).toBe(value)+ picker(tree).props.onLinked()+ expect(picker(render(unlinked))).toBeDefined()+ tree = render(linked)+ expect(byId(tree, 'note-date-events-toggle').props['aria-expanded']).toBe(false)+ expect(picker(tree).props.result).toBe(value)+ expect(day).toHaveBeenCalledTimes(1)+ expect(find(tree, node => node.props?.className === 'loading-content')).toBeUndefined()+})+it.each([50, 99])('never inserts a loading placeholder for a %s ms read', async delay => {+ const day = vi.fn(() => new Promise(resolve => setTimeout(() => resolve({ status: 'granted', events: [event] }), delay)))+ const render = setup(day)+ expect(find(render(unlinked), node => node.props?.className === 'loading-content')).toBeUndefined()+ await vi.advanceTimersByTimeAsync(delay)+ expect(find(render(unlinked), node => node.props?.className === 'loading-content')).toBeUndefined()+ await vi.advanceTimersByTimeAsync(200)+ expect(find(render(unlinked), node => node.props?.className === 'loading-content')).toBeUndefined()+})+it('shows the delayed skeleton for a read that remains pending', async () => {+ const render = setup(vi.fn(() => new Promise(() => {})))+ render(unlinked)+ await vi.advanceTimersByTimeAsync(99)+ expect(find(render(unlinked), node => node.props?.className === 'loading-content')).toBeUndefined()+ await vi.advanceTimersByTimeAsync(1)+ expect(find(render(unlinked), node => node.props?.className === 'loading-content')?.props['data-loading-phase']).toBe('skeleton')+})+it('does not expose the previous ready phase as a loading flash when navigating to an uncached day', async () => {+ const day = vi.fn().mockResolvedValueOnce({ status: 'granted', events: [event] }).mockImplementation(() => new Promise(() => {}))+ const render = setup(day)+ render(unlinked)+ await Promise.resolve(); await Promise.resolve()+ render(unlinked)+ let tree = render(unlinked)+ byId(tree, 'note-date-next').props.onClick({ detail: 1 })+ tree = render(unlinked)+ const waitingPicker = picker(tree)+ expect(waitingPicker.props.result).toBeUndefined()+ expect(waitingPicker.props.loading).toBeNull()+ await vi.advanceTimersByTimeAsync(100)+ expect(picker(render(unlinked)).props.loading.props['data-loading-phase']).toBe('skeleton')+})++it('dismisses on Escape and restores the date chip for outside dismissal', () => {+ const close = vi.fn()+ const render = setup(vi.fn(() => new Promise(() => {})), close)+ const preventDefault = vi.fn(), stopPropagation = vi.fn()+ render(unlinked).props.onKeyDown({ key: 'Escape', preventDefault, stopPropagation })+ expect(close).toHaveBeenCalledOnce()+ expect(preventDefault).toHaveBeenCalledOnce()+ expect(stopPropagation).toHaveBeenCalledOnce()+ h.values = ['pointer']; h.index = 0+ const tree = NoteDate({ m: unlinked }) as any+ const focus = vi.fn()+ tree.props.children[0].props.ref.current = { focus }+ tree.props.children[1].props.onClose(false)+ expect(h.values[0]).toBe(false)+ expect(focus).toHaveBeenCalledWith({ preventScroll: true })+})diff --git a/app/test/store.test.ts b/app/test/store.test.tsindex 595ecf1c..56f4db3e 100644--- a/app/test/store.test.ts+++ b/app/test/store.test.ts@@ -442,3 +442,55 @@ it('backfills only strong word matches among already hidden historical echoes',expect(reopened.segments(m.id, { hidden: true }).filter(line => line.hidden).map(line => !!line.echoConfident)).toEqual([true, false])reopened.close()})++it('stores, updates and clears nullable calendar snapshots', () => {+ const s = fresh()+ const snapshot = { eventStartedAt: 100, eventEndedAt: 200, eventTitle: 'Calendar title', eventCalendarName: 'Work', eventCalendarSource: 'Calendar' }+ const m = s.createMeeting({ ...base, startedAt: 150, eventId: 'event', ...snapshot })+ expect(s.meeting(m.id)).toMatchObject(snapshot)+ s.updateMeeting(m.id, { eventEndedAt: 300, eventCalendarName: 'Team' })+ expect(s.meeting(m.id)).toMatchObject({ ...snapshot, eventEndedAt: 300, eventCalendarName: 'Team' })+ s.updateMeeting(m.id, { eventId: null, eventStartedAt: null, eventEndedAt: null, eventTitle: null, eventCalendarName: null, eventCalendarSource: null })+ for (const key of Object.keys(snapshot)) expect(s.meeting(m.id)).not.toHaveProperty(key)+})+it('refreshes all linked copies and aliases once, without reviving unlinked notes or replacing user data', () => {+ const s = fresh()+ const a = s.createMeeting({ ...base, startedAt: 1, eventId: 'event' })+ const b = s.createMeeting({ ...base, startedAt: 2, eventId: 'alias' })+ const c = s.createMeeting({ ...base, startedAt: 3, eventId: 'event' })+ s.updateMeeting(c.id, { eventId: null })+ s.setNotes(a.id, { mine: 'Keep this' })+ const event = { id: 'event', aliases: ['alias'], title: 'Updated event', start: 100, end: 200, attendees: [], url: null, calendar: { id: 'work', name: 'Work', source: 'Calendar' } }+ expect(s.rememberEvent(event).map(m => m.id).sort()).toEqual([a.id, b.id].sort())+ for (const id of [a.id, b.id]) expect(s.meeting(id)).toMatchObject({ title: base.title, eventTitle: 'Updated event', eventStartedAt: 100, eventEndedAt: 200, eventCalendarName: 'Work', eventCalendarSource: 'Calendar' })+ expect(s.meeting(b.id)?.eventId).toBe('alias')+ expect(s.notes(a.id).mine).toBe('Keep this')+ expect(s.meeting(c.id)).not.toHaveProperty('eventEndedAt')+ expect(s.rememberEvent(event)).toEqual([])+})+it('migrates old meetings with nullable snapshot columns and preserves them across reopening', () => {+ const dir = mkdtempSync(join(tmpdir(), 'yogurt-snapshot-migration-')); dirs.push(dir)+ const file = join(dir, 'yogurt.db')+ const old = new DatabaseSync(file)+ old.exec(`CREATE TABLE meetings (id TEXT PRIMARY KEY, title TEXT NOT NULL, started_at INTEGER NOT NULL, ended_at INTEGER, event_id TEXT, event_started_at INTEGER, app TEXT, attendees TEXT NOT NULL DEFAULT '[]', state TEXT NOT NULL, language TEXT);+ INSERT INTO meetings (id, title, started_at, event_id, event_started_at, state) VALUES ('old', 'My old note', 50, 'event', 100, 'done');+ CREATE TABLE notes (id INTEGER PRIMARY KEY AUTOINCREMENT, meeting_id TEXT NOT NULL UNIQUE, mine TEXT NOT NULL DEFAULT '', enhanced TEXT);+ INSERT INTO notes (meeting_id, mine) VALUES ('old', 'My existing notes');`)+ old.close()+ const migrated = openStore(file)+ try {+ const columns = ['event_ended_at', 'event_title', 'event_calendar_name', 'event_calendar_source']+ const schema = migrated.db.prepare('PRAGMA table_info(meetings)').all()+ const row = migrated.db.prepare('SELECT * FROM meetings WHERE id = ?').get('old')!+ for (const name of columns) {+ 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')).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() }+ const reopened = openStore(file); stores.push(reopened)+ expect(reopened.meeting('old')).toMatchObject({ title: 'My old note', startedAt: 50, eventEndedAt: 200, eventTitle: 'Event', eventCalendarName: 'Work', eventCalendarSource: 'Calendar' })+ expect(reopened.notes('old').mine).toBe('My existing notes')+})diff --git a/app/test/useLoadingState.test.ts b/app/test/useLoadingState.test.tsnew file mode 100644index 00000000..3b15cb92--- /dev/null+++ b/app/test/useLoadingState.test.ts@@ -0,0 +1,37 @@+import { afterEach, expect, it, vi } from 'vitest'+import { useLoadingState } from '../src/renderer/src/useLoadingState'++const hook = vi.hoisted(() => ({ phase: 'waiting', effect: undefined as (() => (() => void)) | undefined, reduced: false }))+vi.mock('react', () => ({+ useState: () => [hook.phase, (value: string) => { hook.phase = value }],+ useRef: () => ({ current: undefined }),+ useLayoutEffect: (effect: () => (() => void)) => { hook.effect = effect },+}))+vi.mock('../src/renderer/src/motion', () => ({ useReducedMotion: () => hook.reduced }))+afterEach(() => { vi.useRealTimers(); hook.phase = 'waiting'; hook.reduced = false })++it.each([false, true])('waits 100 ms before showing the date skeleton (reduced motion: %s)', reduced => {+ vi.useFakeTimers(); hook.reduced = reduced+ useLoadingState(true)+ const cleanup = hook.effect!()+ vi.advanceTimersByTime(99)+ expect(hook.phase).toBe('waiting')+ vi.advanceTimersByTime(1)+ expect(hook.phase).toBe('skeleton')+ cleanup()+})+it('cancels a fast calendar read without flashing and preserves the default delay', () => {+ vi.useFakeTimers()+ useLoadingState(true)+ const cleanup = hook.effect!()+ vi.advanceTimersByTime(50); cleanup()+ useLoadingState(false); hook.effect!()+ vi.advanceTimersByTime(100)+ expect(hook.phase).toBe('ready')+ hook.phase = 'waiting'+ useLoadingState(true); hook.effect!()+ vi.advanceTimersByTime(99)+ expect(hook.phase).toBe('waiting')+ vi.advanceTimersByTime(1)+ expect(hook.phase).toBe('skeleton')+})