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: Summarizing… stops a summary for real; a stopped rewrite keeps the old summary, a stopped first summary offers Generate summary, and a rewrite fades the old one out in place before writing from the top
Eric Brownroutef07dc2e9c37
diff --git a/app/e2e/modelRecovery.spec.ts b/app/e2e/modelRecovery.spec.tsindex c488e01d..29ca803e 100644--- a/app/e2e/modelRecovery.spec.ts+++ b/app/e2e/modelRecovery.spec.ts@@ -6,25 +6,22 @@ import { join } from 'node:path'test('a failed notes-model download explains waiting notes and answers, and retry leaves recording usable', async () => {const app = await electron.launch({ args: [join(import.meta.dirname, '../out/main/index.js')], env: {...process.env, YOGURT_FAKE: '1', YOGURT_USER_DATA: mkdtempSync(join(tmpdir(), 'yogurt-model-recovery-')),- YOGURT_FAKE_NOTES_MODEL_MS: '30000',+ YOGURT_FAKE_NOTES_MODEL_FAIL_ONCE: '1', YOGURT_FAKE_NOTES_MODEL_MS: '4000',} })try {const page = await app.firstWindow()await expect(page.getByTestId('home')).toBeVisible()- // Controller download/retry/concurrency is covered in setup.test.ts. Exercise the- // real renderer's existing IPC boundary while fake model work waits in its queue.- await app.evaluate(({ ipcMain, BrowserWindow }) => {- let state = { phase: 'ready', fraction: 1, notesError: 'The download needs 4 GB more free space.' } as { phase: string; fraction: number; notesError?: string }+ // The actual setup controller owns the failed download and all progress events.+ // Reject one Retry transport request, then let the real handler recover it.+ await app.evaluate(({ ipcMain }) => {+ const handlers = (ipcMain as typeof ipcMain & { _invokeHandlers: Map<string, (...args: unknown[]) => unknown> })._invokeHandlers+ const retry = handlers.get('setup:retry')!let rejectOnce = true- ipcMain.removeHandler('setup:state')- ipcMain.handle('setup:state', () => state)ipcMain.removeHandler('setup:retry')- ipcMain.handle('setup:retry', () => {+ ipcMain.handle('setup:retry', (...args) => {if (rejectOnce) { rejectOnce = false; throw new Error('retry transport failed') }- state = { phase: 'ready', fraction: 1 }- for (const win of BrowserWindow.getAllWindows()) win.webContents.send('setup:state', state)+ return retry(...args)})- for (const win of BrowserWindow.getAllWindows()) win.webContents.send('setup:state', state)})await page.getByTestId('new-note').or(page.getByTestId('past-empty').getByRole('button')).first().click()await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording')@@ -60,6 +57,8 @@ test('a failed notes-model download explains waiting notes and answers, and retrawait page.getByTestId('note-stop').click()await page.getByTestId('note-summary-tab').click()await page.getByTestId('chat-close').click()+ await expect(page.getByTestId('chat-panel')).toHaveCount(0)+ await expect.poll(() => page.evaluate(id => window.yogurt.notes.get(id).then(notes => notes.status), id)).toBe('waiting')await expect(page.getByTestId('notes-model-error')).toHaveCount(1)await expect(page.getByTestId('notes-model-error')).toContainText('needs 4 GB more free space')await expect(page.getByTestId('notes-model-retry')).toHaveCSS('text-decoration-line', 'underline')diff --git a/app/e2e/recordingReminder.spec.ts b/app/e2e/recordingReminder.spec.tsindex b08d27b2..c3eb9849 100644--- a/app/e2e/recordingReminder.spec.ts+++ b/app/e2e/recordingReminder.spec.ts@@ -65,7 +65,8 @@ for (const theme of ['light', 'dark'] as const) test(`standard recording remindeawait expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording')await expect(toast).toHaveCount(0)await page.getByTestId('note-stop').click()- await expect(page.getByTestId('note-resume')).toBeEnabled({ timeout: 30_000 })+ await expect(page.getByTestId('note-resume')).toHaveAccessibleName('Resume recording', { timeout: 30_000 })+ await expect(page.getByTestId('note-resume')).toBeEnabled()await page.getByTestId('note-resume').click()await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording')await expect(toast).toHaveCount(0)diff --git a/app/e2e/resumeRecording.spec.ts b/app/e2e/resumeRecording.spec.tsindex 9a923909..660646f5 100644--- a/app/e2e/resumeRecording.spec.ts+++ b/app/e2e/resumeRecording.spec.ts@@ -12,6 +12,35 @@ async function launch(profile: string, env: Record<string, string> = {}) {return { app, page }}+test('Stop summary preserves a saved rewrite and the header label stays still on hover and focus', async () => {+ const { app, page } = await launch(mkdtempSync(join(tmpdir(), 'yogurt-summary-stop-')), { YOGURT_FAKE_LLM_MS: '120' })+ try {+ const id = await app.evaluate(async () => (await (globalThis as unknown as { __fake__: { chatMeetings(): Promise<string[]> } }).__fake__.chatMeetings())[0])+ await page.evaluate(id => window.yogurt.nav.go(`/note/${id}`), id)+ await page.getByTestId('note-summary-tab').click()+ const before = await page.evaluate(id => window.yogurt.notes.get(id), id)+ await page.evaluate(id => window.yogurt.notes.writeAgain(id), id)+ const button = page.getByTestId('note-resume')+ await expect(button).toHaveText('Summarizing…')+ const width = (await button.boundingBox())!.width+ await button.hover()+ await expect(button).toHaveAccessibleName('Stop summary')+ await expect(button).toHaveText('Summarizing…')+ expect((await button.boundingBox())!.width).toBe(width)+ await button.focus()+ await expect(page.locator('.summary-stop-square')).toHaveCSS('opacity', '1')+ await button.press('Enter')+ await expect.poll(async () => (await page.evaluate(id => window.yogurt.notes.get(id), id)).status).toBe('stopped')+ const after = await page.evaluate(id => window.yogurt.notes.get(id), id)+ expect(after.enhanced).toBe(before.enhanced)+ expect(after.edited).toBe(before.edited)+ expect(after.mine).toBe(before.mine)+ expect(after.draft).toBe('')+ await expect(page.locator('.summary-stopped')).toHaveCount(0)+ await expect(page.getByTestId('note-enhanced-editor')).toBeVisible()+ } finally { await app.close() }+})+test('a finished note resumes after reopening, preserves original data, confirms edited Summary, and appends audio', async () => {test.setTimeout(90_000)const profile = mkdtempSync(join(tmpdir(), 'yogurt-resume-'))@@ -75,7 +104,7 @@ test('a finished note resumes after reopening, preserves original data, confirms} finally { await app.close() }})-test('Finish blocks Resume while Summary is processing, then recording can resume', async () => {+test('Finish offers Stop summary and Generate summary before recording resumes', async () => {const profile = mkdtempSync(join(tmpdir(), 'yogurt-resume-writing-'))const { app, page } = await launch(profile, { YOGURT_FAKE_LLM_MS: '120' })try {@@ -86,13 +115,22 @@ test('Finish blocks Resume while Summary is processing, then recording can resumawait page.waitForTimeout(800)await page.getByTestId('note-stop').click()await expect.poll(async () => (await page.evaluate((id) => window.yogurt.notes.get(id), id)).status).toBe('writing')- await expect(page.getByTestId('note-resume')).toBeDisabled()+ await expect(page.getByTestId('note-resume')).toBeEnabled()+ await expect(page.getByTestId('note-resume')).toHaveAccessibleName('Stop summary')await expect(page.getByTestId('note-resume')).toHaveText('Summarizing…')await page.getByTestId('nav-chat').click()await page.evaluate((id) => window.yogurt.nav.go(`/note/${id}`), id)- await expect(page.getByTestId('note-resume')).toBeDisabled()- await expect(page.getByTestId('note-resume')).toBeEnabled({ timeout: 30_000 })- await expect(page.getByTestId('note-resume')).toHaveText('Resume recording')+ await expect(page.getByTestId('note-resume')).toBeEnabled()+ await page.getByTestId('note-resume').hover()+ await expect(page.getByTestId('note-resume')).toHaveText('Summarizing…')+ await expect(page.locator('.summary-stop-square')).toHaveCSS('opacity', '1')+ await page.getByTestId('note-resume').click()+ await page.getByTestId('note-summary-tab').click()+ await expect(page.getByText('Summary stopped.', { exact: true })).toBeVisible()+ expect((await page.evaluate(id => window.yogurt.notes.get(id), id)).enhanced).toBeNull()+ await page.locator('.summary-generate').click()+ await expect(page.getByTestId('note-resume')).toHaveAccessibleName('Stop summary')+ await expect(page.getByTestId('note-resume')).toHaveText('Resume recording', { timeout: 30_000 })await page.getByTestId('note-resume').click()await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording')await expect(page.getByTestId('note-notes-tab')).toHaveAttribute('aria-selected', 'true')@@ -107,18 +145,21 @@ test('Finish blocks Resume while Summary is processing, then recording can resum})-test('queued summaries block Resume and unsuccessful or empty summaries release it', async () => {+test('queued summaries offer Stop and completed, unsuccessful or empty summaries offer Resume', async () => {const { app, page } = await launch(mkdtempSync(join(tmpdir(), 'yogurt-summary-states-')))try {const id = await app.evaluate(() => (globalThis as unknown as { __fake__: { bigMeeting(n: number): string } }).__fake__.bigMeeting(10))await page.evaluate((id) => window.yogurt.nav.go(`/note/${id}`), id)const notes = await page.evaluate((id) => window.yogurt.notes.get(id), id)- for (const status of ['waiting', 'failed', 'writing', 'empty'] as const) {+ for (const status of ['waiting', 'failed', 'writing', 'empty', 'stopped', 'done'] as const) {await app.evaluate(({ BrowserWindow }, view) => {BrowserWindow.getAllWindows().find((win) => !win.webContents.getURL().includes('#'))!.webContents.send('notes:changed', view)}, { ...notes, status })- if (status === 'waiting' || status === 'writing') await expect(page.getByTestId('note-resume')).toBeDisabled()- else await expect(page.getByTestId('note-resume')).toBeEnabled()+ const busy = status === 'waiting' || status === 'writing'+ await expect(page.getByTestId('note-resume')).toBeEnabled()+ await expect(page.getByTestId('note-resume')).toHaveAccessibleName(busy ? 'Stop summary' : 'Resume recording')+ await expect(page.getByTestId('note-resume')).toHaveAttribute('aria-busy', String(busy))+ await expect(page.getByTestId('note-state')).not.toHaveAttribute('data-state', 'recording')}} finally { await app.close() }})diff --git a/app/e2e/startRecording.spec.ts b/app/e2e/startRecording.spec.tsindex 4feb068a..6907e825 100644--- a/app/e2e/startRecording.spec.ts+++ b/app/e2e/startRecording.spec.ts@@ -51,7 +51,9 @@ test('a live event resumes the same note from the title bar and menu, keeping thawait page.getByTestId('nav-home').click()await expect(page.getByTestId('new-note')).toHaveText('Resume notes · Resume fixture')await page.getByTestId('new-note').click()- await expect(page.getByTestId('note-resume')).toBeDisabled()+ await expect(page.getByTestId('note-resume')).toHaveAccessibleName('Stop summary')+ await expect(page.getByTestId('note-resume')).toBeEnabled()+ await expect(page.getByTestId('note-resume')).toHaveAttribute('aria-busy', 'true')await expect(page.getByTestId('note-state')).not.toHaveAttribute('data-state', 'recording')await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording', { timeout: 30_000 })await app.evaluate(() => { process.env.YOGURT_FAKE_LLM_MS = '1' })@@ -65,7 +67,8 @@ test('a live event resumes the same note from the title bar and menu, keeping thawait page.getByTestId('note-notes-tab').click()await page.getByRole('textbox', { name: 'My notes', exact: true }).fill('Keep this earlier decision.')await stop(page)- await expect(page.getByTestId('note-resume')).toBeEnabled({ timeout: 30_000 })+ await expect(page.getByTestId('note-resume')).toHaveAccessibleName('Resume recording', { timeout: 30_000 })+ await expect(page.getByTestId('note-resume')).toBeEnabled()await page.getByTestId('note-summary-tab').click()await page.getByRole('textbox', { name: 'Summary', exact: true }).fill('Keep this edited summary until confirmation.')await page.getByTestId('nav-home').click()diff --git a/app/e2e/summaryRim.spec.ts b/app/e2e/summaryRim.spec.tsindex 7ef4dc22..e2e454e6 100644--- a/app/e2e/summaryRim.spec.ts+++ b/app/e2e/summaryRim.spec.ts@@ -54,7 +54,7 @@ for (const theme of ['light', 'dark'] as const) for (const width of [420, 860])await expect(latest).toBeHidden()await expect.poll(() => pane.evaluate(el => el.scrollHeight - el.clientHeight - el.scrollTop)).toBeLessThan(24)await page.emulateMedia({ reducedMotion: 'reduce' })- await expect(page.locator('.summary-status-text')).toHaveCSS('animation-name', 'none')+ await expect(page.locator('.note-summary-status')).toHaveCount(0)await expect(rim).toHaveCount(0)const before = await pane.boundingBox(), scrollTop = await pane.evaluate(el => el.scrollTop)await push('done', text(22))@@ -63,8 +63,8 @@ for (const theme of ['light', 'dark'] as const) for (const width of [420, 860])const after = (await pane.boundingBox())!expect(after.y).toBe(before!.y)expect(after.width).toBe(before!.width)- // Saved summaries reserve the same status lane for the next regeneration.- expect(after.height).toBe(before!.height - 44)+ // Reading and writing use the full pane without a status lane.+ expect(after.height).toBe(before!.height)expect(await pane.evaluate(el => el.scrollTop)).toBeCloseTo(scrollTop, 0)await page.emulateMedia({ reducedMotion: 'no-preference' })await expect(page.locator('.note-reading-frame')).toHaveAttribute('data-active', 'false')diff --git a/app/src/main/fake.ts b/app/src/main/fake.tsindex ca355fac..31793c56 100644--- a/app/src/main/fake.ts+++ b/app/src/main/fake.ts@@ -2,7 +2,7 @@ import { appendFileSync, mkdirSync, writeFileSync } from 'node:fs'import { userDataDir } from './paths'import { basename, dirname, join } from 'node:path'import type { Hardware } from '@yogurt/picker'-import type { DownloadDeps } from './downloader'+import { DiskSpaceError, type DownloadDeps } from './downloader'import type { Helper } from './calendar'import type { Reading } from './detectSignals'import type { Store } from './store'@@ -22,19 +22,23 @@ export const fakeHardware = async (platform = 'darwin'): Promise<Hardware> => ({})/** Fake mode: files appear after four quick progress steps (a notes model takes notesMs longer); the hash always matches */-export const fakeDownloadDeps = (opts: { freeDiskGB?: number; stepMs?: number; notesMs?: number } = {}): DownloadDeps => ({- async download(_url, dir, fileName, onProgress, signal) {- const step = (opts.stepMs ?? 20) + (basename(dir) === 'llm' ? (opts.notesMs ?? 0) / 4 : 0)- for (const f of [0.25, 0.5, 0.75, 1]) {- if (signal?.aborted) throw Object.assign(new Error('Download stopped'), { name: 'AbortError' })- onProgress({ fraction: f, etaSec: 0 }); await new Promise((r) => setTimeout(r, step))- }- mkdirSync(dirname(join(dir, fileName)), { recursive: true })- writeFileSync(join(dir, fileName), 'fake')- },- async hashFile() { return 'FAKE' },- async freeDiskGB() { return opts.freeDiskGB ?? 1000 },-})+export const fakeDownloadDeps = (opts: { freeDiskGB?: number; stepMs?: number; notesMs?: number; notesFailOnce?: boolean } = {}): DownloadDeps => {+ let failNotes = opts.notesFailOnce+ return {+ async download(_url, dir, fileName, onProgress, signal) {+ if (basename(dir) === 'llm' && failNotes) { failNotes = false; throw new DiskSpaceError(4) }+ const step = (opts.stepMs ?? 20) + (basename(dir) === 'llm' ? (opts.notesMs ?? 0) / 4 : 0)+ for (const f of [0.25, 0.5, 0.75, 1]) {+ if (signal?.aborted) throw Object.assign(new Error('Download stopped'), { name: 'AbortError' })+ onProgress({ fraction: f, etaSec: 0 }); await new Promise((r) => setTimeout(r, step))+ }+ mkdirSync(dirname(join(dir, fileName)), { recursive: true })+ writeFileSync(join(dir, fileName), 'fake')+ },+ async hashFile() { return 'FAKE' },+ async freeDiskGB() { return opts.freeDiskGB ?? 1000 },+ }+}// ---- calendar and meeting detection (fake mode only) ----diff --git a/app/src/main/index.ts b/app/src/main/index.tsindex 8329ba04..97086fec 100644--- a/app/src/main/index.ts+++ b/app/src/main/index.ts@@ -172,7 +172,7 @@ function createSetup(): SetupController {getHardware: isFake() ? () => fakeHardware(platform) : async () => toHardware(await readSysInfo(userDataDir()), process.platform === 'darwin' ? undefined : await probeGpu()),// the one in this build: new models come with app updatesgetCatalog: async () => loadCatalog({ bundled: bundledCatalog, licenses }),- download: isFake() ? fakeDownloadDeps({ stepMs: Number(process.env.YOGURT_FAKE_STEP_MS ?? 5), notesMs: Number(process.env.YOGURT_FAKE_NOTES_MODEL_MS ?? 0) }) : realDeps,+ download: isFake() ? fakeDownloadDeps({ stepMs: Number(process.env.YOGURT_FAKE_STEP_MS ?? 5), notesMs: Number(process.env.YOGURT_FAKE_NOTES_MODEL_MS ?? 0), notesFailOnce: process.env.YOGURT_FAKE_NOTES_MODEL_FAIL_ONCE === '1' }) : realDeps,...(isFake() ? { sha256Override: 'FAKE' } : {}),// Windows and Linux: speech models timed on this computer (asr/speedCheck.ts); a Mac never is...(platform === 'darwin' ? {} : { speed: { ...speedStore(speedFile()), measure: isFake() ? fakeMeasure() : (model: string) => measureSpeed(model, { binary: whisperServerPath(), vadModel: vadModelPath(), clip: speedClipPath() ?? '' }) } }),@@ -741,6 +741,7 @@ app.whenReady().then(() => {ipcMain.handle('notes:set-enhanced', (_e, id: unknown, md: unknown, revision: unknown) => saveEdit(id, 'enhanced', md, revision))ipcMain.on('notes:flush-sync', (e, id: unknown, side: unknown, md: unknown, revision: unknown) => { e.returnValue = saveEdit(id, side, md, revision) })ipcMain.on('notes:kept-edits', (_e, id: unknown) => { if (known(id)) notes.keptEdits(id) })+ ipcMain.handle('notes:stop', (_e, id: unknown) => { if (known(id)) return notes.stop(id) })ipcMain.handle('notes:write-again', (_e, id: unknown, note: unknown) => {const instruction = rewriteNote(note)if (known(id) && instruction !== undefined) void notes.writeAgain(id, instruction)diff --git a/app/src/main/notes/enhance.ts b/app/src/main/notes/enhance.tsindex 1aeca3f6..4b76e56d 100644--- a/app/src/main/notes/enhance.ts+++ b/app/src/main/notes/enhance.ts@@ -303,6 +303,7 @@ const nextStepsPrompt = (language: string) =>`Now write only the "## Next steps" section (heading in ${language || 'the same language'}): one bullet per thing someone will do after the meeting, as "- **Name:** what they will do, by when" (the when only if it was said), "You" for the person these notes are for, and plain words for who they are for someone without a name ("Them" is not a name). If nobody is to do anything, answer only NONE. Nothing else.`export type EnhanceInput = {+ signal?: AbortSignalmeeting: { title: string; attendees: Person[] }; mine: string; segments: Segment[]; language: string | null; note?: string/** a locale from Settings; a rewrite note may override it */summaryLanguage?: string@@ -375,6 +376,7 @@ function oneMic(segments: Segment[]): boolean {* earlier: parts summarised while the meeting was recorded; those still matching the transcript are used as they are.*/export async function enhance(input: EnhanceInput, llm: Llm, onToken: (text: string) => void, onPart?: (part: number, of: number) => void, earlier: PartSummary[] = []): Promise<string> {+ input.signal?.throwIfAborted()const language = languageName(input.language)const summaryLanguage = LOCALES.find((l) => l.id === input.summaryLanguage)?.englishlet first = Infinity, last = -Infinity@@ -389,10 +391,12 @@ export async function enhance(input: EnhanceInput, llm: Llm, onToken: (text: strconst lines = transcript.split('\n')const done = round === 0 ? reusable(lines, earlier) : []const [overhead, ...lineTokens] = await llm.count([enhancePrompt({ ...base, transcript: '', parts }), ...lines])+ input.signal?.throwIfAborted()const total = lineTokens.reduce((a, b) => a + b + 1, 0)// parts summarised during the meeting mean it was too long already: those are used even if it fits nowif (!done.length && overhead + total + NOTES_TOKENS <= llm.contextSize) breakconst max = await partBudget(llm, language)+ input.signal?.throwIfAborted()const from = done.reduce((n, p) => n + p.lines.length, 0)const rest = lineTokens.slice(from).reduce((a, b) => a + b + 1, 0)// even parts read better than one full part and a scrap@@ -402,16 +406,19 @@ export async function enhance(input: EnhanceInput, llm: Llm, onToken: (text: strconst pieces = from < lines.length ? splitForContext(lines.slice(from).join('\n'), target, count) : []const summaries = done.map((p) => p.summary)for (const piece of pieces) {+ input.signal?.throwIfAborted()const n = summaries.length + 1onPart?.(n, done.length + pieces.length)summaries.push(tidyNotes(await llm.chat(summaryPrompt(piece, n, language), () => {}, { summary: true, maxTokens: SUMMARY_TOKENS })))}+ input.signal?.throwIfAborted()transcript = summaries.map((s, i) => `Part ${i + 1}:\n${s}`).join('\n')parts = true}const prompt = enhancePrompt({ ...base, transcript, parts })- let md = tidyNotes(await llm.chat(prompt, onToken, { maxTokens: NOTES_TOKENS }), !!input.note?.trim())+ let md = tidyNotes(await llm.chat(prompt, (text) => { if (!input.signal?.aborted) onToken(text) }, { maxTokens: NOTES_TOKENS }), !!input.note?.trim())+ input.signal?.throwIfAborted()const written = md// the model sometimes stops before the next steps (it samples): ask for just that part, after what it wrote. Notes// with three sections or more and still none had none to give@@ -419,16 +426,19 @@ export async function enhance(input: EnhanceInput, llm: Llm, onToken: (text: str// shown as it is written only once it starts like the section, so a chatty answer never flashes uplet held = '', showing = falseconst show = (t: string) => {+ if (input.signal?.aborted) returnif (showing) { onToken(t); return }held += tif (held.trimStart().startsWith('#')) { showing = true; onToken(`\n${held.trimStart()}`) }}const more = tidyNotes(await llm.chat([nextStepsPrompt(summaryLanguage ? 'the same language as the notes; write the bullets in that language too' : language), ...rewriteInstruction(input.note), ...(input.note?.trim() ? ['If that instruction excludes next steps, answer only NONE.'] : [])].join('\n'), show, { maxTokens: 400, before: [prompt, md] }))+ input.signal?.throwIfAborted()// only a real next-steps list is kept; anything else it said is droppedif (OWNER.test(more)) md = `${md}\n${more}`}// a title is nice to have: one that fails or comes out empty leaves the meeting's as it isif (written) input.titleLater?.((model) => model.chat([titlePrompt(summaryLanguage ? '' : language, input.me, input.meeting.attendees), ...(input.note?.trim() ? ['Use the language requested in this rewrite instruction for the title too; its other requests apply only to the notes:', JSON.stringify(input.note.slice(0, REWRITE_NOTE_MAX).trim())] : [])].join('\n'), () => {}, { maxTokens: 40, before: [prompt, written], temperature: 0.3 }).then((raw) => cleanTitle(raw, input.me), (e) => { console.error('a title from the notes failed', e); return '' }))+ input.signal?.throwIfAborted()return markMine(withoutCopies(md, input.mine), input.mine)}diff --git a/app/src/main/notes/index.ts b/app/src/main/notes/index.tsindex 05632422..8cf84d69 100644--- a/app/src/main/notes/index.ts+++ b/app/src/main/notes/index.ts@@ -46,6 +46,8 @@ export function hookNotes(p: {/** the person's own name, so the invite's other person is known */me?: () => string}) {+ const stopped = new Set<string>()+ const stopping = new Map<string, Promise<void>>()const resuming = new Map<string, object>()const live = new Map<string, { status: NoteStatus; draft: string; part?: { part: number; of: number }; step?: 'loading' }>()/** a rewrite for new people, waiting for the changes to settle */@@ -135,12 +137,13 @@ export function hookNotes(p: {console.info('NOTES', `writing the notes of ${id}`)if (!quiet && p.showLoading && p.model.needsLoad?.()) set(id, 'waiting', '', undefined, 'loading')const llm = await p.model.llm(signal)+ signal.throwIfAborted()if (!quiet && live.get(id)?.step) set(id, 'waiting')// a generic title (or one made from earlier notes) gets one from these notes; theirs or the calendar's neverconst retitle = (x: Meeting) => x.titleSource === 'generic' || x.titleSource === 'auto'let askTitle: ((llm: Llm) => Promise<string>) | undefined- const md = await enhance({ meeting: m, mine, segments, language, note, summaryLanguage: p.summaryLanguage?.(), me: p.me?.(), words: meetingWords(m), ...(retitle(m) ? { titleLater: (ask) => { askTitle = ask } } : {}) }, llm, (t) => {- if (quiet) return+ const md = await enhance({ signal, meeting: m, mine, segments, language, note, summaryLanguage: p.summaryLanguage?.(), me: p.me?.(), words: meetingWords(m), ...(retitle(m) ? { titleLater: (ask) => { askTitle = ask } } : {}) }, llm, (t) => {+ if (quiet || signal.aborted) returndraft += tif (timer) returnconst wait = DRAFT_EVERY_MS - (Date.now() - last)@@ -160,7 +163,7 @@ export function hookNotes(p: {p.summarized?.(id)return}- if (signal.aborted) { set(id, 'waiting'); return }+ signal.throwIfAborted()// the person's own notes stay as they typed them, even if they typed on while this was writtenp.store.setNotes(id, { enhanced: md, edited: false })p.store.setWrittenWith(id, used.stamp)@@ -171,7 +174,7 @@ export function hookNotes(p: {if (timer) clearTimeout(timer)if (quiet) { if (!signal.aborted) console.error('writing the notes again for new people failed', id, e); throw e }// stopped for a recording: it runs again after- if (signal.aborted) { set(id, 'waiting'); throw e }+ if (signal.aborted) { if (!stopped.has(id)) set(id, 'waiting'); throw e }console.error('writing the notes failed', id, e)set(id, 'failed')throw e@@ -221,6 +224,7 @@ export function hookNotes(p: {const queueWrite = (id: string, note?: string) => {console.info('NOTES', `queued the notes of ${id}`)+ stopped.delete(id)set(id, 'waiting')return p.queue.enqueue((signal) => write(id, signal, false, note), 'enhance', id).catch(() => {})}@@ -228,18 +232,33 @@ export function hookNotes(p: {/** each meeting's notes after it stopped, until they are written */const afterStop = new Map<string, Promise<void>>()p.onStop((m) => {+ stopped.delete(m.id)set(m.id, 'waiting')- const done = (async () => {+ const done = Promise.resolve().then(async () => {await p.transcribed(m.id)// the names from the call are quick; a stuck pass never holds the notes back for longif (p.named) await upTo(p.named(m.id), p.namesWaitMs ?? NAMES_WAIT_MS)- if (!resuming.has(m.id)) await queueWrite(m.id)- })().catch((e) => console.error('notes after the meeting failed', e)).finally(() => afterStop.delete(m.id))+ if (!resuming.has(m.id) && afterStop.get(m.id) === done) await queueWrite(m.id)+ }).catch((e) => console.error('notes after the meeting failed', e)).finally(() => { if (afterStop.get(m.id) === done) afterStop.delete(m.id) })afterStop.set(m.id, done)})const notes = {view,+ /** A user stop is final; queue preemption for a recording still resumes later. */+ stop(id: string): Promise<void> {+ const pending = stopping.get(id)+ if (pending) return pending+ if (!['waiting', 'writing'].includes(live.get(id)?.status ?? '')) return Promise.resolve()+ stopped.add(id)+ afterStop.delete(id)+ const m = p.store.meeting(id)+ if (m?.state === 'stopped') { p.store.updateMeeting(id, { state: 'done' }); p.changed(id) }+ set(id, 'stopped')+ const settled = p.queue.cancelAnalysis(id, 'enhance').finally(() => { stopping.delete(id) })+ stopping.set(id, settled)+ return settled+ },/** Hold obsolete analysis while a finished note is prepared for another recording session. */suspendForResume(id: string) {const token = {}, restore = afterStop.has(id) || live.get(id)?.status === 'waiting' || live.get(id)?.status === 'writing' || rewriteTimers.has(id) || rewriting.has(id)@@ -300,7 +319,9 @@ export function hookNotes(p: {pendingDraftId: () => [...edits].find(([, sides]) => Object.values(sides).some((v) => v.text !== undefined))?.[0],forgetDrafts: (id: string) => { edits.delete(id) },/** "Write again": the same job, now (after anything already waiting) */- writeAgain(id: string, note?: string) {+ async writeAgain(id: string, note?: string) {+ const pending = stopping.get(id)+ if (pending) await pendingif (resuming.has(id) || p.store.meeting(id)?.state === 'recording') return Promise.resolve()if (!retryDrafts(id)) return Promise.resolve()const s = live.get(id)?.statusdiff --git a/app/src/main/notes/queue.ts b/app/src/main/notes/queue.tsindex 6cbf8a47..6706700b 100644--- a/app/src/main/notes/queue.ts+++ b/app/src/main/notes/queue.ts@@ -140,8 +140,8 @@ export function createQueue(o: {return done},/** Resume replaces only old analysis, without the permanent tombstone used for deletion. */- cancelAnalysis(meetingId: string): Promise<void> {- const matches = (e: Entry) => e.meetingId === meetingId && (e.kind === 'enhance' || e.kind === 'readahead' || e.kind === 'folder')+ cancelAnalysis(meetingId: string, kind?: 'enhance'): Promise<void> {+ const matches = (e: Entry) => e.meetingId === meetingId && (kind ? e.kind === kind : e.kind === 'enhance' || e.kind === 'readahead' || e.kind === 'folder')for (const e of waiting.filter(matches)) { waiting.splice(waiting.indexOf(e), 1); e.cancelled = true; e.resolve() }if (!running || !matches(running.entry)) return Promise.resolve()const { entry, abort } = runningdiff --git a/app/src/preload/index.ts b/app/src/preload/index.tsindex 8588cb72..c1bf5bb4 100644--- a/app/src/preload/index.ts+++ b/app/src/preload/index.ts@@ -119,6 +119,7 @@ const api: YogurtApi = {},keptEdits: (id) => { ipcRenderer.send('notes:kept-edits', id) },writeAgain: (id, note) => ipcRenderer.invoke('notes:write-again', id, note),+ stop: (id) => ipcRenderer.invoke('notes:stop', id),onChange: (cb) => {const on = (_e: unknown, v: NoteView) => cb(v)ipcRenderer.on('notes:changed', on)diff --git a/app/src/renderer/src/components/NoteReadingPane.tsx b/app/src/renderer/src/components/NoteReadingPane.tsxindex 7ba78d38..e8f26ac6 100644--- a/app/src/renderer/src/components/NoteReadingPane.tsx+++ b/app/src/renderer/src/components/NoteReadingPane.tsx@@ -4,8 +4,8 @@ import { t } from '../../../shared/i18n'import { useFollowLatest } from '../useFollowLatest'import { ScrollFade } from './ScrollFade'-export function NoteReadingPane({ active, summary, hasSummary, generating, writing, scroll, children }: {- active: boolean; summary: boolean; hasSummary: boolean; generating: boolean; writing: boolean; scroll: RefObject<HTMLElement | null>; children: ReactNode+export function NoteReadingPane({ active, summary, generating, writing, resetting = false, scroll, children }: {+ active: boolean; summary: boolean; generating: boolean; writing: boolean; resetting?: boolean; scroll: RefObject<HTMLElement | null>; children: ReactNode}) {const frame = useRef<HTMLDivElement>(null), content = useRef<HTMLDivElement>(null)const [visible, setVisible] = useState(false)@@ -18,15 +18,15 @@ export function NoteReadingPane({ active, summary, hasSummary, generating, writidocument.addEventListener('visibilitychange', sync)return () => { observer.disconnect(); document.removeEventListener('visibilitychange', sync) }}, [active, generating])- const follow = useFollowLatest(scroll, content, active && generating && visible)+ const follow = useFollowLatest(scroll, content, active && writing && visible)useLayoutEffect(() => { if (writing) follow.resume() }, [writing])- return <div ref={frame} className="note-reading-frame" hidden={!active} data-has-summary={summary && hasSummary} data-generating={generating} data-active={active && generating && visible}>+ useLayoutEffect(() => { if (resetting && scroll.current) scroll.current.scrollTop = 0 }, [resetting, scroll])+ return <div ref={frame} className="note-reading-frame" hidden={!active} data-resetting={resetting} data-generating={generating} data-active={active && generating && visible}><div className="note-reading-clip"><ScrollFade enabled={active}><section ref={scroll} id="note-notes-panel" role="tabpanel" aria-labelledby={summary ? 'note-summary-tab' : 'note-notes-tab'} className="note-content note-notes-pane"><div ref={content} className="note-page-width note-notes-body">{children}</div></section></ScrollFade></div>- {writing && !follow.behind && <span className="note-summary-status" aria-hidden="true"><span className="summary-status-text">{t('Generating notes…')}</span></span>}{follow.behind && <button type="button" className="note-latest" data-testid="note-summary-latest" onClick={follow.latest}><ArrowDown size={12} aria-hidden="true" />{t('Latest')}</button>}</div>}diff --git a/app/src/renderer/src/components/SummaryWaiting.tsx b/app/src/renderer/src/components/SummaryWaiting.tsxindex b57ff9da..98c98258 100644--- a/app/src/renderer/src/components/SummaryWaiting.tsx+++ b/app/src/renderer/src/components/SummaryWaiting.tsx@@ -1,15 +1,8 @@-import { useLayoutEffect, useRef, useState } from 'react'-import { createPortal } from 'react-dom'import { t } from '../../../shared/i18n'import type { NoteView } from '../../../shared/types'-export function SummaryWaiting({ part, outline = true, writing = false }: { part?: NoteView['part']; outline?: boolean; writing?: boolean }) {- const anchor = useRef<HTMLSpanElement>(null)- const [frame, setFrame] = useState<Element | null>(null)- useLayoutEffect(() => {- if (!outline) setFrame(anchor.current?.closest('.note-reading-frame') ?? null)- }, [outline])- const content = <div data-testid="note-enhanced-waiting" className="summary-waiting" aria-live="polite">+export function SummaryWaiting({ part, outline = true }: { part?: NoteView['part']; outline?: boolean }) {+ return <div data-testid="note-enhanced-waiting" className="summary-waiting" aria-live="polite">{outline && <div className="summary-outline" aria-hidden="true">{[0, 1].map(block => <div key={block} className="summary-outline-block"><div className="summary-outline-bar summary-outline-heading" />@@ -18,8 +11,6 @@ export function SummaryWaiting({ part, outline = true, writing = false }: { part</div>)}</div>)}</div>}- <span className="note-summary-status"><span className="summary-status-text">{writing ? t('Generating notes…') : part ? t('Reading a long meeting, part {part} of {of}…', { part: part.part, of: part.of }) : t('Reading the transcript…')}</span></span>+ <span className="sr-only">{part ? t('Reading a long meeting, part {part} of {of}…', { part: part.part, of: part.of }) : t('Reading the transcript…')}</span></div>- // The scroller masks its descendants; the rewrite label belongs in the frame's reserved lane.- return outline ? content : <><span ref={anchor} hidden />{frame ? createPortal(content, frame) : content}</>}diff --git a/app/src/renderer/src/followLatest.ts b/app/src/renderer/src/followLatest.tsindex 27591552..f97053a2 100644--- a/app/src/renderer/src/followLatest.ts+++ b/app/src/renderer/src/followLatest.ts@@ -6,7 +6,7 @@ export function attachFollowLatest(el: HTMLElement, body: HTMLElement, stuck: {const stop = () => { glide?.stop(); glide = undefined }const report = () => behind(el.scrollHeight - el.scrollTop - el.clientHeight >= 24)const follow = () => {- if (document.hidden || !el.clientHeight) return+ if (document.hidden || !el.clientHeight || el.scrollHeight <= el.clientHeight) returnif (stuck.current) {if (glide?.active) glide.to(Math.max(0, el.scrollHeight - el.clientHeight))else { el.scrollTop = el.scrollHeight; last = el.scrollTop }@@ -41,9 +41,9 @@ export function attachFollowLatest(el: HTMLElement, body: HTMLElement, stuck: {return {latest() {stuck.current = true; behind(false)- if (document.hidden || !el.clientHeight) return+ if (document.hidden || !el.clientHeight || el.scrollHeight <= el.clientHeight) returnstop()- glide = followGlide(el, () => {})+ glide = followGlide(el, () => { last = el.scrollTop; report() })glide.to(Math.max(0, el.scrollHeight - el.clientHeight))},dispose() {diff --git a/app/src/renderer/src/noteMerge.ts b/app/src/renderer/src/noteMerge.tsindex 57829143..25b4f150 100644--- a/app/src/renderer/src/noteMerge.ts+++ b/app/src/renderer/src/noteMerge.ts@@ -8,8 +8,8 @@ import type { NoteView } from '../../shared/types'*/export function mergeNoteView(cur: NoteView | undefined, v: NoteView): { view: NoteView; /** a rewrite was turned down for edits on screen */ keptEdits?: true } {if (!cur) return { view: v }- // A failed rewrite's previous result is still editable, including when the person clears its text.- const finished = cur.status === v.status && (cur.status === 'done' || (cur.status === 'failed' && cur.enhanced != null))+ // A failed or stopped rewrite's previous result is still editable, including when the person clears its text.+ const finished = cur.status === v.status && (cur.status === 'done' || ((cur.status === 'failed' || cur.status === 'stopped') && cur.enhanced != null))if (!finished) return { view: { ...v, mine: cur.mine } }if (v.rewrittenFrom !== undefined && (cur.enhanced ?? '') === v.rewrittenFrom) return { view: { ...v, mine: cur.mine } }return { view: { ...v, mine: cur.mine, enhanced: cur.enhanced }, ...(v.rewrittenFrom !== undefined ? { keptEdits: true as const } : {}) }diff --git a/app/src/renderer/src/screens/Note.tsx b/app/src/renderer/src/screens/Note.tsxindex 04593ff0..ed06eb1d 100644--- a/app/src/renderer/src/screens/Note.tsx+++ b/app/src/renderer/src/screens/Note.tsx@@ -322,7 +322,11 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource, onResu}const hasSummary = !!notes.enhanced?.trim()const generation = summaryAction({ hasSummary, hasContent: hasTranscript || !!notes.mine.trim(), recording, busy: summarizing, downloading: !!(setup?.notesDownloading || setup?.notesError), trashed })- const requestRewrite = () => { if (generation && !generation.reason) setRewriteOpen(true) }+ const requestRewrite = () => {+ if (!generation || generation.reason) return+ if (hasSummary) setRewriteOpen(true)+ else void writeAgain()+ }return (<LoadingContent pending={false} skeleton={<Loading layout="note" />} className="loading-note-frame"><div data-testid="note" className="document-main relative flex h-full bg-bg">@@ -364,9 +368,9 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource, onResu</button></>}{finishing && <span data-testid="note-finishing" role="status" className="note-finishing">{t('Finishing…')}</span>}- {!finishing && (m.state === 'stopped' || m.state === 'done') && !m.stopSavePending && !trashed && <button data-testid="note-resume" disabled={starting || summarizing} aria-busy={summarizing} data-processing={summarizing} onClick={() => void resumeRecording()}- className="note-record-action note-resume-action" title={summarizing ? t('Summarizing…') : t('Resume recording in this note')}>- <Swap show={summarizing ? 'busy' : 'mic'} options={{ mic: <Mic size={14} />, busy: <Loader size={14} /> }} />+ {!finishing && (m.state === 'stopped' || m.state === 'done') && !m.stopSavePending && !trashed && <button data-testid="note-resume" disabled={starting} aria-busy={summarizing} data-processing={summarizing} onClick={() => { if (summarizing) void window.yogurt.notes.stop(id).catch(console.error); else void resumeRecording() }}+ aria-label={summarizing ? t('Stop summary') : t('Resume recording')} className="note-record-action note-resume-action" title={summarizing ? t('Stop summary') : t('Resume recording in this note')}>+ <Swap show={summarizing ? 'busy' : 'mic'} options={{ mic: <Mic size={14} />, busy: <span className="summary-stop-icon"><Loader size={14} /><span className="summary-stop-square" /></span> }} /><SwapText text={summarizing ? t('Summarizing…') : starting ? t('Preparing…') : t('Resume recording')} widest={t('Resume recording')} /></button>}{m.state === 'prepared' && !trashed && <button data-testid="note-start" disabled={starting} onClick={() => { void startPrepared() }} className="note-record-action primary">@@ -407,7 +411,7 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource, onResu</header><div ref={setChatAnchor} className="note-reading-area"><div ref={panels} className="note-panels">- <NoteReadingPane active={primary === 'notes'} summary={shown === 'enhanced'} hasSummary={notes.enhanced != null} generating={shown === 'enhanced' && ['waiting', 'streaming'].includes(summaryState)} writing={shown === 'enhanced' && summaryState === 'streaming'} scroll={readingScroll}>+ <NoteReadingPane active={primary === 'notes'} summary={shown === 'enhanced'} generating={shown === 'enhanced' && ['waiting', 'rewriting', 'handoff', 'reset', 'streaming'].includes(summaryState)} resetting={shown === 'enhanced' && summaryState === 'reset'} writing={shown === 'enhanced' && summaryState === 'streaming'} scroll={readingScroll}>{shown === 'mine' ? <Editorfocus={primary === 'notes' && at?.ms === null ? at : undefined} testId="note-mine" label={t('My notes')} className="min-h-[40vh]" markdown={notes.mine} placeholder={t('You can add notes here to guide the summary.')}onChange={(md) => { typing.current = true; const next = { ...current.current!, mine: md }; current.current = next; setNotes(next); mineSave.change(md) }}@@ -499,7 +503,7 @@ function Title({ id, title, editing, onEdit }: { id: string; title: string; edit/** The enhanced side: waiting, the draft as it is written, the saved notes (editable), or what went wrong */function Enhanced({ notes, presentation, disabled, onChange, onBlur, onRetry, focus }: { presentation: ReturnType<typeof useSummaryPresentation>; focus?: { match?: string; seq: number }; notes: NoteView; disabled?: boolean; onChange: (md: string) => void; onBlur: () => void; onRetry: () => void }) {const { status } = notes- const handoff = presentation === 'handoff'+ const handoff = presentation === 'handoff' || presentation === 'reset'const writing = presentation === 'waiting' || presentation === 'streaming' || handoffconst rewriting = presentation === 'rewriting'const surface = useRef<HTMLDivElement>(null), height = useRef(0)@@ -520,6 +524,10 @@ function Enhanced({ notes, presentation, disabled, onChange, onBlur, onRetry, fo</InlineError>)}+ if (presentation === 'stopped') return <div className="summary-stopped">+ <p role="status">{t('Summary stopped.')}</p>+ <button type="button" onClick={onRetry} className="summary-generate flex items-center gap-2.5 rounded-xl px-3 py-2 text-start text-sm whitespace-nowrap text-ink hover:bg-[var(--line)] focus-visible:bg-[var(--line)]"><RotateCcw size={15} strokeWidth={1.75} aria-hidden="true" className="text-muted" />{t('Generate summary')}</button>+ </div>if (presentation === 'empty') return <p data-testid="note-enhanced-empty" className="text-[15px] text-muted">{t('There is no transcript or typed note to summarize.')}</p>if (presentation === 'waiting') {return (@@ -536,14 +544,11 @@ function Enhanced({ notes, presentation, disabled, onChange, onBlur, onRetry, fo<span>{t("Yogurt couldn't regenerate the summary, so your previous version is still shown.")}</span><button onClick={onRetry} className="inline-error-action">{t('Try again')}</button></InlineError>}- {(rewriting || handoff) && <SummaryWaiting outline={false} writing={handoff} part={status === 'writing' ? notes.part : undefined} />}- <div ref={surface} className="summary-rewrite" data-rewriting={rewriting} data-handoff={handoff} style={handoff ? { minHeight: height.current } : undefined}>+ {rewriting && <SummaryWaiting outline={false} part={status === 'writing' ? notes.part : undefined} />}+ <div ref={surface} className="summary-rewrite" data-rewriting={rewriting} data-handoff={handoff} data-resetting={presentation === 'reset'} style={handoff ? { minHeight: height.current } : undefined}><div className="summary-result">- <Editor focus={focus} testId="note-enhanced-editor" label={t('Summary')} className="enhanced" markdown={writing ? draft : notes.enhanced ?? ''} streaming={writing} editable={!writing && !rewriting && !disabled} onChange={onChange} onBlur={onBlur} />+ <Editor focus={focus} testId="note-enhanced-editor" label={t('Summary')} className="enhanced" markdown={handoff ? notes.enhanced ?? '' : writing ? draft : notes.enhanced ?? ''} streaming={writing && !handoff} editable={!writing && !rewriting && !disabled} onChange={onChange} onBlur={onBlur} /></div>- {handoff && <div className="summary-previous" aria-hidden="true" inert>- <Editor testId="note-enhanced-previous" label={t('Summary')} className="enhanced" markdown={notes.enhanced ?? ''} editable={false} />- </div>}</div>{/* the caret dot and the Summarizing pill show progress; a visible label here would ride the end of the text up and down */}{writing && <p className="sr-only" aria-live="polite">{t('Generating notes…')}</p>}diff --git a/app/src/renderer/src/styles.css b/app/src/renderer/src/styles.cssindex 589764e5..a00de5dd 100644--- a/app/src/renderer/src/styles.css+++ b/app/src/renderer/src/styles.css@@ -608,7 +608,6 @@ input::selection, textarea::selection, .note-prose ::selection { background: var.chat-panel-contents { position:relative;display:flex;flex-direction:column;flex:1;min-height:0;min-width:0; }.chat-trigger[aria-expanded=true] { opacity:0; }.note-resume-action { min-width:160px; }-.note-recording-group .note-record-action[data-processing=true] { cursor:wait; }[data-icon] { flex:none; }[data-icon=Loader] { animation:icon-spin 1s linear infinite; }[data-icon] path { transform-box:fill-box;transform-origin:center; }@@ -877,18 +876,27 @@ html:not(.widget) button:focus-visible, html:not(.widget) input:focus-visible {@starting-style { .search-panel.dialog-motion { transform:none; } }}-/* The first chunk warms up out of view while the old reading surface fades. */+/* Keep the same editor through the fade; reset its scroll only while hidden. */.summary-rewrite { position:relative; }.summary-rewrite[data-rewriting=true]>.summary-result { opacity:.45;user-select:none;pointer-events:none; }-.summary-previous { pointer-events:none;animation:summary-rewrite-out var(--dur-micro) var(--ease-out) reverse both; }-.summary-rewrite[data-handoff=true]>.summary-result { position:absolute;inset:0;visibility:hidden;animation:summary-handoff-in 0s var(--dur-micro) forwards; }-@keyframes summary-rewrite-out { from { opacity:0; } to { opacity:.45; } }-@keyframes summary-handoff-in { to { visibility:visible; } }-@media (prefers-reduced-motion: reduce) {- .summary-previous { display:none; }- .summary-rewrite[data-handoff=true]>.summary-result { position:static;visibility:visible;animation:none; }+.summary-rewrite[data-handoff=true]>.summary-result { animation:summary-rewrite-out var(--dur-micro) var(--ease-out) both;pointer-events:none; }+.summary-rewrite[data-resetting=true] { visibility:hidden; }+@keyframes summary-rewrite-out { from { opacity:1; } to { opacity:0; } }+@media (prefers-reduced-motion:no-preference) {+ .summary-rewrite:is([data-rewriting=true],[data-handoff=true])>.summary-result { opacity:1; }+ .summary-rewrite:is([data-rewriting=true],[data-handoff=true]) .note-prose {+ background:linear-gradient(100deg,color-mix(in srgb,var(--written) 45%,transparent) 38%,color-mix(in srgb,var(--ink) 90%,transparent) 50%,color-mix(in srgb,var(--written) 45%,transparent) 62%) 0 0 / 250% 100%;+ -webkit-background-clip:text;background-clip:text;color:transparent;animation:step-shimmer 2.8s linear infinite;+ }+ .summary-rewrite:is([data-rewriting=true],[data-handoff=true]) .note-prose :is(h1,h2,h3,p,li,strong,a,em) { color:transparent; }+ .summary-rewrite:is([data-rewriting=true],[data-handoff=true]) .note-prose li::marker { color:color-mix(in srgb,var(--ink) 31.5%,transparent); }}--/* the summary's status line shimmers like Ask's thinking line */-.summary-status-text { background:linear-gradient(100deg,var(--muted) 35%,var(--ink) 50%,var(--muted) 65%) 0 0 / 250% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:step-shimmer 2.2s linear infinite; }-@media (prefers-reduced-motion: reduce) { .summary-status-text { animation:none;background:none;color:inherit; } }+.summary-stop-icon { display:inline-grid;place-items:center;width:14px;height:14px; }+.summary-stop-icon>* { grid-area:1/1;transition:opacity var(--dur-base) var(--ease-out); }+.summary-stop-square { width:10px;height:10px;border-radius:2px;background:currentColor;opacity:0; }+.note-resume-action[data-processing=true] { color:var(--muted);cursor:pointer; }+.note-resume-action[data-processing=true]:hover { background:var(--float); }+.note-resume-action:is(:hover,:focus-visible) .summary-stop-icon>svg { opacity:0; }+.note-resume-action:is(:hover,:focus-visible) .summary-stop-square { opacity:1; }+.summary-stopped { display:flex;flex-direction:column;align-items:flex-start;gap:8px;color:var(--muted);font-size:13px; }+@media (prefers-reduced-motion:reduce) { .summary-stop-icon>* { transition:none; } }diff --git a/app/src/renderer/src/summaryPresentation.ts b/app/src/renderer/src/summaryPresentation.tsindex 671492ef..51532dd1 100644--- a/app/src/renderer/src/summaryPresentation.ts+++ b/app/src/renderer/src/summaryPresentation.ts@@ -11,6 +11,7 @@ export function summaryPresentation(notes: Pick<NoteView, 'status' | 'enhanced'if (notes.enhanced != null) return 'saved'if (notes.status === 'failed') return 'failed'if (notes.status === 'empty') return 'empty'+ if (notes.status === 'stopped') return 'stopped'return 'saved'}@@ -18,15 +19,19 @@ export function summaryPresentation(notes: Pick<NoteView, 'status' | 'enhanced'export function useSummaryPresentation(notes: NoteView | undefined, reduced: boolean) {const presentation = notes ? summaryPresentation(notes) : 'saved'const id = notes?.meetingId- const [last, setLast] = useState({ id, presentation, fading: false })+ const [last, setLast] = useState({ id, presentation, fading: false, resetting: false })if (last.id !== id || last.presentation !== presentation) {- setLast({ id, presentation, fading: !reduced && last.id === id && last.presentation === 'rewriting' && presentation === 'streaming' })+ setLast({ id, presentation, resetting: reduced && last.id === id && last.presentation === 'rewriting' && presentation === 'streaming', fading: !reduced && last.id === id && last.presentation === 'rewriting' && presentation === 'streaming' })}useEffect(() => {+ if (last.resetting) {+ const frame = requestAnimationFrame(() => setLast(s => ({ ...s, resetting: false })))+ return () => cancelAnimationFrame(frame)+ }if (!last.fading) return- if (reduced) { setLast(s => ({ ...s, fading: false })); return }- const timer = setTimeout(() => setLast(s => ({ ...s, fading: false })), motion.micro)+ if (reduced) { setLast(s => ({ ...s, fading: false, resetting: true })); return }+ const timer = setTimeout(() => setLast(s => ({ ...s, fading: false, resetting: true })), motion.micro)return () => clearTimeout(timer)- }, [last.fading, reduced, id])- return last.fading && !reduced ? 'handoff' : presentation+ }, [last.fading, last.resetting, reduced, id])+ return last.resetting || last.fading && reduced ? 'reset' : last.fading ? 'handoff' : presentation}diff --git a/app/src/renderer/src/workspace.css b/app/src/renderer/src/workspace.cssindex e34952c4..c6ae5328 100644--- a/app/src/renderer/src/workspace.css+++ b/app/src/renderer/src/workspace.css@@ -635,7 +635,6 @@ body:has(.chat-panel[open]) .app-toast-viewport:dir(rtl) { --toast-x:440px; }/* The scroll viewport meets the tab/footer borders; spacing belongs inside the scrolled content. */.note-reading-frame { position:relative;min-width:0;min-height:0;flex:1;margin:0 calc(max(0px,(100% - 860px)/2) + clamp(20px,calc(10cqw - 42px),48px) - 14px);padding:0 2px;border-radius:12px; }/* Keep a status lane even at rest, so progress never covers or displaces the summary. */-.note-reading-frame[data-has-summary=true] { padding-bottom:44px; }.note-reading-frame[hidden] { display:none; }.note-reading-clip { height:100%;overflow:hidden;border-radius:10px; }.main-window .note-reading-clip>.note-notes-pane { height:100%;scrollbar-width:auto;scrollbar-gutter:stable; }@@ -644,7 +643,6 @@ body:has(.chat-panel[open]) .app-toast-viewport:dir(rtl) { --toast-x:440px; }.note-reading-clip>.note-notes-pane::-webkit-scrollbar { width:4px; }.note-reading-clip>.note-notes-pane::-webkit-scrollbar-track,.note-reading-clip>.note-notes-pane::-webkit-scrollbar-thumb { background:transparent; }.note-reading-clip>.note-notes-pane[data-scrolling]::-webkit-scrollbar-thumb { background:color-mix(in srgb,var(--muted) 45%,transparent);border-radius:3px; }-.note-summary-status { position:absolute;inset-inline-start:14px;bottom:18px;z-index:1;background:var(--bg);color:var(--muted);font-size:11px;line-height:16px;pointer-events:none; }.note-latest { position:absolute;bottom:18px;left:50%;transform:translateX(-50%);z-index:3;display:flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:6px;padding:4px 12px;background:var(--float);color:var(--ink);font-size:12px;line-height:16px;box-shadow:var(--shadow); }.native-library { --meeting-selection-tint:6%; }@@ -673,3 +671,5 @@ body:has(.chat-panel[open]) .app-toast-viewport:dir(rtl) { --toast-x:440px; }.app-toast { filter:none!important; }.note-folder-proposal,.meeting-folder-proposal,.note-folder-actions,.meeting-folder-proposal .note-folder-name span:last-child { transition:opacity var(--dur-micro) var(--ease-out); }}++.note-reading-frame[data-resetting=true] .note-reading-clip { visibility:hidden; }diff --git a/app/src/shared/locales/ar.json b/app/src/shared/locales/ar.jsonindex 825c520e..b3a45c65 100644--- a/app/src/shared/locales/ar.json+++ b/app/src/shared/locales/ar.json@@ -740,5 +740,7 @@"Regenerate": "إعادة الإنشاء","Note for the summary": "تعليمات للملخص","Add a note, like shorter or in Spanish": "أضف تعليمات، مثل أقصر أو بالإسبانية",- "Waiting for Yogurt AI to download": "بانتظار تنزيل ذكاء Yogurt الاصطناعي"+ "Waiting for Yogurt AI to download": "بانتظار تنزيل ذكاء Yogurt الاصطناعي",+ "Stop summary": "إيقاف التلخيص",+ "Summary stopped.": "توقف التلخيص."}diff --git a/app/src/shared/locales/bn.json b/app/src/shared/locales/bn.jsonindex d4e8de63..3bb3f66f 100644--- a/app/src/shared/locales/bn.json+++ b/app/src/shared/locales/bn.json@@ -672,5 +672,7 @@"Regenerate": "আবার তৈরি করুন","Note for the summary": "সারাংশের নির্দেশনা","Add a note, like shorter or in Spanish": "নির্দেশ দিন, যেমন ছোট বা স্প্যানিশে",- "Waiting for Yogurt AI to download": "Yogurt AI ডাউনলোডের অপেক্ষায়"+ "Waiting for Yogurt AI to download": "Yogurt AI ডাউনলোডের অপেক্ষায়",+ "Stop summary": "সারসংক্ষেপ বন্ধ করুন",+ "Summary stopped.": "সারসংক্ষেপ তৈরি বন্ধ হয়েছে।"}diff --git a/app/src/shared/locales/cs.json b/app/src/shared/locales/cs.jsonindex aad588a3..121988b4 100644--- a/app/src/shared/locales/cs.json+++ b/app/src/shared/locales/cs.json@@ -715,5 +715,7 @@"Regenerate": "Vygenerovat znovu","Note for the summary": "Pokyn pro shrnutí","Add a note, like shorter or in Spanish": "Přidejte pokyn, třeba kratší nebo španělsky",- "Waiting for Yogurt AI to download": "Čekání na stažení Yogurt AI"+ "Waiting for Yogurt AI to download": "Čekání na stažení Yogurt AI",+ "Stop summary": "Zastavit shrnutí",+ "Summary stopped.": "Vytváření shrnutí zastaveno."}diff --git a/app/src/shared/locales/da.json b/app/src/shared/locales/da.jsonindex 31a08ae9..368b5fc1 100644--- a/app/src/shared/locales/da.json+++ b/app/src/shared/locales/da.json@@ -684,5 +684,7 @@"Regenerate": "Generér igen","Note for the summary": "Note til opsummeringen","Add a note, like shorter or in Spanish": "Tilføj en note, som kortere eller på spansk",- "Waiting for Yogurt AI to download": "Venter på download af Yogurt AI"+ "Waiting for Yogurt AI to download": "Venter på download af Yogurt AI",+ "Stop summary": "Stop opsummering",+ "Summary stopped.": "Opsummering stoppet."}diff --git a/app/src/shared/locales/de.json b/app/src/shared/locales/de.jsonindex a6100c96..624b20a1 100644--- a/app/src/shared/locales/de.json+++ b/app/src/shared/locales/de.json@@ -684,5 +684,7 @@"Regenerate": "Neu erstellen","Note for the summary": "Hinweis für die Zusammenfassung","Add a note, like shorter or in Spanish": "Hinweis hinzufügen, etwa kürzer oder auf Spanisch",- "Waiting for Yogurt AI to download": "Warten auf den Download von Yogurt AI"+ "Waiting for Yogurt AI to download": "Warten auf den Download von Yogurt AI",+ "Stop summary": "Zusammenfassung stoppen",+ "Summary stopped.": "Zusammenfassung gestoppt."}diff --git a/app/src/shared/locales/el.json b/app/src/shared/locales/el.jsonindex 09e2e35e..80af3aec 100644--- a/app/src/shared/locales/el.json+++ b/app/src/shared/locales/el.json@@ -687,5 +687,7 @@"Regenerate": "Νέα δημιουργία","Note for the summary": "Οδηγία για τη σύνοψη","Add a note, like shorter or in Spanish": "Προσθέστε οδηγία, π.χ. πιο σύντομα ή στα ισπανικά",- "Waiting for Yogurt AI to download": "Αναμονή λήψης του Yogurt AI"+ "Waiting for Yogurt AI to download": "Αναμονή λήψης του Yogurt AI",+ "Stop summary": "Διακοπή σύνοψης",+ "Summary stopped.": "Η σύνοψη διακόπηκε."}diff --git a/app/src/shared/locales/en.json b/app/src/shared/locales/en.jsonindex bde0aa8a..b8597e2c 100644--- a/app/src/shared/locales/en.json+++ b/app/src/shared/locales/en.json@@ -206,5 +206,7 @@"Available after recording": "Available after recording","Note for the summary": "Note for the summary","Add a note, like shorter or in Spanish": "Add a note, like shorter or in Spanish",- "Waiting for Yogurt AI to download": "Waiting for Yogurt AI to download"+ "Waiting for Yogurt AI to download": "Waiting for Yogurt AI to download",+ "Stop summary": "Stop summary",+ "Summary stopped.": "Summary stopped."}diff --git a/app/src/shared/locales/es.json b/app/src/shared/locales/es.jsonindex 295ac4e2..e1cedef0 100644--- a/app/src/shared/locales/es.json+++ b/app/src/shared/locales/es.json@@ -697,5 +697,7 @@"Regenerate": "Regenerar","Note for the summary": "Indicación para el resumen","Add a note, like shorter or in Spanish": "Añade una nota, como más corto o en español",- "Waiting for Yogurt AI to download": "Esperando la descarga de Yogurt AI"+ "Waiting for Yogurt AI to download": "Esperando la descarga de Yogurt AI",+ "Stop summary": "Detener resumen",+ "Summary stopped.": "Resumen detenido."}diff --git a/app/src/shared/locales/fi.json b/app/src/shared/locales/fi.jsonindex debb49aa..4f5e008c 100644--- a/app/src/shared/locales/fi.json+++ b/app/src/shared/locales/fi.json@@ -690,5 +690,7 @@"Regenerate": "Luo uudelleen","Note for the summary": "Ohje yhteenvedolle","Add a note, like shorter or in Spanish": "Lisää ohje, kuten lyhyemmin tai espanjaksi",- "Waiting for Yogurt AI to download": "Odotetaan Yogurt AI:n latausta"+ "Waiting for Yogurt AI to download": "Odotetaan Yogurt AI:n latausta",+ "Stop summary": "Pysäytä yhteenveto",+ "Summary stopped.": "Yhteenvedon luonti pysäytetty."}diff --git a/app/src/shared/locales/fil.json b/app/src/shared/locales/fil.jsonindex d2b21bcb..805d18bd 100644--- a/app/src/shared/locales/fil.json+++ b/app/src/shared/locales/fil.json@@ -684,5 +684,7 @@"Regenerate": "Buuin muli","Note for the summary": "Tagubilin para sa buod","Add a note, like shorter or in Spanish": "Magdagdag ng bilin, gaya ng mas maikli o sa Espanyol",- "Waiting for Yogurt AI to download": "Hinihintay ang pag-download ng Yogurt AI"+ "Waiting for Yogurt AI to download": "Hinihintay ang pag-download ng Yogurt AI",+ "Stop summary": "Ihinto ang buod",+ "Summary stopped.": "Nahinto ang paggawa ng buod."}diff --git a/app/src/shared/locales/fr.json b/app/src/shared/locales/fr.jsonindex 082df861..b5966635 100644--- a/app/src/shared/locales/fr.json+++ b/app/src/shared/locales/fr.json@@ -700,5 +700,7 @@"Regenerate": "Régénérer","Note for the summary": "Consigne pour le résumé","Add a note, like shorter or in Spanish": "Ajoutez une consigne, comme plus court ou en espagnol",- "Waiting for Yogurt AI to download": "En attente du téléchargement de l’IA Yogurt"+ "Waiting for Yogurt AI to download": "En attente du téléchargement de l’IA Yogurt",+ "Stop summary": "Arrêter le résumé",+ "Summary stopped.": "Résumé arrêté."}diff --git a/app/src/shared/locales/he.json b/app/src/shared/locales/he.jsonindex 9b9d026b..f926fe44 100644--- a/app/src/shared/locales/he.json+++ b/app/src/shared/locales/he.json@@ -694,5 +694,7 @@"Regenerate": "יצירה מחדש","Note for the summary": "הנחיה לסיכום","Add a note, like shorter or in Spanish": "הוסיפו הנחיה, כמו קצר יותר או בספרדית",- "Waiting for Yogurt AI to download": "ממתינים להורדת Yogurt AI"+ "Waiting for Yogurt AI to download": "ממתינים להורדת Yogurt AI",+ "Stop summary": "עצירת הסיכום",+ "Summary stopped.": "הסיכום נעצר."}diff --git a/app/src/shared/locales/hi.json b/app/src/shared/locales/hi.jsonindex 8909f057..7c389638 100644--- a/app/src/shared/locales/hi.json+++ b/app/src/shared/locales/hi.json@@ -672,5 +672,7 @@"Regenerate": "फिर से बनाएँ","Note for the summary": "सारांश के लिए निर्देश","Add a note, like shorter or in Spanish": "निर्देश जोड़ें, जैसे छोटा या स्पेनिश में",- "Waiting for Yogurt AI to download": "Yogurt AI डाउनलोड होने का इंतज़ार"+ "Waiting for Yogurt AI to download": "Yogurt AI डाउनलोड होने का इंतज़ार",+ "Stop summary": "सारांश रोकें",+ "Summary stopped.": "सारांश बनाना रोक दिया गया।"}diff --git a/app/src/shared/locales/hu.json b/app/src/shared/locales/hu.jsonindex 65215831..c506a45b 100644--- a/app/src/shared/locales/hu.json+++ b/app/src/shared/locales/hu.json@@ -672,5 +672,7 @@"Regenerate": "Újragenerálás","Note for the summary": "Utasítás az összefoglalóhoz","Add a note, like shorter or in Spanish": "Adjon meg kérést, például rövidebben vagy spanyolul",- "Waiting for Yogurt AI to download": "Várakozás a Yogurt AI letöltésére"+ "Waiting for Yogurt AI to download": "Várakozás a Yogurt AI letöltésére",+ "Stop summary": "Összefoglalás leállítása",+ "Summary stopped.": "Az összefoglalás leállt."}diff --git a/app/src/shared/locales/id.json b/app/src/shared/locales/id.jsonindex c80301db..501c226d 100644--- a/app/src/shared/locales/id.json+++ b/app/src/shared/locales/id.json@@ -642,5 +642,7 @@"Regenerate": "Buat ulang","Note for the summary": "Catatan untuk ringkasan","Add a note, like shorter or in Spanish": "Catatan, misalnya lebih singkat atau bahasa Spanyol",- "Waiting for Yogurt AI to download": "Menunggu unduhan Yogurt AI"+ "Waiting for Yogurt AI to download": "Menunggu unduhan Yogurt AI",+ "Stop summary": "Hentikan ringkasan",+ "Summary stopped.": "Pembuatan ringkasan dihentikan."}diff --git a/app/src/shared/locales/it.json b/app/src/shared/locales/it.jsonindex 3e39e669..1a2ce665 100644--- a/app/src/shared/locales/it.json+++ b/app/src/shared/locales/it.json@@ -703,5 +703,7 @@"Regenerate": "Rigenera","Note for the summary": "Istruzione per il riepilogo","Add a note, like shorter or in Spanish": "Aggiungi una nota, come più breve o in spagnolo",- "Waiting for Yogurt AI to download": "In attesa del download di Yogurt AI"+ "Waiting for Yogurt AI to download": "In attesa del download di Yogurt AI",+ "Stop summary": "Interrompi riepilogo",+ "Summary stopped.": "Riepilogo interrotto."}diff --git a/app/src/shared/locales/ja.json b/app/src/shared/locales/ja.jsonindex 45722870..fa86b37f 100644--- a/app/src/shared/locales/ja.json+++ b/app/src/shared/locales/ja.json@@ -642,5 +642,7 @@"Regenerate": "再生成","Note for the summary": "要約への指示","Add a note, like shorter or in Spanish": "短めに、スペイン語で、などの指示を追加",- "Waiting for Yogurt AI to download": "Yogurt AIのダウンロードを待機中"+ "Waiting for Yogurt AI to download": "Yogurt AIのダウンロードを待機中",+ "Stop summary": "要約を停止",+ "Summary stopped.": "要約を停止しました。"}diff --git a/app/src/shared/locales/ko.json b/app/src/shared/locales/ko.jsonindex febc47eb..118f6738 100644--- a/app/src/shared/locales/ko.json+++ b/app/src/shared/locales/ko.json@@ -642,5 +642,7 @@"Regenerate": "다시 생성","Note for the summary": "요약 지침","Add a note, like shorter or in Spanish": "더 짧게, 스페인어로 등 지침 추가",- "Waiting for Yogurt AI to download": "Yogurt AI 다운로드 대기 중"+ "Waiting for Yogurt AI to download": "Yogurt AI 다운로드 대기 중",+ "Stop summary": "요약 중지",+ "Summary stopped.": "요약이 중지되었습니다."}diff --git a/app/src/shared/locales/ms.json b/app/src/shared/locales/ms.jsonindex 824475b8..29daeee9 100644--- a/app/src/shared/locales/ms.json+++ b/app/src/shared/locales/ms.json@@ -642,5 +642,7 @@"Regenerate": "Jana semula","Note for the summary": "Arahan untuk ringkasan","Add a note, like shorter or in Spanish": "Tambah arahan, seperti lebih pendek atau bahasa Sepanyol",- "Waiting for Yogurt AI to download": "Menunggu muat turun Yogurt AI"+ "Waiting for Yogurt AI to download": "Menunggu muat turun Yogurt AI",+ "Stop summary": "Hentikan ringkasan",+ "Summary stopped.": "Ringkasan dihentikan."}diff --git a/app/src/shared/locales/nb.json b/app/src/shared/locales/nb.jsonindex d8bfa961..aa87d666 100644--- a/app/src/shared/locales/nb.json+++ b/app/src/shared/locales/nb.json@@ -684,5 +684,7 @@"Regenerate": "Generer på nytt","Note for the summary": "Merknad til sammendraget","Add a note, like shorter or in Spanish": "Legg til en merknad, som kortere eller på spansk",- "Waiting for Yogurt AI to download": "Venter på nedlasting av Yogurt AI"+ "Waiting for Yogurt AI to download": "Venter på nedlasting av Yogurt AI",+ "Stop summary": "Stopp oppsummering",+ "Summary stopped.": "Oppsummering stoppet."}diff --git a/app/src/shared/locales/nl.json b/app/src/shared/locales/nl.jsonindex eafcf692..ad3aee1c 100644--- a/app/src/shared/locales/nl.json+++ b/app/src/shared/locales/nl.json@@ -684,5 +684,7 @@"Regenerate": "Opnieuw maken","Note for the summary": "Instructie voor de samenvatting","Add a note, like shorter or in Spanish": "Voeg iets toe, zoals korter of in het Spaans",- "Waiting for Yogurt AI to download": "Wachten op de download van Yogurt AI"+ "Waiting for Yogurt AI to download": "Wachten op de download van Yogurt AI",+ "Stop summary": "Samenvatting stoppen",+ "Summary stopped.": "Samenvatting gestopt."}diff --git a/app/src/shared/locales/pl.json b/app/src/shared/locales/pl.jsonindex cbe57e20..4bbda4ac 100644--- a/app/src/shared/locales/pl.json+++ b/app/src/shared/locales/pl.json@@ -720,5 +720,7 @@"Regenerate": "Generuj ponownie","Note for the summary": "Wskazówka do podsumowania","Add a note, like shorter or in Spanish": "Dodaj wskazówkę, np. krócej lub po hiszpańsku",- "Waiting for Yogurt AI to download": "Oczekiwanie na pobranie Yogurt AI"+ "Waiting for Yogurt AI to download": "Oczekiwanie na pobranie Yogurt AI",+ "Stop summary": "Zatrzymaj podsumowanie",+ "Summary stopped.": "Podsumowanie zatrzymane."}diff --git a/app/src/shared/locales/pt-BR.json b/app/src/shared/locales/pt-BR.jsonindex eea7debd..039a89e0 100644--- a/app/src/shared/locales/pt-BR.json+++ b/app/src/shared/locales/pt-BR.json@@ -700,5 +700,7 @@"Regenerate": "Gerar novamente","Note for the summary": "Instrução para o resumo","Add a note, like shorter or in Spanish": "Adicione uma nota, como mais curto ou em espanhol",- "Waiting for Yogurt AI to download": "Aguardando o download do Yogurt AI"+ "Waiting for Yogurt AI to download": "Aguardando o download do Yogurt AI",+ "Stop summary": "Parar resumo",+ "Summary stopped.": "Resumo interrompido."}diff --git a/app/src/shared/locales/ro.json b/app/src/shared/locales/ro.jsonindex 9e89101e..333a865d 100644--- a/app/src/shared/locales/ro.json+++ b/app/src/shared/locales/ro.json@@ -701,5 +701,7 @@"Regenerate": "Regenerează","Note for the summary": "Instrucțiune pentru rezumat","Add a note, like shorter or in Spanish": "Adaugă o notă, precum mai scurt sau în spaniolă",- "Waiting for Yogurt AI to download": "Se așteaptă descărcarea Yogurt AI"+ "Waiting for Yogurt AI to download": "Se așteaptă descărcarea Yogurt AI",+ "Stop summary": "Oprește rezumatul",+ "Summary stopped.": "Rezumatul a fost oprit."}diff --git a/app/src/shared/locales/ru.json b/app/src/shared/locales/ru.jsonindex af141f30..1c5792c4 100644--- a/app/src/shared/locales/ru.json+++ b/app/src/shared/locales/ru.json@@ -712,5 +712,7 @@"Regenerate": "Создать заново","Note for the summary": "Пожелание к сводке","Add a note, like shorter or in Spanish": "Добавьте пожелание, например короче или на испанском",- "Waiting for Yogurt AI to download": "Ожидание загрузки Yogurt AI"+ "Waiting for Yogurt AI to download": "Ожидание загрузки Yogurt AI",+ "Stop summary": "Остановить сводку",+ "Summary stopped.": "Создание сводки остановлено."}diff --git a/app/src/shared/locales/sv.json b/app/src/shared/locales/sv.jsonindex 18b60fcc..f52ac0f4 100644--- a/app/src/shared/locales/sv.json+++ b/app/src/shared/locales/sv.json@@ -684,5 +684,7 @@"Regenerate": "Skapa igen","Note for the summary": "Instruktion för sammanfattningen","Add a note, like shorter or in Spanish": "Lägg till en notering, som kortare eller på spanska",- "Waiting for Yogurt AI to download": "Väntar på nedladdning av Yogurt AI"+ "Waiting for Yogurt AI to download": "Väntar på nedladdning av Yogurt AI",+ "Stop summary": "Stoppa sammanfattning",+ "Summary stopped.": "Sammanfattningen stoppades."}diff --git a/app/src/shared/locales/th.json b/app/src/shared/locales/th.jsonindex ce14b04c..7cfc777b 100644--- a/app/src/shared/locales/th.json+++ b/app/src/shared/locales/th.json@@ -642,5 +642,7 @@"Regenerate": "สร้างใหม่","Note for the summary": "คำสั่งสำหรับสรุป","Add a note, like shorter or in Spanish": "เพิ่มคำสั่ง เช่น สั้นลงหรือเป็นภาษาสเปน",- "Waiting for Yogurt AI to download": "รอการดาวน์โหลด Yogurt AI"+ "Waiting for Yogurt AI to download": "รอการดาวน์โหลด Yogurt AI",+ "Stop summary": "หยุดสรุป",+ "Summary stopped.": "หยุดสรุปแล้ว"}diff --git a/app/src/shared/locales/tr.json b/app/src/shared/locales/tr.jsonindex af35e4a0..87069796 100644--- a/app/src/shared/locales/tr.json+++ b/app/src/shared/locales/tr.json@@ -672,5 +672,7 @@"Regenerate": "Yeniden oluştur","Note for the summary": "Özet için talimat","Add a note, like shorter or in Spanish": "Daha kısa veya İspanyolca gibi bir not ekleyin",- "Waiting for Yogurt AI to download": "Yogurt AI indirmesi bekleniyor"+ "Waiting for Yogurt AI to download": "Yogurt AI indirmesi bekleniyor",+ "Stop summary": "Özeti durdur",+ "Summary stopped.": "Özet durduruldu."}diff --git a/app/src/shared/locales/uk.json b/app/src/shared/locales/uk.jsonindex 04bdc258..b2e1390c 100644--- a/app/src/shared/locales/uk.json+++ b/app/src/shared/locales/uk.json@@ -712,5 +712,7 @@"Regenerate": "Створити знову","Note for the summary": "Побажання до підсумку","Add a note, like shorter or in Spanish": "Додайте побажання, як-от коротше чи іспанською",- "Waiting for Yogurt AI to download": "Очікування завантаження Yogurt AI"+ "Waiting for Yogurt AI to download": "Очікування завантаження Yogurt AI",+ "Stop summary": "Зупинити підсумок",+ "Summary stopped.": "Створення підсумку зупинено."}diff --git a/app/src/shared/locales/vi.json b/app/src/shared/locales/vi.jsonindex 462361fd..29afdc08 100644--- a/app/src/shared/locales/vi.json+++ b/app/src/shared/locales/vi.json@@ -642,5 +642,7 @@"Regenerate": "Tạo lại","Note for the summary": "Chỉ dẫn cho bản tóm tắt","Add a note, like shorter or in Spanish": "Thêm chỉ dẫn, như ngắn hơn hoặc bằng tiếng Tây Ban Nha",- "Waiting for Yogurt AI to download": "Đang chờ tải Yogurt AI"+ "Waiting for Yogurt AI to download": "Đang chờ tải Yogurt AI",+ "Stop summary": "Dừng tóm tắt",+ "Summary stopped.": "Đã dừng tóm tắt."}diff --git a/app/src/shared/locales/zh-CN.json b/app/src/shared/locales/zh-CN.jsonindex 717b005a..a9336436 100644--- a/app/src/shared/locales/zh-CN.json+++ b/app/src/shared/locales/zh-CN.json@@ -642,5 +642,7 @@"Regenerate": "重新生成","Note for the summary": "摘要要求","Add a note, like shorter or in Spanish": "添加要求,例如更简短或用西班牙语",- "Waiting for Yogurt AI to download": "等待下载 Yogurt AI"+ "Waiting for Yogurt AI to download": "等待下载 Yogurt AI",+ "Stop summary": "停止总结",+ "Summary stopped.": "已停止总结。"}diff --git a/app/src/shared/locales/zh-TW.json b/app/src/shared/locales/zh-TW.jsonindex 0ce48700..b4334ed9 100644--- a/app/src/shared/locales/zh-TW.json+++ b/app/src/shared/locales/zh-TW.json@@ -642,5 +642,7 @@"Regenerate": "重新產生","Note for the summary": "摘要要求","Add a note, like shorter or in Spanish": "新增要求,例如更簡短或用西班牙語",- "Waiting for Yogurt AI to download": "等待下載 Yogurt AI"+ "Waiting for Yogurt AI to download": "等待下載 Yogurt AI",+ "Stop summary": "停止摘要",+ "Summary stopped.": "已停止摘要。"}diff --git a/app/src/shared/types.ts b/app/src/shared/types.tsindex 929f3c35..10b54024 100644--- a/app/src/shared/types.ts+++ b/app/src/shared/types.ts@@ -133,6 +133,7 @@ export type YogurtApi = {keptEdits(meetingId: string): void/** writes the enhanced notes again */writeAgain(meetingId: string, note?: string): Promise<void>+ stop(meetingId: string): Promise<void>/** status, the draft as it is written, and the saved notes; returns the way to stop listening */onChange(cb: (v: NoteView) => void): () => void}@@ -352,7 +353,7 @@ export type SearchResult = { meetingId: string; title: string; startedAt: number* Where a meeting's enhanced notes are: idle (none yet, the meeting may still be on), waiting (for the transcript or* the model), writing (draft streaming in), done (enhanced saved), failed, or empty (nothing was said or typed)*/-export type NoteStatus = 'idle' | 'waiting' | 'writing' | 'done' | 'failed' | 'empty'+export type NoteStatus = 'idle' | 'waiting' | 'writing' | 'done' | 'failed' | 'empty' | 'stopped'export type NoteSide = 'mine' | 'enhanced'export type NoteSaveResult = { revision: number; status: 'saved' | 'failed'; retained?: boolean; reason?: 'too-long' }export type NoteView = {diff --git a/app/test/enhance.test.ts b/app/test/enhance.test.tsindex 44568555..8a312d02 100644--- a/app/test/enhance.test.ts+++ b/app/test/enhance.test.ts@@ -1,4 +1,4 @@-import { describe, expect, it } from 'vitest'+import { describe, expect, it, vi } from 'vitest'import { cleanTitle, enhance, enhancePrompt, guessLanguage, languageName, peopleRule, summaryPrompt, titlePrompt, transcriptHead, type Llm, markMine, splitForContext, tidyNotes, transcriptText } from '../src/main/notes/enhance'import type { Segment } from '../src/main/store'@@ -7,6 +7,24 @@ const seg = (track: 'me' | 'them', startMs: number, text: string, speaker: strin/** a word is a token: close enough for tests */const words = (s: string) => s.split(/\s+/).filter(Boolean).length+it.each(['count', 'summary', 'next steps'] as const)('stops after %s without starting more requests or accepting late tokens', async stage => {+ const abort = new AbortController(), token = vi.fn(), titleLater = vi.fn()+ let calls = 0+ const llm: Llm = {+ contextSize: 32000,+ count: async xs => { if (stage === 'count') abort.abort(); return xs.map(words) },+ chat: async (_prompt, onToken) => {+ calls+++ if (stage === 'summary' || stage === 'next steps' && calls === 2) { abort.abort(); onToken('Late token') }+ return '## Plan\n- Release on Thursday.'+ },+ }+ await expect(enhance({ signal: abort.signal, meeting: { title: 'Review', attendees: [] }, mine: '', segments: [], language: 'en', titleLater }, llm, token)).rejects.toMatchObject({ name: 'AbortError' })+ expect(calls).toBe(stage === 'count' ? 0 : stage === 'summary' ? 1 : 2)+ expect(token).not.toHaveBeenCalled()+ expect(titleLater).not.toHaveBeenCalled()+})+describe('enhancePrompt', () => {const base = { title: 'Launch sync', attendees: [{ name: 'Maya Chen', email: null }], mine: '- ship Tuesday\n- pricing?', transcript: 'You: Hi.\nMaya Chen: Hello.', language: 'Spanish' }it('keeps the default prompt byte-for-byte for an absent or blank rewrite note', () => {@@ -226,6 +244,16 @@ describe('enhance', () => {const meeting = { title: 'Sync', attendees: [] }// 400 turns of 22 words: about 9,000 words, more than an 8k context holdsconst segs = Array.from({ length: 400 }, (_, i) => seg(i % 2 ? 'me' : 'them', i * 1000, `topic${i} ${'blah '.repeat(20)}`, i % 2 ? 'me' : 'A'))+ it('stops a long meeting between parts without asking for the remaining parts', async () => {+ const abort = new AbortController(), part = vi.fn(), token = vi.fn()+ const chat = vi.fn(async () => { abort.abort(); return 'Abandoned part' })+ await expect(enhance({ signal: abort.signal, meeting, mine: '', segments: segs, language: 'en' }, {+ contextSize: 8192, count: async xs => xs.map(words), chat,+ }, token, part)).rejects.toMatchObject({ name: 'AbortError' })+ expect(part).toHaveBeenCalledOnce()+ expect(chat).toHaveBeenCalledOnce()+ expect(token).not.toHaveBeenCalled()+ })it("writes the transcript with the meeting's spellings, and tells the model how to spell them", async () => {const prompts: string[] = []const spell = { title: '', names: ['Tarun Shah'], companies: ['Zentrik'] }diff --git a/app/test/followLatest.test.ts b/app/test/followLatest.test.tsindex 7b444c2e..5d81d1f8 100644--- a/app/test/followLatest.test.ts+++ b/app/test/followLatest.test.ts@@ -67,6 +67,18 @@ it('Latest reuses the finite glide, retargets arrivals and yields to user input'pane.scrollHeight = 1600; Resize.current.change(); expect(pane.scrollTop).toBe(150)follow.dispose()})+it('clears Latest when a rounded final glide position emits no scroll event', () => {+ let done!: () => void+ const glide = { to: vi.fn(), stop: vi.fn(), active: true }+ vi.mocked(followGlide).mockImplementation((_el, complete) => { done = complete; return glide })+ const { pane, behind, follow } = setup(false)+ follow.latest()+ pane.scrollHeight = 1400; Resize.current.change()+ expect(behind).toHaveBeenLastCalledWith(true)+ pane.scrollTop = 1000; done()+ expect(behind).toHaveBeenLastCalledWith(false)+ follow.dispose()+})it('stops on hiding or completion cleanup, with no polling or work after disposal', () => {const glide = { to: vi.fn(), stop: vi.fn(), active: true }vi.mocked(followGlide).mockReturnValue(glide)@@ -83,6 +95,17 @@ it('does not move a collapsed pane', () => {expect(pane.scrollTop).toBe(800)follow.dispose()})+it('does not write a scroll position until the new text overflows', () => {+ const pane = new Pane(), state = { current: true }+ pane.scrollHeight = pane.clientHeight+ const writes = vi.spyOn(pane, 'scrollTop', 'set')+ const follow = attachFollowLatest(pane as unknown as HTMLElement, new Pane() as unknown as HTMLElement, state, vi.fn())+ Resize.current.change()+ expect(writes).not.toHaveBeenCalled()+ pane.scrollHeight += 20; Resize.current.change()+ expect(pane.scrollTop).toBe(20)+ follow.dispose()+})it('keeps following when the body grows again before the scroll from the last follow lands', () => {const { pane, state, follow } = setup()pane.scrollHeight = 1400; Resize.current.change(); pane.scrollHeight = 2000diff --git a/app/test/i18n-tables.test.ts b/app/test/i18n-tables.test.tsindex 6333c060..3b4a5893 100644--- a/app/test/i18n-tables.test.ts+++ b/app/test/i18n-tables.test.ts@@ -11,6 +11,16 @@ const load = (id: string): Record<string, Entry> => JSON.parse(readFileSync(joinconst blanks = (s: string) => [...new Set(s.match(/\{\w+\}/g) ?? [])].sort()const forms = (e: Entry) => (typeof e === 'string' ? [e] : Object.values(e))+it('translates summary cancellation and its restart state in every locale', () => {+ for (const { id } of LOCALES) for (const key of ['Stop summary', 'Summary stopped.', 'Generate summary']) {+ expect(keys).toContain(key)+ if (id === 'en' && key === 'Generate summary') continue+ expect(load(id)[key]).toBeTypeOf('string')+ expect(load(id)[key]).not.toBe('')+ if (id !== 'en') expect(load(id)[key]).not.toBe(key)+ }+})+it('translates the app location choice and removes the old Mac toggle labels', () => {for (const { id } of LOCALES) {const table = load(id)diff --git a/app/test/noteMerge.test.ts b/app/test/noteMerge.test.tsindex 3fbc912a..2dfb5613 100644--- a/app/test/noteMerge.test.ts+++ b/app/test/noteMerge.test.ts@@ -25,10 +25,10 @@ describe('mergeNoteView: a note open on screen when it is written again for newit('the first view is taken as it is', () => {expect(mergeNoteView(undefined, view({})).view.enhanced).toBe('## A\n- Someone ships')})- it('an older failed-rewrite view cannot replace newer edits, including an emptied previous result', () => {- for (const enhanced of ['new text typed after failure', '']) {- const cur = view({ status: 'failed', enhanced, edited: true })- expect(mergeNoteView(cur, view({ status: 'failed', enhanced: 'older saved text' })).view.enhanced).toBe(enhanced)+ it.each(['failed', 'stopped'] as const)('an older %s rewrite view cannot replace newer edits, including an emptied result', status => {+ for (const enhanced of ['new text typed after a rewrite', '']) {+ const cur = view({ status, enhanced, edited: true })+ expect(mergeNoteView(cur, view({ status, enhanced: 'older saved text' })).view.enhanced).toBe(enhanced)}expect(mergeNoteView(view({ status: 'writing', enhanced: 'old text' }), view({ enhanced: 'successful replacement' })).view.enhanced).toBe('successful replacement')})diff --git a/app/test/notes.test.ts b/app/test/notes.test.tsindex d9392a12..dcfe2c24 100644--- a/app/test/notes.test.ts+++ b/app/test/notes.test.ts@@ -30,20 +30,109 @@ function setup(o: { summaryLanguage?: () => string; me?: string; named?: () => Pconst sent: NoteView[] = []const prompts: string[] = []const changed: string[] = []+ const signals: AbortSignal[] = []const llm: Llm = {contextSize: 32_000, count: async (xs) => xs.map((x) => x.length),chat: async (prompt, onToken) => { prompts.push(prompt); o.during?.(); const r = typeof o.reply === 'function' ? o.reply(prompt) : o.reply ?? '## Plan\n- We ship Tuesday\n## Next steps\n- **Ann:** Send it.'; onToken(r); return r },}const queue = createQueue({ recording: o.recording ?? (() => false), smallMac: o.smallMac ?? false })const notes = hookNotes({- store, queue, model: { llm: async () => { await o.load; return llm }, needsLoad: () => true }, showLoading: o.showLoading,+ store, queue, model: { llm: async (signal) => { if (signal) signals.push(signal); await o.load; return llm }, needsLoad: () => true }, showLoading: o.showLoading,transcribed: () => transcript, named: o.named, namesWaitMs: o.namesWaitMs, language: () => 'spanish', summaryLanguage: o.summaryLanguage,onStop: (fn) => stops.push(fn), send: (v) => sent.push(v), changed: (id) => changed.push(id), peopleRewriteMs: 30, me: () => o.me ?? '',})- return { store, m, notes, sent, prompts, changed, queue, stop: () => stops.forEach((f) => f(m)), transcribed }+ return { store, m, notes, sent, prompts, changed, queue, llm, signals, stop: () => stops.forEach((f) => f(m)), transcribed }}describe('hookNotes', () => {+ it('a manual stop invalidates a pending transcript without restarting on recovery', async () => {+ const s = setup()+ s.stop()+ const pending = s.notes.written(s.m.id)+ await s.notes.stop(s.m.id)+ expect(s.notes.view(s.m.id)).toMatchObject({ status: 'stopped', draft: '', enhanced: null })+ s.transcribed(); await pending+ s.notes.recover(); await wait()+ expect(s.prompts).toEqual([])+ expect(s.store.meeting(s.m.id)?.state).toBe('done')+ await s.notes.writeAgain(s.m.id)+ expect(s.notes.view(s.m.id).status).toBe('done')+ })++ it('stops a queued summary without deleting the meeting or preventing a later retry', async () => {+ let recording = true+ const s = setup({ recording: () => recording, smallMac: true })+ const run = s.notes.writeAgain(s.m.id)+ await s.notes.stop(s.m.id); await run+ recording = false; s.queue.recordingChanged()+ expect(s.prompts).toEqual([])+ expect(s.notes.view(s.m.id).status).toBe('stopped')+ await s.notes.writeAgain(s.m.id)+ expect(s.notes.view(s.m.id).status).toBe('done')+ })++ it('aborts model loading and never starts generation after the load settles', async () => {+ let release!: () => void+ const s = setup({ load: new Promise<void>(resolve => { release = resolve }) })+ const run = s.notes.writeAgain(s.m.id)+ expect(s.signals).toHaveLength(1)+ const stopped = s.notes.stop(s.m.id)+ expect(s.signals[0].aborted).toBe(true)+ release(); await stopped; await run+ expect(s.prompts).toEqual([])+ expect(s.notes.view(s.m.id)).toMatchObject({ status: 'stopped', enhanced: null, draft: '' })+ })++ it('a retry waits for the stopped generation to release the model', async () => {+ const s = setup()+ let finish!: () => void+ const chat = vi.spyOn(s.llm, 'chat').mockImplementationOnce(async (_prompt, token) => {+ token('Partial')+ await new Promise<void>(resolve => { finish = resolve })+ return 'Abandoned text'+ })+ const run = s.notes.writeAgain(s.m.id)+ await vi.waitFor(() => expect(s.notes.view(s.m.id).status).toBe('writing'))+ const stopped = s.notes.stop(s.m.id), retry = s.notes.writeAgain(s.m.id)+ await wait()+ expect(chat).toHaveBeenCalledTimes(1)+ expect(s.notes.view(s.m.id).status).toBe('stopped')+ finish(); await Promise.all([run, stopped, retry])+ expect(s.notes.view(s.m.id).status).toBe('done')+ expect(s.store.notes(s.m.id).enhanced).not.toContain('Abandoned')+ })++ it.each([false, true])('stops streaming with no partial save and allows retry, previous summary %s', async previous => {+ const s = setup()+ if (previous) {+ s.store.setNotes(s.m.id, { enhanced: 'Keep this exact summary.\n', edited: true })+ s.store.setWrittenWith(s.m.id, 'previous people')+ }+ const before = s.store.notes(s.m.id), people = s.store.writtenWith(s.m.id)+ let finish!: () => void+ const chat = vi.spyOn(s.llm, 'chat').mockImplementationOnce(async (_prompt, token) => {+ token('## Partial summary\n')+ await new Promise<void>(resolve => { finish = resolve })+ // Engines may deliver a final queued token after receiving abort.+ token('Late token')+ return '## Partial summary\nLate token'+ })+ const run = s.notes.writeAgain(s.m.id)+ await vi.waitFor(() => expect(s.notes.view(s.m.id).status).toBe('writing'))+ const stopped = s.notes.stop(s.m.id)+ expect(s.signals[0].aborted).toBe(true)+ expect(chat).toHaveBeenCalledTimes(1)+ const afterStop = s.sent.length+ finish(); await stopped; await run+ expect(s.store.notes(s.m.id)).toEqual(before)+ expect(s.store.writtenWith(s.m.id)).toBe(people)+ expect(s.sent.slice(afterStop).some(v => v.draft.includes('Late token'))).toBe(false)+ await s.notes.writeAgain(s.m.id)+ expect(s.notes.view(s.m.id).status).toBe('done')+ expect(s.store.notes(s.m.id).enhanced).not.toContain('Late token')+ expect(s.store.notes(s.m.id).mine).toBe(before.mine)+ })+it('keeps a rewrite note only in its queued job, never the next regeneration or saved notes', async () => {const s = setup()await s.notes.writeAgain(s.m.id, 'Use a concise formal tone')diff --git a/app/test/queue.test.ts b/app/test/queue.test.tsindex 816dec40..2bf1ac5c 100644--- a/app/test/queue.test.ts+++ b/app/test/queue.test.ts@@ -4,6 +4,17 @@ import { createQueue, isSmallMac } from '../src/main/notes/queue'const tick = () => new Promise((r) => setTimeout(r, 0))describe('notes queue', () => {+ it('stopping a summary leaves Ask and other meetings queued', async () => {+ let ready = false+ const q = createQueue({ recording: () => false, smallMac: false, modelReady: () => ready })+ const summary = vi.fn(async () => {}), ask = vi.fn(async () => {}), other = vi.fn(async () => {})+ const jobs = [q.enqueue(summary, 'enhance', 'note'), q.enqueue(ask, 'chat', 'note'), q.enqueue(other, 'enhance', 'other')]+ await q.cancelAnalysis('note', 'enhance')+ ready = true; q.modelArrived(); await Promise.all(jobs)+ expect(summary).not.toHaveBeenCalled()+ expect(ask).toHaveBeenCalledOnce()+ expect(other).toHaveBeenCalledOnce()+ })it('cancelling obsolete summary work waits for the running job and allows future jobs for the same note', async () => {const q = createQueue({ recording: () => false, smallMac: false })let release!: () => void, aborted = falsediff --git a/app/test/resumeRequest.test.ts b/app/test/resumeRequest.test.tsindex 418c4de5..ea87c2be 100644--- a/app/test/resumeRequest.test.ts+++ b/app/test/resumeRequest.test.ts@@ -26,7 +26,7 @@ vi.mock('../src/renderer/src/motion', async original => ({ ...await original<typlet meeting: MeetingView, notes: NoteViewlet meetingChanged: () => void, notesChanged: (notes: NoteView) => voidconst resume = vi.fn(), consumed = vi.fn(), title = vi.fn(), source = vi.fn()-const transcriptGet = vi.fn()+const transcriptGet = vi.fn(), stopSummary = vi.fn()let segmentChanged: (line: { meetingId: string; text: string }) => void, transcriptChanged: (id: string) => void, setupChanged: (state: SetupState) => voidlet requested: (() => void) | undefinedlet tree: ReactNode@@ -53,9 +53,10 @@ beforeEach(() => {requested = () => { consumed(); requested = undefined }transcriptGet.mockResolvedValue([])resume.mockResolvedValue({ id: meeting.id })+ stopSummary.mockResolvedValue(undefined)vi.stubGlobal('window', { matchMedia: () => ({ matches: true }), yogurt: {meetings: { get: async () => meeting, onChange: (cb: typeof meetingChanged) => { meetingChanged = cb; return vi.fn() }, resume, stop: vi.fn() },- notes: { setMine: async (_id: string, _text: string, revision: number) => ({ revision, status: 'saved' }), get: async () => notes, onChange: (cb: typeof notesChanged) => { notesChanged = cb; return vi.fn() } },+ notes: { stop: stopSummary, setMine: async (_id: string, _text: string, revision: number) => ({ revision, status: 'saved' }), get: async () => notes, onChange: (cb: typeof notesChanged) => { notesChanged = cb; return vi.fn() } },transcript: { get: transcriptGet, onSegment: (cb: typeof segmentChanged) => { segmentChanged = cb; return vi.fn() }, onSpeakers: (cb: typeof transcriptChanged) => { transcriptChanged = cb; return vi.fn() } },setup: { state: async () => ({ phase: 'ready', fraction: 1 }), onState: (cb: typeof setupChanged) => { setupChanged = cb; return vi.fn() } },widget: { state: async () => null, onState: () => vi.fn() },@@ -150,3 +151,25 @@ it('waits for the first notes model but allows generation during an optional upgsetupChanged({ phase: 'ready', fraction: 1, notesError: 'Download failed' }); await render()expect(find(tree, NoteMenu)?.props.generation).toMatchObject({ reason: 'Waiting for Yogurt AI to download' })})+++it.each(['waiting', 'writing', 'failed', 'empty', 'stopped', 'done'] as const)('the header action for %s stops a summary or resumes recording without confusing the two', async status => {+ notes.status = status; requested = undefined+ await render(); await render()+ const busy = status === 'waiting' || status === 'writing'+ const button = find(tree, 'note-resume')!+ expect(button.props.disabled).toBe(false)+ expect(button.props['aria-label']).toBe(busy ? 'Stop summary' : 'Resume recording')+ expect(button.props['aria-busy']).toBe(busy)+ ;(button.props.onClick as () => void)()+ await render(); await render()+ if (busy) {+ expect(stopSummary).toHaveBeenCalledExactlyOnceWith(meeting.id)+ expect(resume).not.toHaveBeenCalled()+ notesChanged({ ...notes, status: 'stopped' }); await render()+ expect(find(tree, 'note-resume')!.props['aria-label']).toBe('Resume recording')+ } else {+ expect(resume).toHaveBeenCalledExactlyOnceWith(meeting.id)+ expect(stopSummary).not.toHaveBeenCalled()+ }+})diff --git a/app/test/scrollFade.test.ts b/app/test/scrollFade.test.tsindex 7e7e2186..e05cb817 100644--- a/app/test/scrollFade.test.ts+++ b/app/test/scrollFade.test.ts@@ -22,6 +22,7 @@ it('keeps note text and footer controls at their existing insets', () => {expect(css).not.toContain('.note-summary-rim')expect(css).not.toContain('.ask-border')expect(css).not.toContain('.note-reading-frame::before')- expect(css).toMatch(/\.note-summary-status \{[^}]*bottom:18px;/)+ expect(css).not.toContain('.note-summary-status')+ expect(css).not.toContain('data-has-summary')expect(css).toMatch(/\.note-latest \{[^}]*bottom:18px;/)})diff --git a/app/test/setup.test.ts b/app/test/setup.test.tsindex 18cdb352..b8176764 100644--- a/app/test/setup.test.ts+++ b/app/test/setup.test.ts@@ -51,6 +51,23 @@ const turboUrl = catalog.asr[0].urlconst smallUrl = catalog.asr[1].urldescribe('SetupController', () => {+ it('keeps a failed fake notes download in the real retry state while recording remains ready', async () => {+ const { c, states } = setup({ download: fakeDownloadDeps({ stepMs: 0, notesFailOnce: true }) })+ await c.start()+ try {+ await vi.waitFor(() => expect(c.state.notesError).toBe('The download needs 4 GB more free space.'))+ expect(c.state.phase).toBe('ready')+ expect(c.installed()?.asr).toBeTruthy()+ expect(c.notesPath()).toBeUndefined()+ const failed = states.length+ await c.retry()+ await c.idle()+ expect(c.state.notesError).toBeUndefined()+ expect(c.notesPath()).toBeTruthy()+ expect(states.slice(failed)).toContainEqual(expect.objectContaining({ notesDownloading: true }))+ } finally { await c.retry(); await c.idle() }+ })+it('goes checking, downloading, ready; the fraction only goes up and ends at 1', async () => {const { c, states } = setup()expect(c.state.phase).toBe('checking')diff --git a/app/test/summaryHandoff.test.ts b/app/test/summaryHandoff.test.tsindex e85f67f0..d496b289 100644--- a/app/test/summaryHandoff.test.ts+++ b/app/test/summaryHandoff.test.ts@@ -1,11 +1,15 @@import { useEffect, useState } from 'react'-import { afterEach, expect, it, vi } from 'vitest'+import { afterEach, beforeEach, expect, it, vi } from 'vitest'import { useSummaryPresentation } from '../src/renderer/src/summaryPresentation'import { motion } from '../src/renderer/src/motion'import type { NoteView } from '../src/shared/types'vi.mock('react', async original => ({ ...await original<typeof import('react')>(), useState: vi.fn(), useEffect: vi.fn() }))-afterEach(() => { vi.useRealTimers(); vi.clearAllMocks() })+beforeEach(() => {+ vi.stubGlobal('requestAnimationFrame', (fn: () => void) => setTimeout(fn, 16))+ vi.stubGlobal('cancelAnimationFrame', clearTimeout)+})+afterEach(() => { vi.useRealTimers(); vi.clearAllMocks(); vi.unstubAllGlobals() })const note = (patch: Partial<NoteView> = {}): NoteView => ({ meetingId: 'meeting', status: 'waiting', enhanced: 'Previous summary', draft: '', mine: '', edited: false, peopleChanged: false, ...patch })function harness() {@@ -34,12 +38,14 @@ it('fades on the first words once, without restarting for more chunks or animativi.advanceTimersByTime(motion.micro / 2)expect(render(note({ status: 'writing', draft: '## Release plan' }))).toBe('handoff')vi.advanceTimersByTime(motion.micro / 2)+ expect(render(note({ status: 'writing', draft: '## Release plan' }))).toBe('reset')+ vi.advanceTimersByTime(16)expect(render(note({ status: 'writing', draft: '## Release plan' }))).toBe('streaming')expect(render(note({ status: 'done', enhanced: 'New summary' }))).toBe('saved')expect(vi.getTimerCount()).toBe(0)})-it.each(['failed', 'done'] as const)('restores the old result on %s before writing, during the fade, or after writing', status => {+it.each(['failed', 'done', 'stopped'] as const)('restores the old result on %s before writing, during the fade, or after writing', status => {vi.useFakeTimers()for (const elapsed of [undefined, 0, motion.micro]) {const render = harness()@@ -55,7 +61,7 @@ it.each(['failed', 'done'] as const)('restores the old result on %s before writi}})-it('skips the handoff for first summaries, reopening an existing stream, and reduced motion', () => {+it('skips fading first summaries and reopened streams, but still resets hidden scroll for reduced motion', () => {vi.useFakeTimers()const first = harness()expect(first(note({ enhanced: null }))).toBe('waiting')@@ -63,6 +69,8 @@ it('skips the handoff for first summaries, reopening an existing stream, and redexpect(harness()(note({ status: 'writing', draft: 'Already writing' }))).toBe('streaming')const reduced = harness()reduced(note(), true)+ expect(reduced(note({ status: 'writing', draft: 'New draft' }), true)).toBe('reset')+ vi.advanceTimersByTime(16)expect(reduced(note({ status: 'writing', draft: 'New draft' }), true)).toBe('streaming')expect(vi.getTimerCount()).toBe(0)})@@ -74,7 +82,9 @@ it('cancels the fade on navigation or a live reduced-motion change', () => {expect(render(note({ meetingId: 'other', status: 'done' }))).toBe('saved')expect(vi.getTimerCount()).toBe(0)render(note()); render(note({ status: 'writing', draft: 'New draft' }))- expect(render(note({ status: 'writing', draft: 'New draft' }), true)).toBe('streaming')+ render(note({ status: 'writing', draft: 'New draft' }), true)+ expect(render(note({ status: 'writing', draft: 'New draft' }), true)).toBe('reset')+ vi.advanceTimersByTime(16)expect(render(note({ status: 'writing', draft: 'New draft' }), false)).toBe('streaming')expect(vi.getTimerCount()).toBe(0)})diff --git a/app/test/summaryPresentation.test.ts b/app/test/summaryPresentation.test.tsindex 47e917cb..4badc81f 100644--- a/app/test/summaryPresentation.test.ts+++ b/app/test/summaryPresentation.test.ts@@ -8,6 +8,7 @@ it('keeps first summaries waiting, then streaming, then editable', () => {expect(summaryPresentation({ status: 'done', enhanced: 'Complete', draft: '' })).toBe('saved')expect(summaryPresentation({ status: 'empty', enhanced: null, draft: '' })).toBe('empty')expect(summaryPresentation({ status: 'failed', enhanced: null, draft: '' })).toBe('failed')+ expect(summaryPresentation({ status: 'stopped', enhanced: null, draft: 'Abandoned draft' })).toBe('stopped')})it.each(['Previous summary', ''])('retains a saved summary through reading, then hands partial drafts to the normal stream (%j)', enhanced => {@@ -21,7 +22,7 @@ it.each(['Previous summary', ''])('retains a saved summary through reading, then})it('restores the saved editor after failure or stopping, discards abandoned partial drafts', () => {- for (const status of ['failed', 'done', 'idle', 'empty'] as const) {+ for (const status of ['failed', 'done', 'idle', 'empty', 'stopped'] as const) {expect(summaryPresentation({ status, enhanced: 'Previous summary', draft: 'Abandoned draft' })).toBe('saved')}expect(summaryPresentation({ status: 'done', enhanced: 'New saved summary', draft: '' })).toBe('saved')diff --git a/app/test/summaryWaiting.test.ts b/app/test/summaryWaiting.test.tsindex c047a82e..241e9c99 100644--- a/app/test/summaryWaiting.test.ts+++ b/app/test/summaryWaiting.test.ts@@ -14,7 +14,7 @@ it('announces transcript reading once, with a decorative two-section outline', (expect(html.match(/summary-outline-heading/g)).toHaveLength(2)expect(html.match(/class="summary-outline-bullet"/g)).toHaveLength(4)expect(html.match(/Reading the transcript…/g)).toHaveLength(1)- expect(html).not.toContain('sr-only')+ expect(html).toContain('sr-only')expect(html).not.toContain('Reading a long meeting')})@@ -28,13 +28,10 @@ it('uses the actual long-meeting part and localizes both labels', () => {expect(html).not.toContain('Lecture de la transcription…')})-it('shows the same working line without an outline during a rewrite', () => {+it('announces the actual part without a visible label during a rewrite', () => {const reading = renderToStaticMarkup(createElement(SummaryWaiting, { outline: false, part: { part: 2, of: 4 } }))expect(reading).toContain('Reading a long meeting, part 2 of 4…')expect(reading).toContain('aria-live="polite"')expect(reading).not.toContain('summary-outline')- const writing = renderToStaticMarkup(createElement(SummaryWaiting, { outline: false, writing: true }))- expect(writing).toContain('Generating notes…')- expect(writing).not.toContain('Reading the transcript')- expect(writing).not.toContain('summary-outline')+ expect(reading).toContain('sr-only')})