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
Ask: each answer shows the scope it searched.
Eric Brownrout4c578989a73e
diff --git a/app/e2e/askContext.spec.ts b/app/e2e/askContext.spec.tsindex 09176db1..1f3d0edd 100644--- a/app/e2e/askContext.spec.ts+++ b/app/e2e/askContext.spec.ts@@ -25,6 +25,7 @@ test('Ask shares meeting history and drafts, and Command-J starts the right contawait input.fill('What was decided?')await input.press('Enter')await expect(page.getByTestId('chat-turn')).toHaveAttribute('data-status', 'done', { timeout: 15_000 })+ await expect(page.locator('.chat-answer-scope')).toHaveText('Searched Design review')await expect(page.getByTestId('ask-scope')).toHaveCount(1)await expect(page.getByTestId('ask-thread-context')).toHaveCount(0)await input.fill('Keep this question for later')@@ -42,6 +43,7 @@ test('Ask shares meeting history and drafts, and Command-J starts the right contawait page.getByRole('combobox', { name: 'Search meetings and folders' }).press('Escape')await expect(page.getByTestId('chat-page-input')).toBeFocused()await expect(page.getByTestId('chat-page-turn')).toHaveCount(1)+ await expect(page.locator('.chat-answer-scope')).toHaveText('Searched Design review')await page.reload()await expect(page.getByTestId('chat-page-input')).toHaveValue('Keep this question for later')await page.keyboard.press('Meta+j')diff --git a/app/src/main/library/conversations.ts b/app/src/main/library/conversations.tsindex 3c64eacf..03f2b84d 100644--- a/app/src/main/library/conversations.ts+++ b/app/src/main/library/conversations.ts@@ -54,7 +54,7 @@ export function hookConversations(p: Deps) {if (!list) {// Only a question that was waiting for the download resumes after a restart.list = p.library.turns(id)- .map((t) => ({ id: t.id, question: t.question, answer: t.answer, status: t.waitingModel ? 'waiting' as const : t.stopped || !t.answer ? 'stopped' as const : 'done' as const, sources: t.sources }))+ .map((t) => ({ id: t.id, question: t.question, answer: t.answer, scope: t.scope, status: t.waitingModel ? 'waiting' as const : t.stopped || !t.answer ? 'stopped' as const : 'done' as const, sources: t.sources }))open.set(id, list)}return list@@ -112,7 +112,7 @@ export function hookConversations(p: Deps) {const done = all.filter((t) => t.status === 'done' && t.answer)const history = done.map((t) => ({ question: t.question, answer: t.answer }))const turn: ConversationTurn = resume === undefined- ? { id: p.library.addTurn(cid, question, now(), p.waitsForModel()), question, answer: '', status: 'waiting', sources: [] }+ ? { id: p.library.addTurn(cid, question, now(), p.waitsForModel()), question, answer: '', status: 'waiting', sources: [], scope: p.library.describe(chips) }: all.find(t => t.id === resume)!if (resume === undefined) all.push(turn)const ac = new AbortController()diff --git a/app/src/main/library/store.ts b/app/src/main/library/store.tsindex 08fc18d0..23b1cd1c 100644--- a/app/src/main/library/store.ts+++ b/app/src/main/library/store.ts@@ -29,6 +29,7 @@ export function libraryTables(db: DatabaseSync) {CREATE INDEX IF NOT EXISTS conversation_turns_conversation ON conversation_turns(conversation_id, id);`)if (!(db.prepare('PRAGMA table_info(conversation_turns)').all() as Row[]).some(r => r.name === 'waiting_model')) db.exec('ALTER TABLE conversation_turns ADD COLUMN waiting_model INTEGER NOT NULL DEFAULT 0')+ if (!(db.prepare('PRAGMA table_info(conversation_turns)').all() as Row[]).some(r => r.name === 'scope')) db.exec('ALTER TABLE conversation_turns ADD COLUMN scope TEXT')const cols = (db.prepare('PRAGMA table_info(conversations)').all() as Row[]).map(r => r.name)for (const [name, definition] of Object.entries({ chips: "TEXT NOT NULL DEFAULT '[]'", draft: "TEXT NOT NULL DEFAULT ''", draft_chips: "TEXT NOT NULL DEFAULT '[]'", current_key: 'TEXT', legacy_meeting_id: 'TEXT', first_chips: 'TEXT' })) {if (!cols.includes(name)) db.exec(`ALTER TABLE conversations ADD COLUMN ${name} ${definition}`)@@ -66,7 +67,7 @@ export function migrateMeetingChats(db: DatabaseSync) {export type LibraryChunk = { id: number; meetingId: string; startMs: number; endMs: number; text: string; speakers: string[] }export type ConversationRow = { id: string; title: string; createdAt: number; updatedAt: number; chips: ContextChip[]; draft: string; draftChips: ContextChip[]; firstChips: ContextChip[] | null }-export type TurnRow = { id: number; question: string; answer: string; stopped: boolean; waitingModel: boolean; sources: LibrarySource[] }+export type TurnRow = { id: number; question: string; answer: string; stopped: boolean; waitingModel: boolean; sources: LibrarySource[]; scope?: ContextTarget[] }const toChunk = (r: Row): LibraryChunk => ({ id: Number(r.id), meetingId: String(r.meeting_id), startMs: Number(r.start_ms), endMs: Number(r.end_ms), text: String(r.text), speakers: JSON.parse(String(r.speakers)) })const toConversation = (r: Row): ConversationRow => ({ id: String(r.id), title: String(r.title), createdAt: Number(r.created_at), updatedAt: Number(r.updated_at), chips: JSON.parse(String(r.chips)), draft: String(r.draft), draftChips: JSON.parse(String(r.draft_chips)), firstChips: r.first_chips == null ? null : JSON.parse(String(r.first_chips)) })@@ -243,7 +244,7 @@ export class Library {turns(conversationId: string): TurnRow[] {return (this.db.prepare('SELECT * FROM conversation_turns WHERE conversation_id = ? ORDER BY id').all(conversationId) as Row[])- .map((r) => ({ id: Number(r.id), question: String(r.question), answer: String(r.answer), stopped: Number(r.stopped) === 1, waitingModel: Number(r.waiting_model) === 1, sources: JSON.parse(String(r.sources)) }))+ .map((r) => ({ id: Number(r.id), question: String(r.question), answer: String(r.answer), stopped: Number(r.stopped) === 1, waitingModel: Number(r.waiting_model) === 1, scope: r.scope == null ? undefined : JSON.parse(String(r.scope)), sources: JSON.parse(String(r.sources)) }))}/** a question asked: the conversation comes to the top of the list */addTurn(conversationId: string, question: string, now = Date.now(), waitingModel = false): number {@@ -251,7 +252,9 @@ export class Library {try {const id = Number(this.db.prepare('INSERT INTO conversation_turns (conversation_id, question, asked_at, waiting_model) VALUES (?, ?, ?, ?)').run(conversationId, question, now, waitingModel ? 1 : 0).lastInsertRowid)const chat = this.conversation(conversationId)!- if (chat.draftChips.length) this.writeScope(conversationId, attachContext(chat.chips, chat.draftChips))+ const chips = attachContext(chat.chips, chat.draftChips)+ if (chat.draftChips.length) this.writeScope(conversationId, chips)+ this.db.prepare('UPDATE conversation_turns SET scope = ? WHERE id = ?').run(JSON.stringify(this.describe(chips)), id)this.db.prepare("UPDATE conversations SET updated_at = ?, first_chips = coalesce(first_chips, chips), draft = '', draft_chips = '[]' WHERE id = ?").run(now, conversationId)this.db.exec('RELEASE ask_turn'); return id} catch (e) { this.db.exec('ROLLBACK TO ask_turn; RELEASE ask_turn'); throw e }diff --git a/app/src/renderer/src/components/AskContext.tsx b/app/src/renderer/src/components/AskContext.tsxindex 2b0fb776..0aaf057b 100644--- a/app/src/renderer/src/components/AskContext.tsx+++ b/app/src/renderer/src/components/AskContext.tsx@@ -1,5 +1,6 @@import { ChevronDown, FileText, Folder } from 'lucide-react'import type { ContextTarget } from '../../../shared/askContext'+import { tx } from '../i18n'import { t } from '../../../shared/i18n'export const chipTitle = (c: ContextTarget) => c.title.trim() || (c.kind === 'meeting' ? t('Untitled meeting') : t('Folder'))@@ -14,3 +15,12 @@ export function AskContext({ chips }: { chips: ContextTarget[] }) {return <>{!!chips.length && <Icon size={14} aria-hidden="true" />}<span className="ask-scope-label"><span className="ask-scope-name">{label.name}</span>{label.others && <span className="ask-scope-others">{` ${label.others}`}</span>}</span><ChevronDown size={12} aria-hidden="true" /></>}+++export function AnswerScope({ chips }: { chips: ContextTarget[] }) {+ const label = scopeLabel(chips)+ return <span className="chat-answer-scope" title={chips.length ? chips.map(chipTitle).join('\n') : label.name}>+ {chips.length ? tx('Searched {name}', { name: <span className="ask-scope-label"><span className="ask-scope-name">{label.name}</span>+ {label.others && <span className="ask-scope-others">{` ${label.others}`}</span>}</span> }) : t('Searched all meetings')}+ </span>+}diff --git a/app/src/renderer/src/components/AskConversation.tsx b/app/src/renderer/src/components/AskConversation.tsxindex 1f5163e2..37ee3b93 100644--- a/app/src/renderer/src/components/AskConversation.tsx+++ b/app/src/renderer/src/components/AskConversation.tsx@@ -17,7 +17,7 @@ import { ThinkingDots } from './ThinkingDots'import { ConversationActions } from './ConversationActions'import { ScrollFade } from './ScrollFade'import { rememberedScroll, useScrollMemory } from '../useScrollMemory'-import { AskContext, chipTitle } from './AskContext'+import { AnswerScope, AskContext, chipTitle } from './AskContext'import { useFollowLatest } from '../useFollowLatest'import { Swap, SwapText } from './Swap'import { attachAskTracer } from '../askTracer'@@ -294,7 +294,7 @@ export function AskConversation({ id, pendingDraftKey, initial, loadError = fals<ScrollFade><div className={`ask-thread${panel ? " chat-history" : ""}${unsent ? ' ask-thread-empty' : ''}`} ref={scroll}><div ref={content} className="ask-thread-content"><LoadingContent pending={!chat && !error} skeleton={<Loading layout="chat" testId="chat-thread-loading" />}>- {!landing && turns.map(turn => <Turn key={turn.id} turn={turn} chat={chat!} panel={panel} onSource={onSource} onRetry={() => send(turn.question)} />)}+ {!landing && turns.map(turn => <Turn key={turn.id} showCopy={turn === last} turn={turn} chat={chat!} panel={panel} onSource={onSource} onRetry={() => send(turn.question)} />)}{panel && suggestions}</LoadingContent></div></div></ScrollFade>@@ -348,12 +348,12 @@ export function AskConversation({ id, pendingDraftKey, initial, loadError = fals<p data-testid={`${prefix}-announce`} className="sr-only" aria-live="polite">{last?.status === 'done' ? last.answer : ''}</p></div>}-function Turn({ turn, chat, panel, onSource, onRetry }: { turn: ConversationTurn; chat: ConversationView; panel: boolean; onSource: (s: LibrarySource, match?: string) => void; onRetry: () => void }) {+function Turn({ turn, chat, panel, showCopy, onSource, onRetry }: { showCopy: boolean; turn: ConversationTurn; chat: ConversationView; panel: boolean; onSource: (s: LibrarySource, match?: string) => void; onRetry: () => void }) {const live = turn.status === 'answering', answer = useSmoothText(turn.answer, live)const [copied, setCopied] = useState(false), [failed, setFailed] = useState(false)const prefix = panel ? 'chat' : 'chat-page'useEffect(() => { if (!copied) return; const timer = setTimeout(() => setCopied(false), 1800); return () => clearTimeout(timer) }, [copied])- return <div data-testid={`${prefix}-turn`} data-status={turn.status} className="ask-turn">+ return <div data-testid={`${prefix}-turn`} data-status={turn.status} data-show-copy={showCopy || undefined} className="ask-turn"><p className="ask-question" data-testid={`${prefix}-question`}>{turn.question}</p>{(turn.status === 'waiting' || live && !answer) && (chat.waitsForModel && turn.status === 'waiting'? <NotesModelWait downloading={percent => <p role="status" className="text-sm text-muted">{t("Waiting for Yogurt's AI to finish downloading ({percent}). Your answer comes as soon as it's ready.", { percent })}</p>}><p role="status" className="text-sm text-muted">{t('Getting ready to answer. Yogurt is still setting up.')}</p></NotesModelWait>@@ -361,7 +361,7 @@ function Turn({ turn, chat, panel, onSource, onRetry }: { turn: ConversationTurn{answer && <div data-testid={`${prefix}-answer`} dir="auto" data-streaming={live || undefined} className={`note-prose chat-answer${live ? ' stream-caret' : ''}`}><AnswerText md={answer} live={live} sources={turn.sources} onSource={onSource} /></div>}{answer && !live && <div className="chat-answer-actions"><button className="chat-copy-action" data-testid="chat-copy-answer" aria-label={copied ? t('Copied') : t('Copy answer')} onClick={() => {void navigator.clipboard.writeText(turn.answer).then(() => { setCopied(true); setFailed(false) }).catch(() => setFailed(true))- }}><Swap show={copied ? 'done' : 'copy'} options={{ copy: <Copy size={13} />, done: <Check size={13} /> }} /><SwapText text={copied ? t('Copied') : t('Copy')} widest={t('Copied')} /></button><span role="status" className={failed ? 'text-danger' : 'sr-only'}>{failed ? t("Couldn't copy. Try again.") : copied ? t('Copied') : ''}</span></div>}+ }}><Swap show={copied ? 'done' : 'copy'} options={{ copy: <Copy size={13} />, done: <Check size={13} /> }} /><SwapText text={copied ? t('Copied') : t('Copy')} widest={t('Copied')} /></button>{turn.scope && <AnswerScope chips={turn.scope} />}<span role="status" className={failed ? 'text-danger' : 'sr-only'}>{failed ? t("Couldn't copy. Try again.") : copied ? t('Copied') : ''}</span></div>}{turn.status === 'stopped' && <p className="text-xs text-muted">{answer ? t('Stopped') : t('Stopped before answering')}</p>}{turn.status === 'failed' && <p role="alert">{t("Yogurt couldn't answer that.")} <button className="ghost-btn" onClick={onRetry}>{t('Try again')}</button></p>}</div>diff --git a/app/src/renderer/src/styles.css b/app/src/renderer/src/styles.cssindex af1bf090..b29e92a2 100644--- a/app/src/renderer/src/styles.css+++ b/app/src/renderer/src/styles.css@@ -602,7 +602,12 @@ input::selection, textarea::selection, .note-prose ::selection { background: var.chat-icon:hover,.chat-icon[aria-expanded=true] { background:var(--control);color:var(--ink); }.chat-latest { position:absolute;z-index:1;bottom:8px;inset-inline-start:calc(50% - 15px);display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--line);border-radius:50%;background:var(--float);color:var(--muted);box-shadow:var(--shadow-soft); }.chat-answer-actions { display:flex;align-items:center;gap:8px;margin-top:6px; }-.chat-copy-action { display:inline-flex;align-items:center;gap:5px;padding:4px 5px;margin-inline-start:-5px;min-height:28px;border-radius:5px;font-size:11px;color:var(--muted); }+.ask-turn .chat-answer-actions { opacity:0;transition:opacity var(--dur-micro) var(--ease-out); }+.ask-turn:is([data-show-copy],:hover,:focus-within) .chat-answer-actions { opacity:1; }+@media (hover:none) { .ask-turn .chat-answer-actions { opacity:1; } }+.chat-answer-scope { display:flex;align-items:center;min-width:0;margin-inline-start:-5px;font-size:11px;line-height:16px;color:var(--muted);white-space:pre; }+.chat-answer-scope::before { content:"·";flex:none;margin-inline-end:8px; }+.chat-copy-action { flex:none;display:inline-flex;align-items:center;gap:5px;padding:4px 5px;margin-inline-start:-5px;min-height:28px;border-radius:5px;font-size:11px;color:var(--muted); }.chat-copy-action:hover { background:var(--control);color:var(--ink); }.chat-progress { display:flex;align-items:center;gap:9px;padding-block:5px;color:var(--muted);font-size:13px;line-height:20px; }.thinking-dots { width:18px;height:20px;flex:none;color:var(--accent); }diff --git a/app/src/shared/locales/ar.json b/app/src/shared/locales/ar.jsonindex c5a227f2..355a2156 100644--- a/app/src/shared/locales/ar.json+++ b/app/src/shared/locales/ar.json@@ -738,5 +738,7 @@"and {count} others": "و{count} إضافية","{count} more": "{count} إضافية","Clear": "مسح",- "Reading {title} {others}…": "جارٍ قراءة {title} {others}…"+ "Reading {title} {others}…": "جارٍ قراءة {title} {others}…",+ "Searched {name}": "تم البحث في {name}",+ "Searched all meetings": "تم البحث في كل الاجتماعات"}diff --git a/app/src/shared/locales/bn.json b/app/src/shared/locales/bn.jsonindex c5e825b8..3a3cbec1 100644--- a/app/src/shared/locales/bn.json+++ b/app/src/shared/locales/bn.json@@ -670,5 +670,7 @@"and {count} others": "ও আরও {count}টি","{count} more": "আরও {count}টি","Clear": "মুছুন",- "Reading {title} {others}…": "{title} {others} পড়া হচ্ছে…"+ "Reading {title} {others}…": "{title} {others} পড়া হচ্ছে…",+ "Searched {name}": "{name}-এ খোঁজা হয়েছে",+ "Searched all meetings": "সব মিটিংয়ে খোঁজা হয়েছে"}diff --git a/app/src/shared/locales/cs.json b/app/src/shared/locales/cs.jsonindex c24fa47e..0a5d0c87 100644--- a/app/src/shared/locales/cs.json+++ b/app/src/shared/locales/cs.json@@ -713,5 +713,7 @@"and {count} others": "a {count} další","{count} more": "{count} další","Clear": "Vymazat",- "Reading {title} {others}…": "Čtení {title} {others}…"+ "Reading {title} {others}…": "Čtení {title} {others}…",+ "Searched {name}": "Prohledáno {name}",+ "Searched all meetings": "Prohledány všechny schůzky"}diff --git a/app/src/shared/locales/da.json b/app/src/shared/locales/da.jsonindex 7b78fbd5..1792ab28 100644--- a/app/src/shared/locales/da.json+++ b/app/src/shared/locales/da.json@@ -682,5 +682,7 @@"and {count} others": "og {count} andre","{count} more": "{count} flere","Clear": "Ryd",- "Reading {title} {others}…": "Læser {title} {others}…"+ "Reading {title} {others}…": "Læser {title} {others}…",+ "Searched {name}": "Søgte i {name}",+ "Searched all meetings": "Søgte i alle møder"}diff --git a/app/src/shared/locales/de.json b/app/src/shared/locales/de.jsonindex e5cf31d1..ddd30ca1 100644--- a/app/src/shared/locales/de.json+++ b/app/src/shared/locales/de.json@@ -682,5 +682,7 @@"and {count} others": "und {count} weitere","{count} more": "{count} weitere","Clear": "Zurücksetzen",- "Reading {title} {others}…": "„{title}“ {others} werden gelesen …"+ "Reading {title} {others}…": "„{title}“ {others} werden gelesen …",+ "Searched {name}": "{name} durchsucht",+ "Searched all meetings": "Alle Besprechungen durchsucht"}diff --git a/app/src/shared/locales/el.json b/app/src/shared/locales/el.jsonindex 06266441..e3ebda08 100644--- a/app/src/shared/locales/el.json+++ b/app/src/shared/locales/el.json@@ -685,5 +685,7 @@"and {count} others": "και {count} ακόμη","{count} more": "{count} ακόμη","Clear": "Εκκαθάριση",- "Reading {title} {others}…": "Ανάγνωση {title} {others}…"+ "Reading {title} {others}…": "Ανάγνωση {title} {others}…",+ "Searched {name}": "Αναζήτηση στο {name}",+ "Searched all meetings": "Αναζήτηση σε όλες τις συναντήσεις"}diff --git a/app/src/shared/locales/en.json b/app/src/shared/locales/en.jsonindex 00a3275f..8f942992 100644--- a/app/src/shared/locales/en.json+++ b/app/src/shared/locales/en.json@@ -142,5 +142,7 @@"one": "{count} more","other": "{count} more"},- "Clear": "Clear"+ "Clear": "Clear",+ "Searched {name}": "Searched {name}",+ "Searched all meetings": "Searched all meetings"}diff --git a/app/src/shared/locales/es.json b/app/src/shared/locales/es.jsonindex 384be336..cd00824e 100644--- a/app/src/shared/locales/es.json+++ b/app/src/shared/locales/es.json@@ -695,5 +695,7 @@"and {count} others": "y {count} más","{count} more": "{count} más","Clear": "Borrar",- "Reading {title} {others}…": "Leyendo {title} {others}…"+ "Reading {title} {others}…": "Leyendo {title} {others}…",+ "Searched {name}": "Se buscó en {name}",+ "Searched all meetings": "Se buscó en todas las reuniones"}diff --git a/app/src/shared/locales/fi.json b/app/src/shared/locales/fi.jsonindex 47d83081..bea3cd62 100644--- a/app/src/shared/locales/fi.json+++ b/app/src/shared/locales/fi.json@@ -688,5 +688,7 @@},"{count} more": "{count} lisää","Clear": "Tyhjennä",- "Reading {title} {others}…": "Luetaan {title} {others}…"+ "Reading {title} {others}…": "Luetaan {title} {others}…",+ "Searched {name}": "Haettu kohteesta {name}",+ "Searched all meetings": "Haettu kaikista kokouksista"}diff --git a/app/src/shared/locales/fil.json b/app/src/shared/locales/fil.jsonindex 1210136f..0fb64c0c 100644--- a/app/src/shared/locales/fil.json+++ b/app/src/shared/locales/fil.json@@ -682,5 +682,7 @@"and {count} others": "at {count} pa","{count} more": "{count} pa","Clear": "I-clear",- "Reading {title} {others}…": "Binabasa ang {title} {others}…"+ "Reading {title} {others}…": "Binabasa ang {title} {others}…",+ "Searched {name}": "Hinanap sa {name}",+ "Searched all meetings": "Hinanap sa lahat ng pulong"}diff --git a/app/src/shared/locales/fr.json b/app/src/shared/locales/fr.jsonindex f9cef034..05ea4d0a 100644--- a/app/src/shared/locales/fr.json+++ b/app/src/shared/locales/fr.json@@ -698,5 +698,7 @@},"{count} more": "{count} de plus","Clear": "Effacer",- "Reading {title} {others}…": "Lecture de « {title} » {others}…"+ "Reading {title} {others}…": "Lecture de « {title} » {others}…",+ "Searched {name}": "Recherche dans {name}",+ "Searched all meetings": "Recherche dans toutes les réunions"}diff --git a/app/src/shared/locales/he.json b/app/src/shared/locales/he.jsonindex 114e0c63..b0287c8c 100644--- a/app/src/shared/locales/he.json+++ b/app/src/shared/locales/he.json@@ -692,5 +692,7 @@"and {count} others": "ועוד {count}","{count} more": "עוד {count}","Clear": "נקה",- "Reading {title} {others}…": "קורא את {title} {others}…"+ "Reading {title} {others}…": "קורא את {title} {others}…",+ "Searched {name}": "בוצע חיפוש ב־{name}",+ "Searched all meetings": "בוצע חיפוש בכל הפגישות"}diff --git a/app/src/shared/locales/hi.json b/app/src/shared/locales/hi.jsonindex b5a89fc3..a7915f2c 100644--- a/app/src/shared/locales/hi.json+++ b/app/src/shared/locales/hi.json@@ -670,5 +670,7 @@"and {count} others": "और {count} अन्य","{count} more": "{count} और","Clear": "साफ़ करें",- "Reading {title} {others}…": "{title} {others} पढ़ी जा रही हैं…"+ "Reading {title} {others}…": "{title} {others} पढ़ी जा रही हैं…",+ "Searched {name}": "{name} में खोजा गया",+ "Searched all meetings": "सभी मीटिंग में खोजा गया"}diff --git a/app/src/shared/locales/hu.json b/app/src/shared/locales/hu.jsonindex be34394a..e8652954 100644--- a/app/src/shared/locales/hu.json+++ b/app/src/shared/locales/hu.json@@ -670,5 +670,7 @@"and {count} others": "és {count} további","{count} more": "Még {count}","Clear": "Törlés",- "Reading {title} {others}…": "„{title}” {others} olvasása…"+ "Reading {title} {others}…": "„{title}” {others} olvasása…",+ "Searched {name}": "{name} átvizsgálva",+ "Searched all meetings": "Összes megbeszélés átvizsgálva"}diff --git a/app/src/shared/locales/id.json b/app/src/shared/locales/id.jsonindex ac7a787d..2d232389 100644--- a/app/src/shared/locales/id.json+++ b/app/src/shared/locales/id.json@@ -640,5 +640,7 @@"and {count} others": "dan {count} lainnya","{count} more": "{count} lagi","Clear": "Hapus",- "Reading {title} {others}…": "Membaca {title} {others}…"+ "Reading {title} {others}…": "Membaca {title} {others}…",+ "Searched {name}": "Dicari di {name}",+ "Searched all meetings": "Dicari di semua rapat"}diff --git a/app/src/shared/locales/it.json b/app/src/shared/locales/it.jsonindex 235aef3c..db13bc17 100644--- a/app/src/shared/locales/it.json+++ b/app/src/shared/locales/it.json@@ -701,5 +701,7 @@},"{count} more": "Altri {count}","Clear": "Cancella",- "Reading {title} {others}…": "Lettura di «{title}» {others}…"+ "Reading {title} {others}…": "Lettura di «{title}» {others}…",+ "Searched {name}": "Ricerca in {name}",+ "Searched all meetings": "Ricerca in tutte le riunioni"}diff --git a/app/src/shared/locales/ja.json b/app/src/shared/locales/ja.jsonindex eb20ca26..fe757034 100644--- a/app/src/shared/locales/ja.json+++ b/app/src/shared/locales/ja.json@@ -640,5 +640,7 @@"and {count} others": "と他 {count} 件","{count} more": "他 {count} 件","Clear": "クリア",- "Reading {title} {others}…": "「{title}」{others}を読んでいます…"+ "Reading {title} {others}…": "「{title}」{others}を読んでいます…",+ "Searched {name}": "{name}を検索",+ "Searched all meetings": "すべての会議を検索"}diff --git a/app/src/shared/locales/ko.json b/app/src/shared/locales/ko.jsonindex f066e15b..dc6ad577 100644--- a/app/src/shared/locales/ko.json+++ b/app/src/shared/locales/ko.json@@ -640,5 +640,7 @@"and {count} others": "외 {count}개","{count} more": "{count}개 더","Clear": "지우기",- "Reading {title} {others}…": "‘{title}’ {others} 읽는 중…"+ "Reading {title} {others}…": "‘{title}’ {others} 읽는 중…",+ "Searched {name}": "{name}에서 검색함",+ "Searched all meetings": "모든 회의에서 검색함"}diff --git a/app/src/shared/locales/ms.json b/app/src/shared/locales/ms.jsonindex af506c40..61bddd40 100644--- a/app/src/shared/locales/ms.json+++ b/app/src/shared/locales/ms.json@@ -640,5 +640,7 @@"and {count} others": "dan {count} lagi","{count} more": "{count} lagi","Clear": "Kosongkan",- "Reading {title} {others}…": "Membaca {title} {others}…"+ "Reading {title} {others}…": "Membaca {title} {others}…",+ "Searched {name}": "Dicari dalam {name}",+ "Searched all meetings": "Dicari dalam semua mesyuarat"}diff --git a/app/src/shared/locales/nb.json b/app/src/shared/locales/nb.jsonindex 1e632980..50b48daa 100644--- a/app/src/shared/locales/nb.json+++ b/app/src/shared/locales/nb.json@@ -682,5 +682,7 @@"and {count} others": "og {count} andre","{count} more": "{count} til","Clear": "Tøm",- "Reading {title} {others}…": "Leser {title} {others}…"+ "Reading {title} {others}…": "Leser {title} {others}…",+ "Searched {name}": "Søkte i {name}",+ "Searched all meetings": "Søkte i alle møter"}diff --git a/app/src/shared/locales/nl.json b/app/src/shared/locales/nl.jsonindex bb27b51a..023d8294 100644--- a/app/src/shared/locales/nl.json+++ b/app/src/shared/locales/nl.json@@ -682,5 +682,7 @@"and {count} others": "en {count} andere","{count} more": "Nog {count}","Clear": "Wissen",- "Reading {title} {others}…": "{title} {others} lezen…"+ "Reading {title} {others}…": "{title} {others} lezen…",+ "Searched {name}": "Gezocht in {name}",+ "Searched all meetings": "Gezocht in alle vergaderingen"}diff --git a/app/src/shared/locales/pl.json b/app/src/shared/locales/pl.jsonindex 3cf402c6..c67cfdc3 100644--- a/app/src/shared/locales/pl.json+++ b/app/src/shared/locales/pl.json@@ -718,5 +718,7 @@},"{count} more": "Jeszcze {count}","Clear": "Wyczyść",- "Reading {title} {others}…": "Czytanie spotkań „{title}” {others}…"+ "Reading {title} {others}…": "Czytanie spotkań „{title}” {others}…",+ "Searched {name}": "Przeszukano {name}",+ "Searched all meetings": "Przeszukano wszystkie spotkania"}diff --git a/app/src/shared/locales/pt-BR.json b/app/src/shared/locales/pt-BR.jsonindex 4c7bc877..db362847 100644--- a/app/src/shared/locales/pt-BR.json+++ b/app/src/shared/locales/pt-BR.json@@ -698,5 +698,7 @@},"{count} more": "Mais {count}","Clear": "Limpar",- "Reading {title} {others}…": "Lendo {title} {others}…"+ "Reading {title} {others}…": "Lendo {title} {others}…",+ "Searched {name}": "Pesquisa em {name}",+ "Searched all meetings": "Pesquisa em todas as reuniões"}diff --git a/app/src/shared/locales/ro.json b/app/src/shared/locales/ro.jsonindex 9f638f52..e3fae32d 100644--- a/app/src/shared/locales/ro.json+++ b/app/src/shared/locales/ro.json@@ -699,5 +699,7 @@"and {count} others": "și încă {count}","{count} more": "Încă {count}","Clear": "Șterge",- "Reading {title} {others}…": "Se citesc „{title}” {others}…"+ "Reading {title} {others}…": "Se citesc „{title}” {others}…",+ "Searched {name}": "Căutat în {name}",+ "Searched all meetings": "Căutat în toate întâlnirile"}diff --git a/app/src/shared/locales/ru.json b/app/src/shared/locales/ru.jsonindex ccad7034..880953f9 100644--- a/app/src/shared/locales/ru.json+++ b/app/src/shared/locales/ru.json@@ -710,5 +710,7 @@"and {count} others": "и ещё {count}","{count} more": "Ещё {count}","Clear": "Очистить",- "Reading {title} {others}…": "Читаем «{title}» {others}…"+ "Reading {title} {others}…": "Читаем «{title}» {others}…",+ "Searched {name}": "Поиск в {name}",+ "Searched all meetings": "Поиск по всем встречам"}diff --git a/app/src/shared/locales/sv.json b/app/src/shared/locales/sv.jsonindex 0dcf2502..a98baacc 100644--- a/app/src/shared/locales/sv.json+++ b/app/src/shared/locales/sv.json@@ -682,5 +682,7 @@"and {count} others": "och {count} till","{count} more": "{count} till","Clear": "Rensa",- "Reading {title} {others}…": "Läser {title} {others}…"+ "Reading {title} {others}…": "Läser {title} {others}…",+ "Searched {name}": "Sökte i {name}",+ "Searched all meetings": "Sökte i alla möten"}diff --git a/app/src/shared/locales/th.json b/app/src/shared/locales/th.jsonindex 7327dbdd..3f8dd28b 100644--- a/app/src/shared/locales/th.json+++ b/app/src/shared/locales/th.json@@ -640,5 +640,7 @@"and {count} others": "และอีก {count} รายการ","{count} more": "อีก {count} รายการ","Clear": "ล้าง",- "Reading {title} {others}…": "กำลังอ่าน {title} {others}…"+ "Reading {title} {others}…": "กำลังอ่าน {title} {others}…",+ "Searched {name}": "ค้นหาใน {name} แล้ว",+ "Searched all meetings": "ค้นหาในการประชุมทั้งหมดแล้ว"}diff --git a/app/src/shared/locales/tr.json b/app/src/shared/locales/tr.jsonindex 617779b1..c4cb1681 100644--- a/app/src/shared/locales/tr.json+++ b/app/src/shared/locales/tr.json@@ -670,5 +670,7 @@"and {count} others": "ve {count} diğer","{count} more": "{count} tane daha","Clear": "Temizle",- "Reading {title} {others}…": "“{title}” {others} okunuyor…"+ "Reading {title} {others}…": "“{title}” {others} okunuyor…",+ "Searched {name}": "{name} içinde arandı",+ "Searched all meetings": "Tüm toplantılarda arandı"}diff --git a/app/src/shared/locales/uk.json b/app/src/shared/locales/uk.jsonindex 7ce78bf1..06ca3f77 100644--- a/app/src/shared/locales/uk.json+++ b/app/src/shared/locales/uk.json@@ -710,5 +710,7 @@"and {count} others": "і ще {count}","{count} more": "Ще {count}","Clear": "Очистити",- "Reading {title} {others}…": "Читаємо «{title}» {others}…"+ "Reading {title} {others}…": "Читаємо «{title}» {others}…",+ "Searched {name}": "Пошук у {name}",+ "Searched all meetings": "Пошук у всіх зустрічах"}diff --git a/app/src/shared/locales/vi.json b/app/src/shared/locales/vi.jsonindex 3b5fdfcc..0ad8911c 100644--- a/app/src/shared/locales/vi.json+++ b/app/src/shared/locales/vi.json@@ -640,5 +640,7 @@"and {count} others": "và {count} mục khác","{count} more": "Thêm {count} mục","Clear": "Xóa",- "Reading {title} {others}…": "Đang đọc {title} {others}…"+ "Reading {title} {others}…": "Đang đọc {title} {others}…",+ "Searched {name}": "Đã tìm trong {name}",+ "Searched all meetings": "Đã tìm trong tất cả cuộc họp"}diff --git a/app/src/shared/locales/zh-CN.json b/app/src/shared/locales/zh-CN.jsonindex 05dc569f..a695206e 100644--- a/app/src/shared/locales/zh-CN.json+++ b/app/src/shared/locales/zh-CN.json@@ -640,5 +640,7 @@"and {count} others": "及其他 {count} 项","{count} more": "还有 {count} 项","Clear": "清除",- "Reading {title} {others}…": "正在读取“{title}”{others}…"+ "Reading {title} {others}…": "正在读取“{title}”{others}…",+ "Searched {name}": "已搜索{name}",+ "Searched all meetings": "已搜索所有会议"}diff --git a/app/src/shared/locales/zh-TW.json b/app/src/shared/locales/zh-TW.jsonindex bad09d41..efeba3ba 100644--- a/app/src/shared/locales/zh-TW.json+++ b/app/src/shared/locales/zh-TW.json@@ -640,5 +640,7 @@"and {count} others": "及其他 {count} 項","{count} more": "還有 {count} 項","Clear": "清除",- "Reading {title} {others}…": "正在讀取「{title}」{others}…"+ "Reading {title} {others}…": "正在讀取「{title}」{others}…",+ "Searched {name}": "已搜尋{name}",+ "Searched all meetings": "已搜尋所有會議"}diff --git a/app/src/shared/types.ts b/app/src/shared/types.tsindex ae10168a..ca4100ce 100644--- a/app/src/shared/types.ts+++ b/app/src/shared/types.ts@@ -420,7 +420,7 @@ export type LibrarySource = {/** One question across meetings and its answer as it is written; sources: what [1], [2]… in the answer point to *//** what an answer is doing before its first words: the model loading, searching meetings, or reading what it found */export type AskStep = { kind: 'loading' | 'searching' | 'reading'; title?: string; meetings?: number }-export type ConversationTurn = { id: number; question: string; answer: string; status: ChatTurn['status']; sources: LibrarySource[]; step?: AskStep }+export type ConversationTurn = { id: number; question: string; answer: string; scope?: ContextTarget[]; status: ChatTurn['status']; sources: LibrarySource[]; step?: AskStep }export type ConversationView = {id: string; title: string; chips: ContextTarget[]; draft: string; draftChips: ContextTarget[]; firstChips: ContextTarget[] | null; turns: ConversationTurn[]/** a Mac with little memory is recording: answers wait for the meeting to end */diff --git a/app/test/answerScope.test.ts b/app/test/answerScope.test.tsnew file mode 100644index 00000000..afacfa06--- /dev/null+++ b/app/test/answerScope.test.ts@@ -0,0 +1,40 @@+import { afterEach, expect, it, vi } from 'vitest'+import { createElement } from 'react'+import { renderToStaticMarkup } from 'react-dom/server'+import { AnswerScope } from '../src/renderer/src/components/AskContext'+import { AskConversation } from '../src/renderer/src/components/AskConversation'+import type { ContextTarget } from '../src/shared/askContext'+import type { ConversationTurn, ConversationView } from '../src/shared/types'++const folder: ContextTarget = { kind: 'folder', id: 'planning', title: 'Planning' }+const meeting: ContextTarget = { kind: 'meeting', id: 'release', title: 'Release review' }+afterEach(() => vi.unstubAllGlobals())++it.each([+ [[], 'Searched all meetings'],+ [[folder], 'Searched Planning'],+ [[folder, meeting], 'Searched Planning and 1 other'],+ [[folder, meeting, { ...meeting, id: 'next' }], 'Searched Planning and 2 others'],+] as [ContextTarget[], string][])('labels the searched scope %j', (chips, expected) => {+ const html = renderToStaticMarkup(createElement(AnswerScope, { chips }))+ expect(html.replace(/<[^>]*>/g, '')).toBe(expected)+ if (chips.length > 1) {+ expect(html).toContain('title="Planning\nRelease review')+ expect(html).toContain('class="ask-scope-name">Planning</span>')+ expect(html).toContain('class="ask-scope-others"')+ }+})++it.each([false, true])('shows saved scopes on finished answers, without inventing legacy scope or showing it mid-stream (panel: %s)', panel => {+ vi.stubGlobal('window', { matchMedia: () => ({ matches: false }) })+ const initial: ConversationView = { id: 'scope', title: '', draft: '', chips: [folder], draftChips: [], firstChips: [], waitsForMeeting: false, waitsForModel: false,+ turns: [{ id: 1, question: 'What changed?', answer: 'The release is ready.', status: 'done', sources: [] }] }+ const render = (scope: ContextTarget[] | undefined, status: ConversationTurn['status']) => {+ initial.turns[0] = { ...initial.turns[0], scope, status }+ return renderToStaticMarkup(createElement(AskConversation, { id: initial.id, initial, panel, onSelect() {}, onDeleted() {}, onSource() {} }))+ }+ expect(render(undefined, 'done')).not.toContain('chat-answer-scope')+ expect(render([], 'done')).toContain('Searched all meetings')+ expect(render([folder], 'done')).toContain('chat-answer-scope')+ expect(render([folder], 'answering')).not.toContain('chat-answer-scope')+})diff --git a/app/test/askContext.test.ts b/app/test/askContext.test.tsindex bf189335..74582908 100644--- a/app/test/askContext.test.ts+++ b/app/test/askContext.test.ts@@ -3,7 +3,7 @@ import { mkdtempSync, rmSync } from 'node:fs'import { join } from 'node:path'import { tmpdir } from 'node:os'import { openStore, type Store } from '../src/main/store'-import { Library, migrateMeetingChats } from '../src/main/library/store'+import { Library, libraryTables, migrateMeetingChats } from '../src/main/library/store'import { mergeBackup } from '../src/main/backup'import { askDestination, attachContext, chipScope, contextKey, mentionAt } from '../src/shared/askContext'@@ -243,3 +243,27 @@ it('limits matching targets to 40 of each kind before renderer caps', () => {}expect(library.targets('no match')).toEqual([])})+++it('snapshots the merged scope and names per turn, retaining all-meetings and legacy distinctions through backup', () => {+ const { store: s, library: l, file } = fresh()+ const m = meeting(s, 'Release review'), f = s.createFolder('Planning')+ const a = { kind: 'meeting' as const, id: m.id }, b = { kind: 'folder' as const, id: f.id }+ const id = l.current([a])+ l.addTurn(id, 'Earlier question')+ s.db.exec('ALTER TABLE conversation_turns DROP COLUMN scope')+ libraryTables(s.db)+ expect(l.turns(id)[0].scope).toBeUndefined()+ l.setContext(id, [b])+ l.addTurn(id, 'Search both')+ const scope = [{ ...a, title: 'Release review' }, { ...b, title: 'Planning' }]+ expect(l.turns(id)[1].scope).toEqual(scope)+ s.updateMeeting(m.id, { title: 'Renamed review' })+ l.removeContext(id, a); l.removeContext(id, b)+ l.addTurn(id, 'Search everything')+ expect(l.turns(id).map(turn => turn.scope)).toEqual([undefined, scope, []])+ const reopened = openStore(file); stores.push(reopened)+ expect(new Library(reopened.db).turns(id).map(turn => turn.scope)).toEqual([undefined, scope, []])+ const target = fresh(); mergeBackup(target.store.db, s.db)+ expect(target.library.turns(id).map(turn => turn.scope)).toEqual([undefined, scope, []])+})diff --git a/app/test/i18n-tables.test.ts b/app/test/i18n-tables.test.tsindex 85567dc4..1ae5f88c 100644--- a/app/test/i18n-tables.test.ts+++ b/app/test/i18n-tables.test.ts@@ -228,3 +228,15 @@ it('translates the closest matching meeting and count in every locale', () => {expect(load(id)[key]).toContain('{others}')}})+++it('translates the searched scope line in every locale', () => {+ for (const key of ['Searched all meetings', 'Searched {name}']) {+ expect(keys).toContain(key)+ for (const { id } of LOCALES) {+ expect(load(id)[key]).toBeTypeOf('string')+ expect(load(id)[key]).not.toBe('')+ if (id !== 'en') expect(load(id)[key]).not.toBe(key)+ }+ }+})diff --git a/app/test/libraryChat.test.ts b/app/test/libraryChat.test.tsindex e60e985b..33aca621 100644--- a/app/test/libraryChat.test.ts+++ b/app/test/libraryChat.test.ts@@ -211,6 +211,9 @@ it('an empty chip scope never reads unrelated meetings, while folder and meetingexpect(t.chats.view(id)).toMatchObject({ chips: [{ kind: 'folder', id: folder.id }, { kind: 'meeting', id: prepared.id }], draftChips: [] })expect(t.prompts.at(-1)).toContain('Twenty dollars a seat')expect(t.prompts.at(-1)).toContain('October budget')+ const scopes = [[{ kind: 'folder', id: folder.id, title: 'Project' }], [{ kind: 'folder', id: folder.id, title: 'Project' }, { kind: 'meeting', id: prepared.id, title: 'Prep' }]]+ expect(t.chats.view(id)!.turns.map(turn => turn.scope)).toEqual(scopes)+ expect(hookConversations(t.deps).view(id)!.turns.map(turn => turn.scope)).toEqual(scopes)})it('does not acknowledge and discard a draft when its conversation is deleted or already answering', async () => {diff --git a/app/test/libraryStore.test.ts b/app/test/libraryStore.test.tsindex 4b91ab96..3ee9d4e1 100644--- a/app/test/libraryStore.test.ts+++ b/app/test/libraryStore.test.ts@@ -96,7 +96,7 @@ describe('conversations', () => {lib.setTurn(t, 'It is 20 dollars [1].', false, [{ n: 1, meetingId: 'm1', title: 'Pricing', startedAt: 5, atMs: 6000 }])// asking moves a conversation to the topexpect(lib.conversations().map((c) => c.id)).toEqual([a, b])- expect(lib.turns(a)).toEqual([{ id: t, question: 'what about pricing?', answer: 'It is 20 dollars [1].', stopped: false, waitingModel: false, sources: [{ n: 1, meetingId: 'm1', title: 'Pricing', startedAt: 5, atMs: 6000 }] }])+ expect(lib.turns(a)).toEqual([{ id: t, question: 'what about pricing?', answer: 'It is 20 dollars [1].', stopped: false, waitingModel: false, scope: [], sources: [{ n: 1, meetingId: 'm1', title: 'Pricing', startedAt: 5, atMs: 6000 }] }])lib.renameConversation(a, 'Pricing questions')expect(lib.conversation(a)?.title).toBe('Pricing questions')lib.deleteConversation(a)diff --git a/app/test/motionInteractions.test.ts b/app/test/motionInteractions.test.tsindex 670201c4..af52da15 100644--- a/app/test/motionInteractions.test.ts+++ b/app/test/motionInteractions.test.ts@@ -760,3 +760,20 @@ it('checks an inline match already in scope and consumes its mention without addexpect(c.input().value).toBe('')expect(c.input()['aria-expanded']).toBe(false)})++it.each([false, true])('keeps Copy on the current answer without revealing older controls during streaming (panel: %s)', panel => {+ vi.stubGlobal('document', { body: {} })+ vi.stubGlobal('window', { yogurt: { conversations: {} } })+ const initial: ConversationView = { id: 'copy-visibility', title: '', draft: '', chips: [], draftChips: [], firstChips: [], waitsForMeeting: false, waitsForModel: false,+ turns: [1, 2, 3].map(id => ({ id, question: 'What changed?', answer: 'The release is ready.', status: 'done', sources: [], createdAt: id })) }+ const render = renderer(() => AskConversation({ id: initial.id, initial, panel, onSelect() {}, onDeleted() {}, onSource() {} }))+ const turns = () => find(render(), 'ask-thread-content').props.children.props.children[0] as ReactElement<any>[]+ expect(turns().map(turn => turn.props.showCopy)).toEqual([false, false, true])+ initial.turns[2].status = 'answering'+ expect(turns().map(turn => turn.props.showCopy)).toEqual([false, false, true])+ initial.turns[2].status = 'waiting'+ expect(turns().map(turn => turn.props.showCopy)).toEqual([false, false, true])+ initial.turns[2].status = 'failed'+ initial.turns[2].answer = ''+ expect(turns().map(turn => turn.props.showCopy)).toEqual([false, false, true])+})