Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Calls: the stop question is the same compact card as the start offer, with a close button that ends the questions for that recording

Eric Brownrout347f4b4d0bc9
diff --git a/app/e2e/detect.spec.ts b/app/e2e/detect.spec.ts
index e014e967..a5c0bb2c 100644
--- a/app/e2e/detect.spec.ts
+++ b/app/e2e/detect.spec.ts
@@ -133,6 +133,14 @@ test('when the call ends the card asks, and Stop stops the meeting; Keep going w
await advance(app, 31_000)
const p = await card(app)
await expect(p.getByTestId('prompt-heading')).toHaveText('Stop recording?')
+ expect(await p.evaluate(() => [innerWidth, innerHeight])).toEqual([381, 60])
+ await expect(p.locator('.call-prompt-icon')).toBeVisible()
+ await expect(p.getByTestId('prompt-title')).toHaveText('Design review')
+ await expect(p.getByTestId('prompt-countdown')).toHaveCount(0)
+ await expect(p.getByRole('button', { name: 'Close', exact: true })).toHaveAttribute('data-testid', 'prompt-dismiss-stop')
+ const boxes = await Promise.all(['prompt-keep-going', 'prompt-stop', 'prompt-dismiss-stop'].map(id => p.getByTestId(id).boundingBox()))
+ const centres = boxes.map(b => b!.y + b!.height / 2)
+ expect(Math.max(...centres) - Math.min(...centres)).toBeLessThan(1)
await p.clock.install(); await p.reload()
await expect(p.getByTestId('prompt-keep-going')).toBeVisible()
await p.clock.fastForward(20_000)
diff --git a/app/src/main/index.ts b/app/src/main/index.ts
index b4343dec..e2ef3d10 100644
--- a/app/src/main/index.ts
+++ b/app/src/main/index.ts
@@ -315,6 +315,7 @@ function startDetection() {
stop: (id) => { stopMeeting(id) },
dismissed: (key) => watcher.dismiss(key),
keepGoing: () => watcher.keepGoing(),
+ dismissStop: () => watcher.dismissStop(),
open: (id) => goTo(`/note/${id}`),
os: process.platform,
})
diff --git a/app/src/main/prompts.ts b/app/src/main/prompts.ts
index b63c69ad..6de00def 100644
--- a/app/src/main/prompts.ts
+++ b/app/src/main/prompts.ts
@@ -10,17 +10,17 @@ import { activeMeeting, onMeetingStop } from './meeting'
const BACKGROUND = process.env.YOGURT_BACKGROUND === '1'
const ACTIONS: readonly string[] = ['take-notes', 'close', 'stop', 'keep-going'] satisfies PromptAction[]
-/** the card at the top right: small, frameless, on top of everything, never takes focus from what the person is doing */
+/** the card at the top right: small, frameless, on top of everything, appears without taking focus from what the person is doing */
function createCard(kind: PromptView['kind'], os = 'darwin'): BrowserWindow {
const { workArea } = screen.getPrimaryDisplay()
- const width = kind === 'start' ? 381 : 380, height = kind === 'start' ? 60 : 128
+ const width = 381, height = 60
const background = () => nativeTheme.shouldUseDarkColors ? '#29292B' : '#FFFFFF'
const type = floatingType(os)
const w = new BrowserWindow({
...(type ? { type } : {}),
width, height, x: workArea.x + workArea.width - width - 16, y: workArea.y + 12,
frame: false, resizable: false, movable: false, minimizable: false, maximizable: false, fullscreenable: false,
- skipTaskbar: true, focusable: false, acceptFirstMouse: true, show: false, hasShadow: true, roundedCorners: true,
+ skipTaskbar: true, focusable: kind === 'stop', acceptFirstMouse: true, show: false, hasShadow: true, roundedCorners: true,
backgroundColor: background(),
webPreferences: { preload: join(__dirname, '../preload/index.cjs'), sandbox: false, backgroundThrottling: false },
})
@@ -44,6 +44,7 @@ export function createPrompts(d: {
stop(meetingId: string): void
dismissed(key: string): void
keepGoing(): void
+ dismissStop(): void
/** show a meeting's note (clicking "Call ended") */
open(meetingId: string): void
/** the computer the card is made for (a tool window off a Mac) */
@@ -74,7 +75,8 @@ export function createPrompts(d: {
else d.dismissed(v.key)
} else if (activeMeeting()?.id === v.meetingId) {
if (action === 'stop') d.stop(v.meetingId)
- else d.keepGoing()
+ else if (action === 'close') d.dismissStop()
+ else if (action === 'keep-going') d.keepGoing()
}
}
const show = (v: PromptView) => {
diff --git a/app/src/main/watch.ts b/app/src/main/watch.ts
index 027f0edd..edd81999 100644
--- a/app/src/main/watch.ts
+++ b/app/src/main/watch.ts
@@ -47,6 +47,8 @@ export class Watcher {
dismiss(key: string) { this.dismissed.add(key); this.shown = null }
/** "Keep going": ask again in a while, not every tick */
keepGoing() { if (this.rec) this.rec.snoozeUntil = this.d.now() + SNOOZE; this.shown = null }
+ /** Close: no more stop questions during this recording. */
+ dismissStop() { if (this.rec) this.rec.snoozeUntil = Infinity; this.shown = null }
/** the card went away by an action, or a recording started or stopped (a resumed note is watched afresh) */
cleared() { this.shown = null; this.rec = null }
diff --git a/app/src/renderer/src/setup.css b/app/src/renderer/src/setup.css
index 5da2325f..cb37e4fd 100644
--- a/app/src/renderer/src/setup.css
+++ b/app/src/renderer/src/setup.css
@@ -69,20 +69,13 @@
.setup-status { display:flex;align-items:center;justify-content:center;gap:6px;font-variant-numeric:tabular-nums;color:var(--muted);font-size:11px;line-height:17px;text-align:center; }
.setup-status svg { flex:none; }
-.call-prompt { display:flex;flex-direction:column;justify-content:space-between;height:100%;padding:16px 17px;border:1px solid var(--line);border-radius:14px;background:var(--float);color:var(--ink); }
-.call-prompt[data-kind=start] { position:relative;overflow:hidden;flex-direction:row;align-items:center;gap:10px;padding:10px 12px;border-radius:18px; }
-.call-prompt[data-kind=start] .call-prompt-heading { flex:1; }
-.call-prompt[data-kind=start] .call-prompt-actions { flex:none;padding:0; }
-.call-prompt-heading { display:flex;align-items:center;gap:11px;min-width:0; }
-.call-prompt-logo { flex:none;color:var(--accent); }
-.call-prompt-label { font-size:13px;line-height:19px;font-weight:600;letter-spacing:-.1px;color:var(--ink); }
-.call-prompt-title { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;font-size:12px;line-height:18px;font-weight:400;color:var(--muted); }
-.call-prompt-actions { display:flex;align-items:center;justify-content:flex-end;gap:8px;padding-inline-start:39px; }
+.call-prompt { position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;height:100%;padding:10px 12px;overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--float);color:var(--ink); }
+.call-prompt-heading { display:flex;align-items:center;flex:1;gap:10px;min-width:0; }
+.call-prompt-label { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:19px;font-weight:600;letter-spacing:-.1px;color:var(--ink); }
+.call-prompt-title { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:12px;line-height:18px;font-weight:400;color:var(--muted); }
+.call-prompt-actions { display:flex;align-items:center;justify-content:flex-end;flex:none;gap:8px; }
/* The Dock asset includes its own transparent inset: 38px gives a 32px icon plate. */
.call-prompt-icon { width:38px;height:38px;margin:-3px;object-fit:contain;flex:none; }
-.call-prompt[data-kind=start] .call-prompt-heading { gap:10px; }
-.call-prompt[data-kind=start] .call-prompt-label { white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
-.call-prompt[data-kind=start] .call-prompt-title { margin:0; }
.call-prompt-countdown { position:absolute;inset:0 0 auto;height:2px;background:var(--accent);transform-origin:left;pointer-events:none;animation:call-countdown 12s linear forwards; }
.call-prompt[data-paused=true] .call-prompt-countdown { animation-play-state:paused; }
@keyframes call-countdown { to { transform:scaleX(0); } }
diff --git a/app/src/renderer/src/windows/Prompt.tsx b/app/src/renderer/src/windows/Prompt.tsx
index 41983ebf..7944d9ac 100644
--- a/app/src/renderer/src/windows/Prompt.tsx
+++ b/app/src/renderer/src/windows/Prompt.tsx
@@ -1,7 +1,6 @@
import { useEffect, useState } from 'react'
import { X } from 'lucide-react'
import type { PromptView } from '../../../shared/types'
-import { Logo } from '../components/Logo'
import { t } from '../../../shared/i18n'
import macIcon from '../../../../build/icon.png'
@@ -29,7 +28,7 @@ export function Prompt() {
onFocusCapture={() => setFocused(true)} onBlurCapture={e => { if (!e.currentTarget.contains(e.relatedTarget)) setFocused(false) }}>
{start && <span key={countdown} data-testid="prompt-countdown" className="call-prompt-countdown" aria-hidden="true" />}
<div className="call-prompt-heading">
- {start ? <img src={macIcon} alt="" className="call-prompt-icon" /> : <Logo size={28} className="call-prompt-logo" />}
+ <img src={macIcon} alt="" className="call-prompt-icon" />
<div className="min-w-0 flex-1">
<p data-testid="prompt-heading" className="call-prompt-label">{start ? t('Take notes?') : t('Stop recording?')}</p>
<p data-testid="prompt-title" className="call-prompt-title" title={view.title || name}>{name}</p>
@@ -51,11 +50,9 @@ export function Prompt() {
</>
)}
</div>
- {start && (
- <button data-testid="prompt-close" aria-label={t('Not now')} className="ghost-btn workspace-icon" onClick={() => window.yogurt.prompt.act('close')}>
- <X size={16} strokeWidth={1.5} aria-hidden="true" />
- </button>
- )}
+ <button data-testid={start ? 'prompt-close' : 'prompt-dismiss-stop'} aria-label={t(start ? 'Not now' : 'Close')} title={start ? undefined : t('Close')} className="ghost-btn workspace-icon" onClick={() => window.yogurt.prompt.act('close')}>
+ <X size={16} strokeWidth={1.5} aria-hidden="true" />
+ </button>
</div>
)
}
diff --git a/app/test/promptWindow.test.ts b/app/test/promptWindow.test.ts
index c9786782..83288554 100644
--- a/app/test/promptWindow.test.ts
+++ b/app/test/promptWindow.test.ts
@@ -32,21 +32,21 @@ beforeEach(async () => {
vi.stubEnv('YOGURT_BACKGROUND', '0'); vi.resetModules()
state.windows.length = 0; state.notices.length = 0; state.handlers.clear(); state.theme.clear(); state.dark = false
const { createPrompts } = await import('../src/main/prompts')
- prompts = createPrompts({windowVisible:()=>true,takeNotes:vi.fn(),stop:vi.fn(),dismissed:vi.fn(),keepGoing:vi.fn(),open:vi.fn()})
+ prompts = createPrompts({windowVisible:()=>true,takeNotes:vi.fn(),stop:vi.fn(),dismissed:vi.fn(),keepGoing:vi.fn(),dismissStop:vi.fn(),open:vi.fn()})
})
afterEach(() => { prompts.hide(); vi.unstubAllEnvs() })
-it('keeps the start offer in one compact row without changing the stop confirmation size', () => {
+it('gives both prompts the same compact frame and top-right placement', () => {
prompts.offer({key:'call',app:'Zoom',title:'Design review'} as any)
- expect(state.windows[0].options).toMatchObject({width:381,height:60,focusable:false,backgroundColor:'#FFFFFF'})
+ expect(state.windows[0].options).toMatchObject({width:381,height:60,x:803,y:12,focusable:false,backgroundColor:'#FFFFFF'})
prompts.askStop({id:'meeting',title:'Design review'} as any)
- expect(state.windows[1].options).toMatchObject({width:380,height:128})
+ expect(state.windows[1].options).toMatchObject({width:381,height:60,x:803,y:12,focusable:true})
})
it("a Mac's card is a plain window, as before; Windows and Linux make it a tool window that never takes focus", async () => {
prompts.offer({key:'call',app:'Zoom',title:''} as any)
expect(state.windows[0].options.type).toBeUndefined()
prompts.hide()
const { createPrompts } = await import('../src/main/prompts')
- const pc = createPrompts({windowVisible:()=>true,takeNotes:vi.fn(),stop:vi.fn(),dismissed:vi.fn(),keepGoing:vi.fn(),open:vi.fn(),os:'win32'})
+ const pc = createPrompts({windowVisible:()=>true,takeNotes:vi.fn(),stop:vi.fn(),dismissed:vi.fn(),keepGoing:vi.fn(),dismissStop:vi.fn(),open:vi.fn(),os:'win32'})
pc.offer({key:'call',app:'Zoom',title:''} as any)
expect(state.windows.at(-1).options).toMatchObject({type:'toolbar',focusable:false,skipTaskbar:true})
pc.hide()
@@ -70,12 +70,12 @@ async function recording() {
const store = openStore(':memory:')
meeting.initMeetings(store)
const m = meeting.startMeeting({ title: 'Review fixture', event: null, app: null })
- const stop = vi.fn(meeting.stopMeeting), keepGoing = vi.fn(), open = vi.fn()
+ const stop = vi.fn(meeting.stopMeeting), keepGoing = vi.fn(), dismissStop = vi.fn(), open = vi.fn()
const { createPrompts } = await import('../src/main/prompts')
prompts.hide()
- prompts = createPrompts({ windowVisible: () => false, takeNotes: vi.fn(), stop, dismissed: vi.fn(), keepGoing, open })
+ prompts = createPrompts({ windowVisible: () => false, takeNotes: vi.fn(), stop, dismissed: vi.fn(), keepGoing, dismissStop, open })
prompts.askStop(m)
- return { ...meeting, store, m, stop, keepGoing, open, card: state.windows.at(-1), notice: state.notices.at(-1) }
+ return { ...meeting, store, m, stop, keepGoing, dismissStop, open, card: state.windows.at(-1), notice: state.notices.at(-1) }
}
it('stopping by hand immediately closes the stop card and its native notification', async () => {
@@ -113,7 +113,7 @@ it('stopping a different stored recording leaves the active meeting card and not
} finally { r.store.close() }
})
-it.each(['stop', 'keep-going', 'notification'] as const)('a stale %s action just closes without stopping or snoozing another recording', async action => {
+it.each(['stop', 'keep-going', 'close', 'notification'] as const)('a stale %s action just closes without stopping or snoozing another recording', async action => {
const r = await recording()
try {
r.stopMeeting(r.m.id)
@@ -128,6 +128,7 @@ it.each(['stop', 'keep-going', 'notification'] as const)('a stale %s action just
expect(prompts.notice()).toBeNull()
expect(r.stop).not.toHaveBeenCalled()
expect(r.keepGoing).not.toHaveBeenCalled()
+ expect(r.dismissStop).not.toHaveBeenCalled()
expect(r.activeMeeting()?.id).toBe(next.id)
expect(r.store.meeting(r.m.id)?.state).toBe('stopped')
} finally { r.store.close() }
@@ -145,6 +146,7 @@ it('Stop on an already-ended meeting closes the stale card and leaves its summar
expect(notice.close).toHaveBeenCalledOnce()
expect(r.stop).not.toHaveBeenCalled()
expect(r.keepGoing).not.toHaveBeenCalled()
+ expect(r.dismissStop).not.toHaveBeenCalled()
expect(r.activeMeeting()).toBeNull()
expect(r.store.notes(r.m.id)).toMatchObject({ mine: 'Original notes', enhanced: 'Existing summary' })
} finally { r.store.close() }
@@ -174,3 +176,17 @@ it('preserves the informational call-ended notice after closing the obsolete sto
expect(r.stop).not.toHaveBeenCalled()
} finally { r.store.close() }
})
+
+it('Close hides the card and system notification without stopping or snoozing the recording', async () => {
+ const r = await recording()
+ try {
+ state.handlers.get('prompt:act')!({}, 'close')
+ expect(r.card.isDestroyed()).toBe(true)
+ expect(r.notice.close).toHaveBeenCalledOnce()
+ expect(prompts.notice()).toBeNull()
+ expect(r.dismissStop).toHaveBeenCalledOnce()
+ expect(r.stop).not.toHaveBeenCalled()
+ expect(r.keepGoing).not.toHaveBeenCalled()
+ expect(r.activeMeeting()?.id).toBe(r.m.id)
+ } finally { r.store.close() }
+})
diff --git a/app/test/watch.test.ts b/app/test/watch.test.ts
index 78483523..f3852295 100644
--- a/app/test/watch.test.ts
+++ b/app/test/watch.test.ts
@@ -372,3 +372,29 @@ describe('speech protects a call whose app released the mic', () => {
expect(log).toEqual([])
})
})
+
+
+it('Close suppresses every later stop question for this recording, but a new recording starts fresh', async () => {
+ active = meeting(); reading.micApps = [zoom]; await w.tick()
+ reading.micApps = []; clock += MIN; silent = MIN; await w.tick()
+ expect(log).toEqual(['stop'])
+ w.dismissStop()
+ for (const mins of [6, 20, 120]) { clock += mins * MIN; silent = mins * MIN; await w.tick() }
+ expect(log).toEqual(['stop'])
+ // Resumed speech and a later quiet spell do not undo Close.
+ reading.micApps = [zoom]; silent = 0; await w.tick()
+ reading.micApps = []; clock += 10 * MIN; silent = 10 * MIN; await w.tick()
+ expect(log).toEqual(['stop'])
+ active = null; w.cleared(); await w.tick()
+ active = meeting({ id: 'm2' }); reading.micApps = [zoom]; silent = 0; await w.tick()
+ reading.micApps = []; clock += MIN; silent = MIN; await w.tick()
+ expect(log).toEqual(['stop', 'stop'])
+})
+
+it('Close does not change automatic-stop rules when the setting is enabled later', async () => {
+ active = meeting(); auto = false; w = autoWatcher()
+ reading.micApps = [zoom]; await w.tick()
+ reading.micApps = []; clock += MIN; silent = MIN; await w.tick()
+ w.dismissStop(); auto = true; await w.tick()
+ expect(log).toEqual(['stop', 'auto:m1'])
+})