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.

animate icons and labels that change in place

Eric Brownroutbbdfed997972
diff --git a/app/src/renderer/src/components/AskConversation.tsx b/app/src/renderer/src/components/AskConversation.tsx
index d724f5d7..422b4124 100644
--- a/app/src/renderer/src/components/AskConversation.tsx
+++ b/app/src/renderer/src/components/AskConversation.tsx
@@ -16,6 +16,7 @@ import { ConversationActions } from './ConversationActions'
import { ScrollFade } from './ScrollFade'
import { rememberedScroll, useScrollMemory } from '../useScrollMemory'
import { AskContext, chipTitle } from './AskContext'
+import { Swap, SwapText } from './Swap'
const drafts = new Map<string, string>()
const starters = (chips: ContextTarget[], recording: boolean) => chips.length === 1 && chips[0].kind === 'meeting'
@@ -236,7 +237,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))
- }}>{copied ? <Check size={13} /> : <Copy size={13} />}<span>{copied ? t('Copied') : t('Copy')}</span></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><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/components/MicMenu.tsx b/app/src/renderer/src/components/MicMenu.tsx
index cdcdd190..6f1cebb0 100644
--- a/app/src/renderer/src/components/MicMenu.tsx
+++ b/app/src/renderer/src/components/MicMenu.tsx
@@ -4,6 +4,7 @@ import { Pause } from './Icons'
import type { MicsView } from '../../../shared/types'
import { t } from '../../../shared/i18n'
import { osWords } from '../keys'
+import { Swap } from './Swap'
const autoInfo = () => osWords({ mac: t('Uses the microphone your Mac is set to'), other: t('Uses the microphone your computer is set to') })
@@ -83,7 +84,7 @@ export function MicMenu({ recording, paused }: { recording: boolean; paused?: bo
<button ref={button} data-testid="rec-mic-chip" aria-haspopup="menu" aria-expanded={!!open} title={t('Microphone')}
onClick={(e) => setOpen((o) => o ? false : e.detail > 0 ? 'pointer' : 'keyboard')}
className="bar-btn flex max-w-[220px] items-center gap-1.5 rounded-md px-1.5 py-0.5 hover:text-ink aria-expanded:text-ink">
- {paused ? <Pause size={11} fill="currentColor" strokeWidth={0} aria-hidden="true" className="shrink-0" /> : <Mic size={11} aria-hidden="true" className="shrink-0" />}
+ <Swap show={paused ? 'paused' : 'mic'} options={{ mic: <Mic size={11} />, paused: <Pause size={11} fill="currentColor" strokeWidth={0} /> }} />
<span data-testid="rec-mic" className="truncate">{paused ? t('Recording paused') : name}</span>
<ChevronDown size={11} aria-hidden="true" className="shrink-0" />
</button>
diff --git a/app/src/renderer/src/components/Player.tsx b/app/src/renderer/src/components/Player.tsx
index fc4b18d2..a3a702ef 100644
--- a/app/src/renderer/src/components/Player.tsx
+++ b/app/src/renderer/src/components/Player.tsx
@@ -2,6 +2,7 @@ import { useEffect, useImperativeHandle, useRef, useState, type Ref } from 'reac
import { Pause, Play } from 'lucide-react'
import { language, t } from '../../../shared/i18n'
import { clock } from '../../../shared/transcript'
+import { Swap } from './Swap'
type Track = 'me' | 'them'
export type PlayerHandle = { playFrom: (ms: number) => void }
@@ -119,7 +120,7 @@ function MeetingPlayer({ id, tracks, ref, onTime, onPlaying }: PlayerProps) {
<div className="flex items-center gap-2.5">
<button data-testid="player-toggle" aria-label={playing ? t('Pause') : t('Play')} onClick={() => (playing ? pause() : play())}
className="player-btn flex size-7 shrink-0 items-center justify-center rounded-md bg-accent text-accent-ink">
- {playing ? <Pause size={13} fill="currentColor" strokeWidth={0} aria-hidden="true" /> : <Play size={13} fill="currentColor" strokeWidth={0} aria-hidden="true" className="ms-0.5" />}
+ <Swap show={playing ? 'pause' : 'play'} options={{ play: <Play size={13} fill="currentColor" strokeWidth={0} className="ms-0.5" />, pause: <Pause size={13} fill="currentColor" strokeWidth={0} /> }} />
</button>
<span className="w-9 shrink-0 text-end tabular-nums">{clock(time * 1000)}</span>
<input data-testid="player-scrubber" type="range" min={0} max={duration || 0} step={0.1} value={Math.min(time, duration || 0)} aria-label={t('Position')}
diff --git a/app/src/renderer/src/components/ShareMenu.tsx b/app/src/renderer/src/components/ShareMenu.tsx
index d0547f73..873caf8b 100644
--- a/app/src/renderer/src/components/ShareMenu.tsx
+++ b/app/src/renderer/src/components/ShareMenu.tsx
@@ -5,6 +5,7 @@ import { t } from '../../../shared/i18n'
import { command, onMac } from '../keys'
import { shareTarget } from '../../../shared/exportNotes'
import type { NoteStatus } from '../../../shared/types'
+import { Swap } from './Swap'
type Feedback = { text: string; kind: 'copied' | 'saved' | 'notice' | 'error' }
@@ -87,7 +88,7 @@ export function ShareMenu({ id, shown, status, hasEnhanced, beforeUse }: { id: s
</span>
<button ref={button} data-testid="share-button" data-state={copied ? 'copied' : 'idle'} aria-haspopup="menu" aria-expanded={!!open} title={t('Copy and export')}
onClick={(e) => setOpen((o) => o ? false : e.detail > 0 ? 'pointer' : 'keyboard')} className="note-record-action share-btn">
- {copied ? <Check size={13} strokeWidth={1.75} aria-hidden="true" /> : <Copy size={13} strokeWidth={1.75} aria-hidden="true" />}{t('Copy')}
+ <Swap show={copied ? 'done' : 'copy'} options={{ copy: <Copy size={13} strokeWidth={1.75} />, done: <Check size={13} strokeWidth={1.75} /> }} />{t('Copy')}
<ChevronDown size={12} strokeWidth={1.75} aria-hidden="true" />
</button>
{open && (
diff --git a/app/src/renderer/src/components/Swap.tsx b/app/src/renderer/src/components/Swap.tsx
new file mode 100644
index 00000000..eca63b3b
--- /dev/null
+++ b/app/src/renderer/src/components/Swap.tsx
@@ -0,0 +1,19 @@
+import { useEffect, useRef, type ReactNode } from 'react'
+
+/**
+ * Icons that change in place: every option shares one grid cell, so nothing around it moves, and only the current
+ * one shows. The one leaving shrinks, softens and fades while the next grows in (scaled on the wrapper, never the
+ * svg, so the icon stays crisp).
+ */
+export function Swap<K extends string>({ show, options, className }: { show: K; options: Record<K, ReactNode>; className?: string }) {
+ return <span className={`swap ${className ?? ''}`} aria-hidden="true">
+ {(Object.keys(options) as K[]).map(key => <span key={key} data-on={key === show}>{options[key]}</span>)}
+ </span>
+}
+
+/** A label that changes in place: the new words soften in, and `widest` holds the width so the label never shifts. */
+export function SwapText({ text, widest }: { text: string; widest?: string }) {
+ const mounted = useRef(false)
+ useEffect(() => { mounted.current = true }, [])
+ return <span className="swap-text" data-widest={widest}><span key={text} className={mounted.current ? 'swap-in' : undefined}>{text}</span></span>
+}
diff --git a/app/src/renderer/src/components/Transcript.tsx b/app/src/renderer/src/components/Transcript.tsx
index 5638f818..969a5c2e 100644
--- a/app/src/renderer/src/components/Transcript.tsx
+++ b/app/src/renderer/src/components/Transcript.tsx
@@ -5,7 +5,7 @@ import { Loading } from './Loading'
import { useLoadingState } from '../useLoadingState'
import { Fragment, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type KeyboardEvent, type MouseEvent } from 'react'
import { createPortal } from 'react-dom'
-import { AudioLines, ArrowDown, ArrowUp, ChevronDown, Search as SearchIcon } from 'lucide-react'
+import { AudioLines, ArrowDown, ChevronDown, Search as SearchIcon } from 'lucide-react'
import type { Segment, TranscriptPartial } from '../../../shared/types'
import { t } from '../../../shared/i18n'
import { useLanguage } from '../i18n'
@@ -424,7 +424,7 @@ export function Transcript({ id, recording, inline = false, active = true, onClo
)}
{!recording && audioOn && away && playingShown && (
<button data-testid="transcript-follow" onClick={backToPlaying} className="absolute bottom-3 start-1/2 flex -translate-x-1/2 items-center gap-1 rounded-md border border-line bg-float px-3 py-1 text-xs shadow-[var(--shadow)] rtl:translate-x-1/2">
- {away === 'up' ? <ArrowUp size={12} aria-hidden="true" /> : <ArrowDown size={12} aria-hidden="true" />}{t('Back to playing')}
+ <ArrowDown size={12} aria-hidden="true" className="follow-arrow" data-up={away === 'up'} />{t('Back to playing')}
</button>
)}
</div>
diff --git a/app/src/renderer/src/screens/Note.tsx b/app/src/renderer/src/screens/Note.tsx
index b2b50e3e..f8651523 100644
--- a/app/src/renderer/src/screens/Note.tsx
+++ b/app/src/renderer/src/screens/Note.tsx
@@ -35,6 +35,7 @@ import { RecordingHint } from '../components/RecordingHint'
import { FolderChip, FolderPicker, type FolderSuggestion } from '../components/FolderPicker'
import { FolderName } from '../components/FolderDialogs'
import { InlineError } from '../components/InlineError'
+import { Swap, SwapText } from '../components/Swap'
/** A revision is dirty until main acknowledges it; failed text also remains there across navigation/reload. */
function useAutosave(id: string, side: NoteSide, text: string, saved?: NoteSaveResult) {
@@ -325,7 +326,7 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource }: {
</span>
<button data-testid="note-pause" disabled={pausing} onClick={() => { void togglePause() }}
aria-label={m.paused ? t('Resume recording') : t('Pause recording')} title={m.paused ? t('Resume recording') : t('Pause recording')} className="note-record-action note-pause-action">
- {m.paused ? <Play size={14} fill="currentColor" strokeWidth={0} aria-hidden="true" /> : <Pause size={14} fill="currentColor" strokeWidth={0} aria-hidden="true" />}
+ <Swap show={m.paused ? 'play' : 'pause'} options={{ pause: <Pause size={14} fill="currentColor" strokeWidth={0} />, play: <Play size={14} fill="currentColor" strokeWidth={0} /> }} />
</button>
<button data-testid="note-stop" onClick={(e) => { requestFinish(true); picked.current = true; setView('mine'); setFinishing(true); setTabPointer(e.detail > 0); window.yogurt.meetings.stop(id) }} aria-label={t('Finish recording')} title={t('Finish recording')} className="note-record-action note-finish-action primary">
{t('Finish')}
@@ -334,8 +335,8 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource }: {
{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')}>
- {summarizing ? <Loader size={14} aria-hidden="true" /> : <Mic size={14} aria-hidden="true" />}
- <span>{summarizing ? t('Summarizing…') : starting ? t('Preparing…') : t('Resume recording')}</span>
+ <Swap show={summarizing ? 'busy' : 'mic'} options={{ mic: <Mic size={14} />, busy: <Loader size={14} /> }} />
+ <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">
<Mic size={14} strokeWidth={1.75} aria-hidden="true" />{starting ? t('Starting…') : t('Start recording')}
diff --git a/app/src/renderer/src/screens/Settings.tsx b/app/src/renderer/src/screens/Settings.tsx
index 9cbd4560..bd785cd0 100644
--- a/app/src/renderer/src/screens/Settings.tsx
+++ b/app/src/renderer/src/screens/Settings.tsx
@@ -13,6 +13,7 @@ import { useScrollMemory } from '../useScrollMemory'
import { appShortcuts } from '../components/Shortcuts'
import { CalendarSettings } from '../components/CalendarSettings'
import { supportedKinds } from '../../../shared/platform'
+import { Swap, SwapText } from '../components/Swap'
const THEMES = () => [['system', osWords({ mac: t('Match my Mac'), windows: t('Match Windows'), linux: t('Match my system') })], ['light', t('Light')], ['dark', t('Dark')]] as const
// each computer's own words for starting at login and its icon's place: the menu bar, the notification area, the tray
@@ -309,7 +310,7 @@ function AiApps() {
<div className="mt-3 flex min-w-0 items-center gap-2 rounded-md border border-line bg-bg p-1.5">
<input data-testid="ai-apps-command" aria-label={t('MCP command')} dir="ltr" readOnly value={status.command} className="min-w-0 flex-1 bg-transparent px-2 font-mono text-[12px] text-muted" />
<button data-testid="ai-apps-copy" onClick={copy} className="workspace-button shrink-0">
- {copied ? <Check size={14} aria-hidden="true" className="text-muted" /> : <Copy size={14} aria-hidden="true" className="text-muted" />}{copied ? t('Copied') : t('Copy')}
+ <Swap show={copied ? 'done' : 'copy'} options={{ copy: <Copy size={14} className="text-muted" />, done: <Check size={14} className="text-muted" /> }} /><SwapText text={copied ? t('Copied') : t('Copy')} widest={t('Copied')} />
</button>
</div>
{status.clients.length > 0 && <p data-testid="ai-apps-clients" aria-live="polite" className="mt-3 text-[12px] leading-[18px] text-muted">
diff --git a/app/src/renderer/src/styles.css b/app/src/renderer/src/styles.css
index 6e1013ae..18ea7384 100644
--- a/app/src/renderer/src/styles.css
+++ b/app/src/renderer/src/styles.css
@@ -300,6 +300,18 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
animation: caret-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes caret-pulse { 50% { opacity: 0.35; } }
+/* Swap (components/Swap.tsx): icons and labels that change in place */
+.swap { display:inline-grid;place-items:center;flex:none; }
+.swap>* { grid-area:1/1;display:inline-flex;transition:opacity 180ms cubic-bezier(.22,1,.36,1),filter 180ms cubic-bezier(.22,1,.36,1),transform 240ms cubic-bezier(.34,1.3,.64,1); }
+.swap>[data-on=false] { opacity:0;filter:blur(2px);transform:scale(.4);pointer-events:none; }
+.swap-text { display:inline-grid; }
+.swap-text>*,.swap-text::after { grid-area:1/1; }
+.swap-text[data-widest]::after { content:attr(data-widest);visibility:hidden;height:0;overflow:hidden; }
+.swap-in { animation:swap-in 200ms cubic-bezier(.22,1,.36,1) both; }
+@keyframes swap-in { from { opacity:0;filter:blur(2px); } }
+.follow-arrow { transition:transform 240ms cubic-bezier(.34,1.3,.64,1); }
+.follow-arrow[data-up=true] { transform:rotate(180deg); }
+@media (prefers-reduced-motion:reduce) { .swap>*,.swap-in,.follow-arrow { transition:none;animation:none; } }
/* before the first word the summary is one empty paragraph, whose placeholder line break would push the dot down a line */
.streaming .note-prose > :last-child > br.ProseMirror-trailingBreak:only-child { display: none; }
.chat-answer > * + * { margin-top: 0.45em; }
diff --git a/app/src/renderer/src/windows/Widget.tsx b/app/src/renderer/src/windows/Widget.tsx
index cbcf17f5..daa6dbb9 100644
--- a/app/src/renderer/src/windows/Widget.tsx
+++ b/app/src/renderer/src/windows/Widget.tsx
@@ -12,6 +12,7 @@ import { LevelBars } from '../components/LevelBars'
import { LiveWords } from '../components/Transcript'
import { glide } from '../motion'
import { afterFinal, joinWords } from '../../../shared/liveWords'
+import { Swap } from '../components/Swap'
function useElapsed(v: WidgetView | null): string {
const [text, setText] = useState('0:00')
@@ -135,7 +136,7 @@ function Recording({ view, cardRef }: { view: WidgetView; cardRef: React.RefObje
<div ref={cardRef} data-testid="widget" data-kind="recording" role="button" tabIndex={0} className="widget-pill widget-strip grid h-[42px] w-max min-w-[127px] shrink-0 cursor-pointer select-none items-center gap-3 rounded-[10px] px-3 text-[var(--pill-ink)]"
{...press} onPointerEnter={hover.enter} onPointerLeave={hover.leave}
aria-label={t('Open {title}', { title: view.title })} title={note?.text ?? t('Recording {title}', { title: view.title })}>
- {note ? <TriangleAlert data-testid="widget-warning" size={18} className="shrink-0 text-[var(--pill-accent)]" aria-label={note.text} /> : <Logo size={18} className="shrink-0 text-[var(--pill-accent)]" />}
+ <Swap show={note ? 'warning' : 'logo'} className="text-[var(--pill-accent)]" options={{ logo: <Logo size={18} />, warning: <TriangleAlert data-testid="widget-warning" size={18} /> }} />
<LevelBars testId="widget-wave" height={16} className="justify-self-center text-[var(--pill-accent)]" />
<span data-testid="widget-time" className="min-w-[32px] shrink-0 whitespace-nowrap text-end text-[10px] font-medium tabular-nums opacity-80">
{time}