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
Onboarding: each permission shows the sound it controls
Eric Brownrout38f786d9419b
diff --git a/app/e2e/onboarding.spec.ts b/app/e2e/onboarding.spec.tsindex ec7eaee5..777ab8e9 100644--- a/app/e2e/onboarding.spec.ts+++ b/app/e2e/onboarding.spec.ts@@ -179,9 +179,21 @@ test('every permission step leads with what it gives, Allow asks the Mac, and Ac// the picture: you through the mic, the others through the Mac's soundawait expect(page.getByTestId('record-art')).toContainText('You')await expect(page.getByTestId('record-art')).toContainText('Everyone else')+ const lanes = page.getByTestId('record-art').locator('.ob-lane')+ const myMeter = lanes.nth(0).locator('.ob-wave i').first()+ const otherMeter = lanes.nth(1).locator('.ob-wave i').first()+ const quietTile = await lanes.nth(0).locator('.ob-lane-icon').evaluate(el => getComputedStyle(el).backgroundColor)+ await page.emulateMedia({ reducedMotion: 'no-preference' })+ await expect(myMeter).toHaveCSS('animation-name', 'ob-speech')+ await expect(otherMeter).toHaveCSS('animation-name', 'none')await page.getByTestId('step-allow').click()await expect(step).toHaveAttribute('data-kind', 'systemAudio')await expect(page.getByTestId('step-title')).toHaveText('Call audio')+ await expect(lanes.nth(0).locator('.ob-lane-icon')).toHaveCSS('background-color', quietTile)+ await expect(myMeter).toHaveCSS('animation-name', 'none')+ await expect(otherMeter).toHaveCSS('animation-name', 'ob-speech')+ await page.emulateMedia({ reducedMotion: 'reduce' })+ await expect(otherMeter).toHaveCSS('animation-name', 'none')await expect(page.getByTestId('step-reason')).toHaveText('The permission may mention your screen. Only sound is recorded to transcribe the other speakers.')expect(await fake(app, 'permissions')).toMatchObject({ mic: 'granted', systemAudio: 'unknown' })for (const kind of ['systemAudio', 'calendar', 'notifications']) {diff --git a/app/src/renderer/src/components/OnboardingArt.tsx b/app/src/renderer/src/components/OnboardingArt.tsxindex a850dcee..27af9cd8 100644--- a/app/src/renderer/src/components/OnboardingArt.tsx+++ b/app/src/renderer/src/components/OnboardingArt.tsx@@ -1,6 +1,5 @@-import { AudioLines, CalendarDays, Check, Mic, PhoneOff, Plus, Video, X } from 'lucide-react'+import { AudioLines, CalendarDays, Mic, PhoneOff, Plus, Video, X } from 'lucide-react'import type { PermissionKind } from '../../../shared/types'-import type { ScreenId } from '../../../shared/onboarding'import { Logo } from './Logo'import { t } from '../../../shared/i18n'import { RecordingPill } from './RecordingPill'@@ -40,18 +39,19 @@ export function WelcomeArt() {return <div className="ob-scene ob-conversation"><CallWindow welcome /></div>}-/** The picture of one permission screen; on: what is turned on so far */-export function ScreenArt({ id, on }: { id: ScreenId; on: readonly PermissionKind[] }) {- switch (id) {- case 'record': return <RecordArt on={on} />+/** The picture explains the current permission. Permission status is in the step text. */+export function ScreenArt({ kind }: { kind: PermissionKind }) {+ switch (kind) {+ case 'mic':+ case 'systemAudio': return <RecordArt active={kind} />case 'calendar': return <CalendarArt />case 'notifications': return <NoticeArt />case 'accessibility': return <SpeakerNamesArt />}}-/** The two things Yogurt hears: you through the mic, everyone else through the Mac's sound. Each comes alive once it is on. */-function RecordArt({ on }: { on: readonly PermissionKind[] }) {+/** The five bars match the website’s per-speaker meter. Only the source being explained speaks. */+function RecordArt({ active }: { active: 'mic' | 'systemAudio' }) {const lanes = [{ kind: 'mic' as const, Icon: Mic, who: t('You'), from: t('Microphone') },{ kind: 'systemAudio' as const, Icon: AudioLines, who: t('Everyone else'), from: t("Your Mac's sound") },@@ -60,18 +60,17 @@ function RecordArt({ on }: { on: readonly PermissionKind[] }) {<div data-testid="record-art" className="ob-scene"><div className="ob-card ob-record">{lanes.map(({ kind, Icon, who, from }, i) => (- <div key={kind} className="ob-lane" data-on={on.includes(kind)} style={d(i)}>+ <div key={kind} className="ob-lane" data-active={kind === active} data-channel={kind} style={d(i)}><span className="ob-lane-icon"><Icon size={15} strokeWidth={1.9} /></span><span className="ob-lane-copy"><span className="ob-lane-who">{who}</span><span className="ob-lane-from">{from}</span></span>- <span className="ob-wave">{WAVE.map((h, j) => <i key={j} style={{ ['--h' as string]: h, ['--j' as string]: j + i * 3 }} />)}</span>- <span className="ob-lane-state"><Check size={11} strokeWidth={3} /></span>+ <span className="ob-wave">{[.54, .8, 1, .72, .42].map((peak, j) =>+ <i key={j} style={{ ['--peak' as string]: peak, ['--lag' as string]: `${-j * 30}ms` }} />)}</span></div>))}</div></div>)}-const WAVE = [.35, .6, .9, .55, .75, 1, .65, .4, .8, .5, .95, .6, .3, .7, .45, .85, .5, .65]/** A day in the calendar, and the note that already knows the meeting's name and who's in it */function CalendarArt() {diff --git a/app/src/renderer/src/screens/Onboarding.tsx b/app/src/renderer/src/screens/Onboarding.tsxindex 1ee0b513..f3db8725 100644--- a/app/src/renderer/src/screens/Onboarding.tsx+++ b/app/src/renderer/src/screens/Onboarding.tsx@@ -116,7 +116,7 @@ function CalendarLinkScreen({ state, progress, onNext }: { state: SetupState; prreturn (<LayouttestId="onboarding-step" step="calendar" kind="calendar" motionKey={connected ? 'calendar-done' : 'calendar'}- art={<ScreenArt id="calendar" on={connected ? ['calendar'] : []} />} progress={progress} state={state}+ art={<ScreenArt kind="calendar" />} progress={progress} state={state}title={connected ? t('All set') : t('Connect your calendar')}text={connected ? t('{name} is connected. You can change this any time in Settings.', { name: connected }) : sc.text}actions={connected@@ -130,21 +130,18 @@ function CalendarLinkScreen({ state, progress, onNext }: { state: SetupState; pr/** Recording permissions share one progress segment. Each native request needs its own Allow press. */function PermissionScreen({ screen, state, progress, onNext }: { screen: OnboardingScreen; state: SetupState; progress: Progress; onNext(): void }) {const [k, setK] = useState(0)- // what the picture shows as on: whatever this screen didn't need to ask, and whatever was turned on here- const [lit, setLit] = useState<PermissionKind[]>(() => screen.kinds.filter((x) => !screen.steps.some((s) => s.kind === x)))const [leaving, setLeaving] = useState(false)const step = screen.steps[k]const on = () => {- setLit((l) => [...l, step.kind])if (k + 1 < screen.steps.length) { setK(k + 1); return }- // a picture that shows what is on stays a moment, so the person sees it come alive+ // Keep the existing transition out of the grouped recording step.if (screen.kinds.length > 1) { setLeaving(true); setTimeout(onNext, 700) } else onNext()}- return <Ask key={step.kind} screen={screen} step={step} lit={lit} leaving={leaving} state={state} progress={progress} onOn={on} onLater={onNext} />+ return <Ask key={step.kind} screen={screen} step={step} leaving={leaving} state={state} progress={progress} onOn={on} onLater={onNext} />}-function Ask({ screen, step, lit, leaving, state, progress, onOn, onLater }: {- screen: OnboardingScreen; step: OnboardingStep; lit: PermissionKind[]; leaving: boolean; state: SetupState; progress: Progress; onOn(): void; onLater(): void+function Ask({ screen, step, leaving, state, progress, onOn, onLater }: {+ screen: OnboardingScreen; step: OnboardingStep; leaving: boolean; state: SetupState; progress: Progress; onOn(): void; onLater(): void}) {const { kind } = stepconst c = permissionCopy(kind)@@ -162,7 +159,7 @@ function Ask({ screen, step, lit, leaving, state, progress, onOn, onLater }: {: flow.phase === 'idle' && denied ? <p data-testid="step-access-status" role="status" className="ob-note">{t('This was turned off before, so only System Settings can turn it on. Yogurt shows you where.')}</p>: null// the picture changes only when there is a new thing to show: System Settings, or the screen's own drawing- const art = away ? <SettingsArt kind={kind} /> : <ScreenArt id={screen.id} on={back ? [...lit, kind] : lit} />+ const art = away ? <SettingsArt kind={kind} /> : <ScreenArt kind={kind} />return (<LayouttestId="onboarding-step" step={screen.id} kind={kind} motionKey={away ? `${screen.id}-away` : screen.id}diff --git a/app/src/renderer/src/setup.css b/app/src/renderer/src/setup.cssindex 19a9f0b7..57658e8c 100644--- a/app/src/renderer/src/setup.css+++ b/app/src/renderer/src/setup.css@@ -241,20 +241,41 @@.ob[data-step=welcome] :is(.ob-copy,.ob-stage-art) { animation:none; }.ob[data-step=welcome] .ob-title,.ob[data-step=welcome] .ob-text { min-height:0; }-/* the mic and the call audio: two lanes that come alive once on */+/* the mic and the call audio: only the source being explained speaks */.ob-record { display:flex;flex-direction:column;gap:8px;padding:10px; }-.ob-lane { display:grid;grid-template-columns:34px minmax(0,1fr) auto 18px;align-items:center;gap:12px;height:64px;padding-inline:12px 14px;border-radius:10px;background:var(--card);animation:ob-rise 480ms cubic-bezier(.23,1,.32,1) both;animation-delay:calc(var(--i,0) * 140ms + 150ms); }-.ob-lane-icon { display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:var(--float);box-shadow:inset 0 0 0 1px var(--line);color:var(--muted);transition:background-color 300ms ease,color 300ms ease,box-shadow 300ms ease; }-.ob-lane[data-on=true] .ob-lane-icon { background:var(--primary);color:#fff;box-shadow:inset 0 1px 0 #FFFFFF40,0 2px 6px -2px #6F00FF80; }+.ob-lane { display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:12px;height:64px;padding-inline:12px 14px;border-radius:10px;background:var(--card);animation:ob-rise 480ms cubic-bezier(.23,1,.32,1) both;animation-delay:calc(var(--i,0) * 140ms + 150ms); }+.ob-lane-icon { display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:var(--float);box-shadow:inset 0 0 0 1px var(--line);color:var(--muted); }.ob-lane-copy { display:flex;flex-direction:column;min-width:0; }.ob-lane-who { font-size:13px;line-height:18px;font-weight:600;color:var(--ink); }.ob-lane-from { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:15px;color:var(--muted); }-.ob-wave { display:flex;align-items:center;gap:2.5px;height:26px; }-.ob-wave i { width:2.5px;height:24px;border-radius:2px;background:var(--control-pressed);transform:scaleY(.125);transition:background-color 300ms ease; }-.ob-lane[data-on=true] .ob-wave i { transform:scaleY(var(--h));background:var(--accent);animation:ob-wave 900ms ease-in-out infinite alternate;animation-delay:calc(var(--j) * -110ms); }-@keyframes ob-wave { from { transform:scaleY(calc(var(--h) * .3)); } to { transform:scaleY(var(--h)); } }-.ob-lane-state { display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--control);color:transparent;transition:background-color 300ms ease,color 300ms ease; }-.ob-lane[data-on=true] .ob-lane-state { background:var(--accent-soft);color:var(--accent); }+.ob-wave { display:flex;align-items:center;justify-self:end;gap:3px;height:24px; }+.ob-wave i { width:3px;height:22px;border-radius:3px;background:var(--control-pressed);transform:scaleY(.136364); }+.ob-lane[data-active=true] .ob-wave i { background:var(--accent);transform:scaleY(calc(.136364 + var(--peak) * .65)); }+/* Recorded loudness from the site’s speech-data.json, every 80 ms. The zero tail leaves a pause at the loop seam. */+.ob-lane[data-channel=mic] {+ --phrase-duration:5600ms;+ --phrase:linear(+ 0, 0, 0, 0, .17, .7, .81, .73, .54, .33, .2, .12,+ .18, .67, .78, .52, .38, .66, .52, .76, .87, .94, .86, .7,+ .44, .27, .16, .13, .63, .87, .94, .78, .77, .87, .92, .82,+ .82, .7, .77, .84, .91, .85, .6, .46, .74, .85, .79, .68,+ .88, .93, .8, .54, .35, .64, .88, .88, .68, .42, .25, .15,+ .09, .06, .03, 0, 0, 0, 0, 0, 0, 0, 0+ );+}+.ob-lane[data-channel=systemAudio] {+ --phrase-duration:3680ms;+ --phrase:linear(+ 0, .03, .02, .18, .65, .74, .66, .42, .25, .15, .09, .26,+ .74, .88, .84, .65, .81, .83, .8, .93, .96, .89, .92, .89,+ .96, .8, .72, .87, .83, .71, .47, .29, .19, .11, .07, .04,+ .03, .02, .16, 0, 0, 0, 0, 0, 0, 0, 0+ );+}+@media (prefers-reduced-motion: no-preference) {+ .ob-lane[data-active=true] .ob-wave i { animation:ob-speech var(--phrase-duration) var(--phrase) var(--lag) infinite; }+}+@keyframes ob-speech { from { transform:scaleY(.136364); } to { transform:scaleY(calc(.136364 + var(--peak) * .863636)); } }/* calendar: the day, and the note that knows the meeting */.ob-calendar { display:block;height:300px; }@@ -367,8 +388,8 @@}@media (prefers-reduced-motion: reduce) {.ob-copy,.ob-stage-art { animation:motion-fade var(--dur-micro) var(--ease-out); }- .boot-band,.ob-turn,.ob-lane,.ob-meeting-note,.ob-people li,.ob-prompt,.ob-rec-dot,.ob-settings-yogurt,.ob-lane[data-on=true] .ob-wave i { animation:none; }- .ob-button,.ob-steps span,.ob-lane-icon,.ob-wave i,.ob-lane-state,.ob-progress-fill { transition:none; }+ .boot-band,.ob-lane,.ob-meeting-note,.ob-people li,.ob-prompt,.ob-rec-dot,.ob-settings-yogurt { animation:none; }+ .ob-button,.ob-steps span,.ob-progress-fill { transition:none; }/* the end of each story, still */.ob-swap-from { animation:none;opacity:0; }.ob-swap-to { animation:none;opacity:1;filter:none; }diff --git a/app/test/onboardingLevels.test.ts b/app/test/onboardingLevels.test.tsnew file mode 100644index 00000000..5c270d10--- /dev/null+++ b/app/test/onboardingLevels.test.ts@@ -0,0 +1,12 @@+import { createElement } from 'react'+import { renderToStaticMarkup } from 'react-dom/server'+import { expect, it } from 'vitest'+import { ScreenArt } from '../src/renderer/src/components/OnboardingArt'++it.each(['mic', 'systemAudio'] as const)('illustrates only the %s channel', kind => {+ const html = renderToStaticMarkup(createElement(ScreenArt, { kind }))+ const lanes = Array.from(html.matchAll(/class="ob-lane" data-active="(\w+)" data-channel="(\w+)"/g), m => m.slice(1))+ expect(lanes).toEqual(['mic', 'systemAudio'].map(channel => [String(channel === kind), channel]))+ expect(html.match(/<i style=/g)).toHaveLength(10)+ expect(html).not.toMatch(/ob-lane-state|data-on=|lucide-check/)+})