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
Sidebar: collapsing and expanding works as before; only its hover icons stay still
Eric Brownrout1987d47a164b
diff --git a/app/e2e/sidebarMotion.spec.ts b/app/e2e/sidebarMotion.spec.tsindex dc3e2fcb..ec144a49 100644--- a/app/e2e/sidebarMotion.spec.ts+++ b/app/e2e/sidebarMotion.spec.ts@@ -40,26 +40,22 @@ test('sidebar reveal keeps its toggle anchored and can reverse before it finisheconst toggle = page.locator('.workspace-sidebar-toggle')const content = page.locator('.workspace-content')const gap = page.locator('.workspace-sidebar-gap')- const sidebar = page.locator('.workspace-sidebar')const before = await toggle.boundingBox()// Establish the initial style, then hold a long transition so CI cannot miss its first frame.- const motionStyle = await page.addStyleTag({ content: '.workspace-sidebar { transition-duration:60s!important; }' })- await sidebar.evaluate(async () => {+ const motionStyle = await page.addStyleTag({ content: '.workspace-sidebar-gap { transition-duration:60s!important; }' })+ await gap.evaluate(async () => {await new Promise<void>(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve())))})await toggle.click()await expect(toggle).toHaveAttribute('aria-expanded', 'false')expect((await toggle.boundingBox())!.x).toBe(before!.x)- await expect.poll(() => sidebar.evaluate((el) => {+ await expect.poll(() => gap.evaluate((el) => {const animation = el.getAnimations().find(a => a instanceof CSSTransition && a.transitionProperty === 'width')if (!animation) return falseanimation.pause(); animation.currentTime = 18_000return true})).toBe(true)- const midway = await sidebar.evaluate(el => el.getBoundingClientRect().width)- expect(await gap.evaluate(el => el.getBoundingClientRect().width)).toBe(56)- expect(await gap.evaluate(el => el.getAnimations().length)).toBe(0)- expect((await content.boundingBox())!.x).toBe(56)+ const midway = await gap.evaluate(el => el.getBoundingClientRect().width)expect(midway).toBeGreaterThan(56)expect(midway).toBeLessThan(208)await motionStyle.evaluate(el => { el.parentNode?.removeChild(el) })@@ -118,8 +114,8 @@ for (const reducedTransparency of ['no-preference', 'reduce']) test(`titlebar chawait page.getByTestId('past-note').click()await expect(page.getByTestId('note')).toBeVisible()const cdp = await page.context().newCDPSession(page)- await expect(page.locator('.workspace-sidebar')).toHaveCSS('border-inline-end-color', 'rgba(0, 0, 0, 0)')- expect(await page.locator('.workspace-sidebar-gap').evaluate(el => getComputedStyle(el, '::after').top)).toBe('52px')+ const divider = await page.locator('.workspace-sidebar').evaluate(el => ({ border: getComputedStyle(el).borderInlineEndColor, start: getComputedStyle(el, '::after').top }))+ expect(divider).toEqual({ border: 'rgba(0, 0, 0, 0)', start: '52px' })for (const colorScheme of ['light', 'dark'] as const) {await cdp.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: colorScheme },@@ -208,7 +204,7 @@ test('keyboard, reduced motion and narrow-window sidebar changes remain immediat} finally { await app.close() }})-test('a note adopts its final layout once and stays still throughout both sidebar directions', async () => {+test('a note keeps its title, transcript and controls in place at the start of both sidebar directions', async () => {const { app, page } = await launch()try {await app.evaluate(() => (globalThis as unknown as { __fake__: { manyMeetings(o: { n: number; clean: boolean }): void } }).__fake__.manyMeetings({ n: 1, clean: true }))@@ -230,25 +226,18 @@ test('a note adopts its final layout once and stays still throughout both sidebaawait expect.poll(() => page.evaluate(() => innerWidth)).toBe(width)if (width < 900) await expect(page.locator('.workspace-sidebar-toggle')).toHaveAttribute('aria-expanded', 'false')for (let direction = 0; direction < 2; direction++) {+ const before = await boxes()await page.locator('.workspace-sidebar-toggle').click()await page.locator('.workspace').evaluate((el) => {for (const animation of el.getAnimations({ subtree: true })) { animation.pause(); animation.currentTime = 0 }})const start = await boxes()- await page.locator('.workspace').evaluate((el) => {- for (const animation of el.getAnimations({ subtree: true })) { animation.currentTime = 120 }- })- const middle = await boxes()for (let i = 0; i < start.length; i++) for (const key of ['x', 'y', 'width', 'height'] as const) {- expect(Math.abs(start[i][key] - middle[i][key]), `${selectors[i]} ${key}, window ${width}`).toBeLessThan(1)+ expect(Math.abs(start[i][key] - before[i][key]), `${selectors[i]} ${key}, window ${width}`).toBeLessThan(1)}expect(await page.locator('.workspace-sidebar-toggle svg').innerHTML()).toBe(icon)expect(await page.locator('.workspace-sidebar-toggle .sidebar-toggle-pane').evaluate((el) => getComputedStyle(el).opacity)).toBe('1')await page.locator('.workspace').evaluate((el) => { for (const animation of el.getAnimations({ subtree: true })) if (animation.effect?.getComputedTiming().endTime !== Infinity) animation.finish() })- const end = await boxes()- for (let i = 0; i < start.length; i++) for (const key of ['x', 'y', 'width', 'height'] as const) {- expect(Math.abs(start[i][key] - end[i][key]), `${selectors[i]} ${key}, window ${width}`).toBeLessThan(1)- }expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true)}}diff --git a/app/src/renderer/src/components/FoldersNav.tsx b/app/src/renderer/src/components/FoldersNav.tsxindex 4bef5e3b..b0273fe8 100644--- a/app/src/renderer/src/components/FoldersNav.tsx+++ b/app/src/renderer/src/components/FoldersNav.tsx@@ -1,6 +1,6 @@import { Loading } from './Loading'import { LoadingContent } from './LoadingContent'-import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type DragEvent, type KeyboardEvent, type RefObject } from 'react'+import { useEffect, useRef, useState, type CSSProperties, type DragEvent, type KeyboardEvent, type RefObject } from 'react'import { ArrowDown, ArrowUp, Ellipsis, Palette, Pencil, Plus, Trash2 } from 'lucide-react'import { Reorder, useDragControls } from 'motion/react'import { useReducedMotion, usePopoverPresence } from '../motion'@@ -77,9 +77,6 @@ function FolderItem({ folder, collapsed, current, go, onRename, onDelete, onAppe}) {const controls = useDragControls()const reduced = useReducedMotion()- const previousCollapsed = useRef(collapsed)- const sidebarChanged = previousCollapsed.current !== collapsed- useLayoutEffect(() => { previousCollapsed.current = collapsed }, [collapsed])const dragged = useRef(false)const [moving, setMoving] = useState(false)const [drop, setDrop] = useState(false)@@ -112,10 +109,9 @@ function FolderItem({ folder, collapsed, current, go, onRename, onDelete, onAppe}const run = (fn: () => void) => { setMenu(undefined); (collapsed ? open : more).current?.focus(); fn() }const carries = (e: DragEvent) => e.dataTransfer.types.includes(MEETING_DRAG)- return <Reorder.Item as="div" ref={row} value={folder.id} layout="position" className="workspace-folder-item" data-testid="sidebar-folder" data-folder={folder.id} data-moving={moving}+ return <Reorder.Item as="div" ref={row} value={folder.id} className="workspace-folder-item" data-testid="sidebar-folder" data-folder={folder.id} data-moving={moving}dragListener={false} dragControls={controls} dragConstraints={constraints} dragElastic={0} dragMomentum={false}- // Sidebar resizing is not a reorder: projecting its old row box stretches/slides icons under the clip.- transition={reduced || sidebarChanged ? { duration: 0 } : { type: 'spring', stiffness: 520, damping: 42 }}+ transition={reduced ? { duration: 0 } : { type: 'spring', stiffness: 520, damping: 42 }}onDragStart={() => { dragged.current = true; setMoving(true); setMenu(undefined); onDragStart() }}onDragEnd={() => { setMoving(false); onDragEnd() }}><button ref={open} className="workspace-nav" data-sidebar="menu-button" aria-label={folder.name} title={collapsed ? folder.name : undefined} data-testid="sidebar-folder-open" data-drop={drop} aria-current={current ? 'page' : undefined}diff --git a/app/src/renderer/src/components/Workspace.tsx b/app/src/renderer/src/components/Workspace.tsxindex 1817b685..f48e5f2e 100644--- a/app/src/renderer/src/components/Workspace.tsx+++ b/app/src/renderer/src/components/Workspace.tsx@@ -13,7 +13,6 @@ import { FileText, MessageCircle, Search, Settings, SidebarToggle } from './Iconimport { FoldersNav } from './FoldersNav'import { FinishSetup } from './FinishSetup'import { NotesSetup } from './NotesSetup'-import { motion } from '../motion'export function Workspace({ route, meeting, folders, go, back, forward, search, collapsed, sidebarMotion, toggleSidebar, children }: {meeting?: Pick<MeetingView, 'id' | 'title'>@@ -28,7 +27,7 @@ export function Workspace({ route, meeting, folders, go, back, forward, search,void window.yogurt.widget.state().then((view) => { if (active && !updated) setRecording(view) })return () => { active = false; off() }}, [])- const sidebarTransition = { duration: sidebarMotion ? motion.surface / 1000 : 0, ease: motion.out }+ const sidebarTransition = { duration: sidebarMotion ? 0.2 : 0, ease: [0.22, 1, 0.36, 1] as [number, number, number, number] }const note = route.startsWith('/note/')// a saved chat (/chat/<id>) is still under Chatconst section = route.startsWith('/settings/') ? '/settings' : route.startsWith('/chat/') ? '/chat' : route@@ -78,8 +77,7 @@ export function Workspace({ route, meeting, folders, go, back, forward, search,<SidebarToggle className="sidebar-toggle-glyph rtl:-scale-x-100" size={16} strokeWidth={1.75} aria-hidden="true" /></button></div>- {/* Reserve the final width once; only the absolute sidebar animates. */}- <div className="workspace-sidebar-gap" aria-hidden="true" />+ <Sidebar.Gap className="workspace-sidebar-gap" transition={sidebarTransition} /><Sidebar.Container id="workspace-sidebar" className="workspace-sidebar" role="complementary" aria-label={t('Main navigation')} transition={sidebarTransition}><div className="workspace-sidebar-inner"><div className="sidebar-titlebar" />diff --git a/app/src/renderer/src/workspace.css b/app/src/renderer/src/workspace.cssindex f76c8c18..68b9566d 100644--- a/app/src/renderer/src/workspace.css+++ b/app/src/renderer/src/workspace.css@@ -17,17 +17,14 @@.workspace:dir(rtl).sidebar-collapsed .workspace-toolbar[data-note=true] { padding-left:185px; }.workspace [hidden] { display:none!important; }.workspace-sidebar { z-index:2;position:absolute;inset-block:0;inset-inline-start:0;display:flex;flex-direction:column;background:transparent;border-inline-end:1px solid transparent; }-/* The divider belongs to the page boundary, not the outgoing transparent sidebar. */-.workspace-sidebar-gap::after { content:"";position:absolute;inset-block:52px 0;inset-inline-end:0;width:1px;background:var(--line);pointer-events:none; }+.workspace-sidebar::after { content:"";position:absolute;inset-block:52px 0;inset-inline-end:-1px;width:1px;background:var(--line);pointer-events:none; }/* Local widths avoid invalidating inherited styles across a long transcript. */.workspace-sidebar,.workspace-sidebar-gap { width:208px; }.sidebar-collapsed :is(.workspace-sidebar,.workspace-sidebar-gap) { width:56px; }-.workspace-sidebar-gap { position:relative;flex:none; }-/* Controls adopt the final width in both directions; only labels fade, never the icon rail's geometry. */-.workspace-sidebar-inner { display:flex;flex-direction:column;width:207px;height:100%;min-height:0; }-.sidebar-collapsed .workspace-sidebar-inner { width:55px; }+.workspace-sidebar-gap { flex:none; }+.workspace-sidebar-inner { display:flex;flex-direction:column;height:100%;min-height:0; }.workspace-sidebar .workspace-search>svg { flex:none; }-.workspace-sidebar .workspace-nav>span:not(.folder-glyph),.workspace-sidebar .workspace-nav>small,.workspace-search>span,.workspace-search>kbd,.workspace-folder-label { transition:opacity var(--dur-surface) var(--ease-out); }+.workspace-sidebar .workspace-nav>span:not(.folder-glyph),.workspace-sidebar .workspace-nav>small,.workspace-search>span,.workspace-search>kbd,.workspace-folder-label { transition:opacity 90ms ease; }.sidebar-collapsed .workspace-nav>span:not(.folder-glyph),.sidebar-collapsed .workspace-nav>small,.sidebar-collapsed .workspace-search>span,.sidebar-collapsed .workspace-search>kbd,.sidebar-collapsed .workspace-folder-label { opacity:0;pointer-events:none; }.sidebar-collapsed .workspace-nav { padding-inline:10px;gap:0; }.sidebar-collapsed .workspace-nav>span:not(.folder-glyph),.sidebar-collapsed .workspace-search>span,.sidebar-collapsed .workspace-search>kbd { width:0;flex:none; }@@ -36,12 +33,13 @@.sidebar-collapsed .workspace-brand { padding-inline:17px; }.workspace-wordmark { direction:ltr;display:flex;flex:none;width:90px;overflow:hidden; }.sidebar-collapsed .workspace-wordmark { width:22px; }-.workspace[data-sidebar-motion=true] .workspace-wordmark { transition:width var(--dur-surface) var(--ease-out); }-.workspace[data-sidebar-motion=true] .workspace-brand { transition:padding-inline var(--dur-surface) var(--ease-out); }+.workspace[data-sidebar-motion=true] .workspace-wordmark { transition:width 200ms cubic-bezier(.22,1,.36,1); }+.workspace[data-sidebar-motion=true] .workspace-brand { transition:padding-inline 200ms cubic-bezier(.22,1,.36,1); }.workspace-folder-label { height:16px;white-space:nowrap;overflow:hidden; }+.workspace[data-sidebar-motion=true] .workspace-folder-label { transition:height 200ms cubic-bezier(.22,1,.36,1),margin 200ms cubic-bezier(.22,1,.36,1),opacity 120ms ease; }.sidebar-collapsed .workspace-folder-label { height:0;margin-block:18px; }.workspace-brand { gap:0; }-.workspace:is([data-sidebar-motion=false],.sidebar-collapsed) :is(.workspace-nav>span,.workspace-nav>small,.workspace-search>span,.workspace-search>kbd,.workspace-folder-label,.workspace-wordmark,.workspace-brand) { transition:none; }+.workspace[data-sidebar-motion=false] :is(.workspace-nav>span,.workspace-nav>small,.workspace-search>span,.workspace-search>kbd,.workspace-folder-label,.workspace-wordmark,.workspace-brand) { transition:none; }@media (prefers-reduced-motion:reduce) {.workspace-sidebar :is(span,small,kbd),.workspace-folder-label,.workspace-toolbar,.workspace-brand { transition:none!important;filter:none!important; }}@@ -91,6 +89,7 @@.workspace-history button:disabled { opacity:.3;background:transparent; }/* Keep chrome edge-to-edge while the canvas moves; only the controls need clearance. */.sidebar-collapsed .workspace-toolbar { padding-inline-start:68px; }+.workspace[data-sidebar-motion=true] .workspace-toolbar { transition:padding-inline-start 200ms cubic-bezier(.22,1,.36,1); }.workspace-icon { display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;flex:none;border:1px solid transparent;border-radius:5px;color:var(--muted); }.workspace-icon:active { background:color-mix(in srgb,var(--ink) 9%,transparent); }.workspace button:focus-visible { outline:2px solid var(--focus);outline-offset:2px; }@@ -452,7 +451,7 @@ body:has(.chat-panel[open]) .app-toast-viewport:dir(rtl) { --toast-x:440px; }.sidebar-toggle-pane { width:6px; }.workspace-sidebar-toggle[aria-expanded=false] .sidebar-toggle-pane { width:2px; }@media (prefers-reduced-motion:no-preference) {- .workspace[data-sidebar-motion=true] .sidebar-toggle-pane { transition:width var(--dur-surface) var(--ease-out); }+ .workspace[data-sidebar-motion=true] .sidebar-toggle-pane { transition:width 200ms cubic-bezier(.22,1,.36,1); }}/* Ask keeps one reading column and one composer in both surfaces. */diff --git a/app/test/motion.test.ts b/app/test/motion.test.tsindex 46080ca5..db3aa105 100644--- a/app/test/motion.test.ts+++ b/app/test/motion.test.ts@@ -123,24 +123,19 @@ it('keeps the anchored panel curve monotonic with a shorter close', () => {expect(surface).not.toContain('transform')})-it('keeps the divider at the page boundary and the icon rail at its final geometry in both directions', () => {+it('moves the sidebar and page together with the original timing and child layout', () => {const css = readFileSync(new URL('../src/renderer/src/workspace.css', import.meta.url), 'utf8')const source = readFileSync(new URL('../src/renderer/src/components/Workspace.tsx', import.meta.url), 'utf8')- expect(source).toContain('duration: sidebarMotion ? motion.surface / 1000 : 0, ease: motion.out')- // The page snaps to its final layout, so neither its divider nor its controls can track the outgoing width.- expect(css).not.toContain('.workspace-sidebar::after')- expect(css).toContain('.workspace-sidebar-gap { position:relative;flex:none; }')- expect(css).toContain('.workspace-sidebar-gap::after { content:"";position:absolute;inset-block:52px 0;inset-inline-end:0;width:1px;background:var(--line);pointer-events:none; }')- expect(css).toContain('.workspace-sidebar-inner { display:flex;flex-direction:column;width:207px;height:100%;min-height:0; }')- expect(css).toContain('.sidebar-collapsed .workspace-sidebar-inner { width:55px; }')- expect(css).not.toMatch(/\.workspace-folder-label \{[^}]*transition:height/)- expect(css).toContain('.workspace:is([data-sidebar-motion=false],.sidebar-collapsed) :is(.workspace-nav>span,.workspace-nav>small,.workspace-search>span,.workspace-search>kbd,.workspace-folder-label,.workspace-wordmark,.workspace-brand) { transition:none; }')- const children = css.slice(css.indexOf('.workspace-sidebar .workspace-nav>span'), css.indexOf('.sidebar-titlebar'))- for (const transition of children.matchAll(/transition:([^;]+);/g)) {- if (transition[1] === 'none' || transition[1] === 'none!important') continue- expect(transition[1]).not.toContain('--dur-micro')- for (const property of transition[1].split(',')) expect(property).toMatch(/var\(--dur-surface\) var\(--ease-out\)$/)+ expect(source).toContain('duration: sidebarMotion ? 0.2 : 0, ease: [0.22, 1, 0.36, 1]')+ for (const component of ['Gap', 'Container']) {+ expect(source).toMatch(new RegExp(`<Sidebar\\.${component}[^>]+transition=\\{sidebarTransition\\}`))}- expect(children).toContain('@media (prefers-reduced-motion:reduce)')- expect(children).toContain('transition:none!important')+ expect(css).toContain('.workspace-sidebar::after { content:"";position:absolute;inset-block:52px 0;inset-inline-end:-1px;')+ expect(css).not.toContain('.workspace-sidebar-gap::after')+ expect(css).toContain('.workspace-sidebar-inner { display:flex;flex-direction:column;height:100%;min-height:0; }')+ expect(css).not.toContain('.sidebar-collapsed .workspace-sidebar-inner')+ expect(css).toContain('.workspace[data-sidebar-motion=true] .workspace-toolbar { transition:padding-inline-start 200ms cubic-bezier(.22,1,.36,1); }')+ expect(css).toContain('.workspace[data-sidebar-motion=true] .workspace-folder-label { transition:height 200ms cubic-bezier(.22,1,.36,1),margin 200ms cubic-bezier(.22,1,.36,1),opacity 120ms ease; }')+ const styles = readFileSync(new URL('../src/renderer/src/styles.css', import.meta.url), 'utf8')+ for (const animation of ['icon-lift', 'icon-write', 'icon-turn']) expect(css + styles).not.toContain(animation)})diff --git a/app/test/motionInteractions.test.ts b/app/test/motionInteractions.test.tsindex 423266ab..4f52b5d9 100644--- a/app/test/motionInteractions.test.ts+++ b/app/test/motionInteractions.test.ts@@ -29,7 +29,7 @@ function renderer(component: () => ReactNode) {}}-it.each(['/meetings', '/note/m1'])('keeps folder icons unscaled and settles sidebar geometry immediately on %s', route => {+it.each(['/meetings', '/note/m1'])('keeps the original folder reorder animation across sidebar toggles on %s', route => {vi.stubGlobal('window', { matchMedia: () => ({ matches: false }) })const folders = [{ id: 'f1', name: 'Planning', icon: 'calendar' as const, color: 'violet' as const, count: 2, createdAt: 1 }]let collapsed = false@@ -39,9 +39,7 @@ it.each(['/meetings', '/note/m1'])('keeps folder icons unscaled and settles sideconst render = () => {item = find(nav(), 'folder-reorder-list').props.children[0]const element = find(row(), 'sidebar-folder')- // Commit the previous sidebar state, as React does after the row's layout is measured.- vi.mocked(useLayoutEffect).mock.calls.find(([, deps]) => deps?.length === 1 && deps[0] === collapsed)![0]()- expect(element.props.layout).toBe('position')+ expect(element.props.layout).toBeUndefined()expect(element.props.dragControls).toBeDefined()expect(element.props.onDragStart).toBeTypeOf('function')return element@@ -49,9 +47,7 @@ it.each(['/meetings', '/note/m1'])('keeps folder icons unscaled and settles sideexpect(render().props.transition).toMatchObject({ type: 'spring' })for (const next of [true, false, true, false]) {collapsed = next- expect(render().props.transition).toEqual({ duration: 0 })- // Ordinary reorders keep their spring after either sidebar direction settles.- expect(render().props.transition).toMatchObject({ type: 'spring' })+ expect(render().props.transition).toEqual({ type: 'spring', stiffness: 520, damping: 42 })}})function find(node: ReactNode, testId: string): ReactElement<any> {