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.

Motion: the sidebar's folders hold still while it moves, ⌘J's composer stays inside its panel, and the Summary fades at the tab line

Eric Brownrout9dd5aa1d5dd7
diff --git a/app/e2e/chat.spec.ts b/app/e2e/chat.spec.ts
index 7c5512aa..da9fba03 100644
--- a/app/e2e/chat.spec.ts
+++ b/app/e2e/chat.spec.ts
@@ -338,12 +338,13 @@ test('Ask grows from its button identically for either trigger and keeps typing
await trigger.click()
const panel = page.getByTestId('chat-panel')
const surface = page.locator('.chat-morph-surface')
- const motion = await surface.evaluate(el => el.getAnimations().map(a => ({ duration: a.effect!.getTiming().duration, easing: a.effect!.getTiming().easing, frames: (a.effect as KeyframeEffect).getKeyframes() })).filter(a => a.frames.some(f => f.transform)))
+ const motion = await surface.evaluate(el => el.getAnimations().map(a => ({ duration: a.effect!.getTiming().duration, easing: a.effect!.getTiming().easing, frames: (a.effect as KeyframeEffect).getKeyframes() })).filter(a => a.frames.some(f => f.width)))
expect(motion).toHaveLength(1)
expect(motion[0].duration).toBe(180)
expect(motion[0].easing).toBe('cubic-bezier(0.23, 1, 0.32, 1)')
- expect(motion[0].frames[0].transform).toContain('translate(')
- expect(motion[0].frames.at(-1)!.transform).toBe('none')
+ expect(parseFloat(String(motion[0].frames[0].width))).toBeCloseTo((await trigger.boundingBox())!.width)
+ expect(String(motion[0].frames.at(-1)!.width)).toContain('100%')
+ expect(motion[0].frames.every(frame => !frame.transform)).toBe(true)
await expect(page.getByTestId('chat-input')).toBeFocused()
await expect(page.locator('.chat-panel-contents')).toHaveCSS('transform', 'none')
await expect(page.locator('.chat-panel-contents')).toHaveCSS('filter', 'none')
diff --git a/app/e2e/sidebarMotion.spec.ts b/app/e2e/sidebarMotion.spec.ts
index 42d98042..dc3e2fcb 100644
--- a/app/e2e/sidebarMotion.spec.ts
+++ b/app/e2e/sidebarMotion.spec.ts
@@ -118,8 +118,8 @@ for (const reducedTransparency of ['no-preference', 'reduce']) test(`titlebar ch
await page.getByTestId('past-note').click()
await expect(page.getByTestId('note')).toBeVisible()
const cdp = await page.context().newCDPSession(page)
- 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' })
+ 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')
for (const colorScheme of ['light', 'dark'] as const) {
await cdp.send('Emulation.setEmulatedMedia', { features: [
{ name: 'prefers-color-scheme', value: colorScheme },
diff --git a/app/e2e/summaryRim.spec.ts b/app/e2e/summaryRim.spec.ts
index 846dba9f..9a465c2d 100644
--- a/app/e2e/summaryRim.spec.ts
+++ b/app/e2e/summaryRim.spec.ts
@@ -31,6 +31,10 @@ for (const theme of ['light', 'dark'] as const) for (const width of [420, 860])
await expect(rim).toHaveCSS('opacity', '1')
await expect(page.getByTestId('note-enhanced-waiting')).toBeVisible()
expect(await pane.evaluate(el => el.scrollTop)).toBe(0)
+ const tabs = (await page.locator('.note-primary-tabs').boundingBox())!, reading = (await page.locator('.note-reading-area').boundingBox())!
+ const viewport = (await pane.boundingBox())!
+ expect(viewport.y).toBeCloseTo(tabs.y + tabs.height, 0)
+ expect(viewport.y + viewport.height).toBeCloseTo(reading.y + reading.height, 0)
const text = (n: number) => Array.from({ length: n }, (_, i) => `## Section ${i + 1}\nThe team agreed to review the launch notes and confirm the next step before publishing.\n`).join('\n')
await push('writing', text(18))
await expect(page.getByTestId('note-enhanced-editor')).toContainText('Section 18')
diff --git a/app/src/renderer/src/components/Chat.tsx b/app/src/renderer/src/components/Chat.tsx
index 8e4928af..afb855ce 100644
--- a/app/src/renderer/src/components/Chat.tsx
+++ b/app/src/renderer/src/components/Chat.tsx
@@ -36,13 +36,14 @@ export function Ask({ id, recording, anchor, onSource }: { id: string; recording
void window.yogurt.conversations.current([{ kind: 'meeting', id }]).then(cid => { if (active) setConversationId(cid) }).catch(() => { if (active) setError(true) })
return () => { active = false }
}, [open, id, conversationId])
- // Ask grows out of its button and folds back into it. Only the surface stretches; the chat stays at its final size,
+ // Ask grows out of its button and folds back into it. Only the empty surface resizes; the chat stays at its final size,
// cropped to the surface so none of it shows outside, and the button and the surface trade places where they meet.
const morph = (expand: boolean, animate = true) => {
const shell = surface.current, body = contents.current, dialog = panel.current, button = trigger.current
if (!shell || !body || !dialog || !button) return
const running = animations.current.some(animation => animation.playState === 'running')
- const was = { transform: getComputedStyle(shell).transform, radius: getComputedStyle(shell).borderRadius, shell: getComputedStyle(shell).opacity,
+ const style = getComputedStyle(shell)
+ const was = { left: style.left, top: style.top, width: style.width, height: style.height, borderRadius: style.borderRadius, shell: style.opacity,
dialog: getComputedStyle(dialog).opacity, body: getComputedStyle(body).opacity, clip: getComputedStyle(body).clipPath, button: getComputedStyle(button).opacity }
animations.current.forEach(animation => animation.cancel()); animations.current = []
if (!animate) return
@@ -53,18 +54,18 @@ export function Ask({ id, recording, anchor, onSource }: { id: string; recording
return fade
}
const from = button.getBoundingClientRect(), to = dialog.getBoundingClientRect(), box = body.getBoundingClientRect()
- const scaleX = from.width / to.width, scaleY = from.height / to.height
- const collapsed = `translate(${from.x - to.x}px, ${from.y - to.y}px) scale(${scaleX}, ${scaleY})`
const buttonRadius = parseFloat(getComputedStyle(button).borderRadius)
- const collapsedRadius = `${buttonRadius / scaleX}px / ${buttonRadius / scaleY}px`
- const cropped = `inset(${from.top - box.top}px ${box.right - from.right}px ${box.bottom - from.bottom}px ${from.left - box.left}px round ${buttonRadius}px)`
- // The anchored shape settles without overshoot; text stays at its final size.
+ const collapsed = { left: `${from.x - to.x - 1}px`, top: `${from.y - to.y - 1}px`, width: `${from.width}px`, height: `${from.height}px`, borderRadius: `${buttonRadius}px` }
+ const expanded = { left: '-1px', top: '-1px', width: 'calc(100% + 2px)', height: 'calc(100% + 2px)', borderRadius: '12px' }
+ const cropped = `inset(${from.top + 1 - box.top}px ${box.right - from.right + 1}px ${box.bottom - from.bottom + 1}px ${from.left + 1 - box.left}px round ${Math.max(0, buttonRadius - 1)}px)`
+ const uncropped = 'inset(0px round 11px)'
+ // Equal bounds/radius interpolation keeps the clip one border pixel inside the surface at every frame.
const duration = expand ? timing.base : timing.askExit, easing = timing.ease, handoff = timing.micro
const shape = shell.animate([
- { transform: running ? was.transform : expand ? collapsed : 'none', borderRadius: running ? was.radius : expand ? collapsedRadius : '12px' },
- { transform: expand ? 'none' : collapsed, borderRadius: expand ? '12px' : collapsedRadius },
+ running ? { left: was.left, top: was.top, width: was.width, height: was.height, borderRadius: was.borderRadius } : expand ? collapsed : expanded,
+ expand ? expanded : collapsed,
], { duration, easing, fill: 'both' })
- const crop = body.animate([{ clipPath: running && was.clip !== 'none' ? was.clip : expand ? cropped : 'inset(0px round 12px)' }, { clipPath: expand ? 'inset(0px round 12px)' : cropped }],
+ const crop = body.animate([{ clipPath: running && was.clip !== 'none' ? was.clip : expand ? cropped : uncropped }, { clipPath: expand ? uncropped : cropped }],
{ duration, easing, fill: expand ? 'backwards' : 'forwards' })
const content = body.animate([{ opacity: running ? was.body : expand ? 0 : 1 }, { opacity: expand ? 1 : 0 }],
{ duration: timing.micro, easing, fill: 'both' })
diff --git a/app/src/renderer/src/components/FoldersNav.tsx b/app/src/renderer/src/components/FoldersNav.tsx
index b0273fe8..4bef5e3b 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, useRef, useState, type CSSProperties, type DragEvent, type KeyboardEvent, type RefObject } from 'react'
+import { useEffect, useLayoutEffect, 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,6 +77,9 @@ 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)
@@ -109,9 +112,10 @@ 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} 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} layout="position" 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}
- transition={reduced ? { duration: 0 } : { type: 'spring', stiffness: 520, damping: 42 }}
+ // 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 }}
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/styles.css b/app/src/renderer/src/styles.css
index 09b8c84a..7bba5447 100644
--- a/app/src/renderer/src/styles.css
+++ b/app/src/renderer/src/styles.css
@@ -586,7 +586,7 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
.chat-panel { position:fixed;z-index:70;inset-block:auto var(--chat-bottom,72px);inset-inline:auto 24px;width:420px;max-width:calc(100% - 32px);height:min(440px,var(--chat-height,440px),calc(100dvh - var(--chat-bottom,72px) - 68px));min-height:0;max-height:none;margin:0;padding:0;overflow:visible;border:1px solid var(--line);border-radius:12px;background:var(--float);color:var(--ink);box-shadow:0 16px 48px rgb(0 0 0 / .18),0 4px 12px rgb(0 0 0 / .08); }
.chat-panel[open] { display:flex;flex-direction:column; }
.chat-panel { background:transparent;border-color:transparent;box-shadow:none; }
-.chat-morph-surface { position:absolute;inset:-1px;pointer-events:none;transform-origin:top left;border:1px solid var(--line);border-radius:inherit;background:var(--float);box-shadow:0 16px 48px rgb(0 0 0 / .18),0 4px 12px rgb(0 0 0 / .08); }
+.chat-morph-surface { position:absolute;inset:-1px auto auto -1px;width:calc(100% + 2px);height:calc(100% + 2px);pointer-events:none;border:1px solid var(--line);border-radius:inherit;background:var(--float);box-shadow:0 16px 48px rgb(0 0 0 / .18),0 4px 12px rgb(0 0 0 / .08); }
.chat-panel-contents { position:relative;display:flex;flex-direction:column;flex:1;min-height:0;min-width:0; }
.chat-trigger[aria-expanded=true] { opacity:0; }
.note-resume-action { min-width:160px; }
diff --git a/app/src/renderer/src/workspace.css b/app/src/renderer/src/workspace.css
index 77faa8a7..f76c8c18 100644
--- a/app/src/renderer/src/workspace.css
+++ b/app/src/renderer/src/workspace.css
@@ -17,13 +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; }
-.workspace-sidebar::after { content:"";position:absolute;inset-block:52px 0;inset-inline-end:-1px;width:1px;background:var(--line);pointer-events:none; }
+/* 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; }
/* 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 { flex:none; }
-.workspace-sidebar-inner { display:flex;flex-direction:column;height:100%;min-height:0; }
-/* The page adopts its final width immediately; collapsed controls must not trail across it. */
+.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 .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); }
@@ -38,7 +39,6 @@
.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-folder-label { height:16px;white-space:nowrap;overflow:hidden; }
-.workspace[data-sidebar-motion=true] .workspace-folder-label { transition:height var(--dur-surface) var(--ease-out),margin var(--dur-surface) var(--ease-out),opacity var(--dur-surface) var(--ease-out); }
.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; }
@@ -504,8 +504,8 @@ body:has(.chat-panel[open]) .app-toast-viewport:dir(rtl) { --toast-x:440px; }
/* deep enough for a white arrow on the matching send button, light enough to read on the dark surface */
.ask-box,.note-reading-frame { --ask-ring-color:color-mix(in srgb,var(--primary) 35%,var(--accent));--ask-ring-highlight:color-mix(in srgb,var(--focus) 18%,var(--ink)); }
.ask-box::before,.note-reading-frame::before { content:"";position:absolute;inset:-2px;border-radius:inherit;pointer-events:none;opacity:var(--ask-ring-opacity);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 9%,transparent),0 0 12px 2px color-mix(in srgb,var(--accent) 16%,transparent);transition:opacity 200ms ease-out; }
- /* The summary ring sits on the frame's edge, so its halo starts there; at Ask's -2px it left a dark gap and read as a grey second box. */
- .note-reading-frame::before { inset:0; }
+ /* The summary halo follows the inset rim, not the scroll viewport's edge. */
+ .note-reading-frame::before { inset:8px 0; }
}
@keyframes ask-border-drift { from { transform:translate(-50%,-50%) rotate(0deg); } to { transform:translate(-50%,-50%) rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .ask-border::before { animation:none;display:none; } .ask-box::before,.note-reading-frame::before { display:none; } .orb-material::before,.orb-material::after { animation:none; } .ask-send { transition:none;transform:none!important; } }
@@ -632,21 +632,21 @@ body:has(.chat-panel[open]) .app-toast-viewport:dir(rtl) { --toast-x:440px; }
:root[data-chrome=overlay] .workspace:dir(rtl) .workspace-toolbar:has(.notes-download-status) { right:max(0px,calc(var(--controls-end) - 208px)); }
:root[data-chrome=overlay] .workspace:dir(rtl).sidebar-collapsed .workspace-toolbar:has(.notes-download-status) { right:max(0px,calc(var(--controls-end) - 56px)); }
-/* The frame preserves the note's existing text inset and 22px heading offset in every state. */
-.note-reading-frame { position:relative;min-width:0;min-height:0;flex:1;margin:8px calc(max(0px,(100% - 860px)/2) + clamp(20px,calc(10cqw - 42px),48px) - 14px) 8px;padding:2px;border-radius:12px; }
+/* The scroll viewport meets the tab/footer borders; spacing belongs inside the scrolled content. */
+.note-reading-frame { position:relative;min-width:0;min-height:0;flex:1;margin:0 calc(max(0px,(100% - 860px)/2) + clamp(20px,calc(10cqw - 42px),48px) - 14px);padding:0 2px;border-radius:12px; }
.note-reading-frame[hidden] { display:none; }
.note-reading-frame[data-generating=true] { --ask-ring-opacity:1; }
.note-reading-frame[data-active=true] { --ask-ring-play:running; }
.note-reading-clip { height:100%;overflow:hidden;border-radius:10px; }
.main-window .note-reading-clip>.note-notes-pane { height:100%;scrollbar-width:auto;scrollbar-gutter:stable; }
/* The reserved 4px thumb completes the end padding without narrowing or shifting the text column. */
-.note-reading-frame .note-notes-body { max-width:none;padding-block:12px 30px;padding-inline:12px 8px; }
+.note-reading-frame .note-notes-body { max-width:none;padding-block:22px 40px;padding-inline:12px 8px; }
.note-reading-clip>.note-notes-pane::-webkit-scrollbar { width:4px; }
.note-reading-clip>.note-notes-pane::-webkit-scrollbar-track,.note-reading-clip>.note-notes-pane::-webkit-scrollbar-thumb { background:transparent; }
.note-reading-clip>.note-notes-pane[data-scrolling]::-webkit-scrollbar-thumb { background:color-mix(in srgb,var(--muted) 45%,transparent);border-radius:3px; }
-.note-summary-rim { inset:0;z-index:2; }
-.note-summary-status { position:absolute;inset-inline-start:14px;bottom:10px;z-index:1;background:var(--bg);color:var(--muted);font-size:11px;line-height:16px;pointer-events:none; }
-.note-latest { position:absolute;bottom:10px;left:50%;transform:translateX(-50%);z-index:3;display:flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:6px;padding:4px 12px;background:var(--float);color:var(--ink);font-size:12px;line-height:16px;box-shadow:var(--shadow); }
+.note-summary-rim { inset:8px 0;z-index:2; }
+.note-summary-status { position:absolute;inset-inline-start:14px;bottom:18px;z-index:1;background:var(--bg);color:var(--muted);font-size:11px;line-height:16px;pointer-events:none; }
+.note-latest { position:absolute;bottom:18px;left:50%;transform:translateX(-50%);z-index:3;display:flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:6px;padding:4px 12px;background:var(--float);color:var(--ink);font-size:12px;line-height:16px;box-shadow:var(--shadow); }
.native-library { --meeting-selection-tint:6%; }
@media (prefers-color-scheme:dark) { .native-library { --meeting-selection-tint:9%; } }
diff --git a/app/test/motion.test.ts b/app/test/motion.test.ts
index c70d54d2..46080ca5 100644
--- a/app/test/motion.test.ts
+++ b/app/test/motion.test.ts
@@ -115,14 +115,25 @@ it('keeps the anchored panel curve monotonic with a shorter close', () => {
expect(progress).toBeLessThanOrEqual(1)
previous = progress
}
+ const styles = readFileSync(new URL('../src/renderer/src/styles.css', import.meta.url), 'utf8')
+ const surface = styles.match(/\.chat-morph-surface \{([^}]+)\}/)![1]
+ // Animated left/top and width/height must not be overconstrained by right/bottom in RTL.
+ expect(surface).toContain('inset:-1px auto auto -1px')
+ expect(surface).toContain('width:calc(100% + 2px);height:calc(100% + 2px)')
+ expect(surface).not.toContain('transform')
})
-it('collapses sidebar controls immediately and expands children on the sidebar duration and curve', () => {
+it('keeps the divider at the page boundary and the icon rail at its final geometry in both directions', () => {
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: the search field must not keep the outgoing sidebar width.
+ // 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)) {
diff --git a/app/test/motionInteractions.test.ts b/app/test/motionInteractions.test.ts
index 902dd0a6..423266ab 100644
--- a/app/test/motionInteractions.test.ts
+++ b/app/test/motionInteractions.test.ts
@@ -1,12 +1,15 @@
import { afterEach, expect, it, vi } from 'vitest'
-import { useEffect, useRef, useState, type ReactElement, type ReactNode } from 'react'
+import { useEffect, useLayoutEffect, useRef, useState, type ReactElement, type ReactNode } from 'react'
import { Search } from '../src/renderer/src/components/Search'
import { Ask } from '../src/renderer/src/components/Chat'
import { Workspace } from '../src/renderer/src/components/Workspace'
+import { FoldersNav } from '../src/renderer/src/components/FoldersNav'
vi.mock('react', async original => ({
...await original<typeof import('react')>(), useState: vi.fn(), useRef: vi.fn(), useEffect: vi.fn(), useLayoutEffect: vi.fn(),
}))
+vi.mock('motion/react', async original => ({ ...await original<typeof import('motion/react')>(), useDragControls: () => ({ start: vi.fn() }) }))
+vi.mock('react-dom', async original => ({ ...await original<typeof import('react-dom')>(), createPortal: (children: ReactNode) => children }))
afterEach(() => { vi.unstubAllGlobals(); vi.clearAllMocks() })
// Exercise the component's handlers and state without starting Electron or a browser.
@@ -21,9 +24,36 @@ function renderer(component: () => ReactNode) {
})
vi.mocked(useRef).mockImplementation(initial => refs[ref++] ??= { current: initial })
vi.mocked(useEffect).mockClear()
+ vi.mocked(useLayoutEffect).mockClear()
return component()
}
}
+
+it.each(['/meetings', '/note/m1'])('keeps folder icons unscaled and settles sidebar geometry immediately 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
+ const nav = renderer(() => FoldersNav({ folders, route, collapsed, go() {} }))
+ let item: ReactElement<any>
+ const row = renderer(() => (item.type as Function)(item.props))
+ const 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.dragControls).toBeDefined()
+ expect(element.props.onDragStart).toBeTypeOf('function')
+ return element
+ }
+ expect(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' })
+ }
+})
function find(node: ReactNode, testId: string): ReactElement<any> {
const visit = (value: ReactNode): ReactElement<any> | undefined => {
if (Array.isArray(value)) return value.map(visit).find(Boolean)
@@ -107,3 +137,88 @@ it.each(['darwin', 'win32'])('toggles the meeting panel once per shortcut press
press()
expect(click).toHaveBeenCalledTimes(3)
})
+
+it.each([false, true])('keeps the composer clip inside the growing shape through open, close and reversal (narrow: %s)', narrow => {
+ const rect = (x: number, y: number, width: number, height: number) => ({ x, y, width, height, top: y, left: x, right: x + width, bottom: y + height })
+ const to = narrow ? rect(16, 16, 328, 640) : rect(760, 200, 420, 440)
+ // Exercise a button outside the final panel, anchored on either side.
+ const from = narrow ? rect(20, 700, 140, 30) : rect(1040, 670, 140, 30)
+ const box = rect(to.x + 1, to.y + 1, to.width - 2, to.height - 2)
+ const node = (bounds: ReturnType<typeof rect>, computed: Record<string, string>) => ({
+ getBoundingClientRect: () => bounds, computed,
+ animate: vi.fn((_frames: Keyframe[], _options: KeyframeAnimationOptions) => ({
+ playState: 'running', cancel() { this.playState = 'idle' }, finished: new Promise<void>(() => {}),
+ })),
+ })
+ const button = { ...node(from, { opacity: '1', borderRadius: '6px' }), focus: vi.fn() }
+ const shell = node(to, { left: '-1px', top: '-1px', width: `${to.width}px`, height: `${to.height}px`, borderRadius: '12px', opacity: '1' })
+ const body = node(box, { clipPath: 'none', opacity: '1' })
+ const input = { focus: vi.fn() }
+ const dialog = { ...node(to, { opacity: '1' }), style: { setProperty() {} }, show() {}, showModal() {}, close() {}, querySelector: () => input }
+ const anchor = { getBoundingClientRect: () => to } as HTMLElement
+ vi.stubGlobal('window', { matchMedia: (query: string) => ({ matches: query.includes('max-width') && narrow }), addEventListener() {}, removeEventListener() {} })
+ vi.stubGlobal('innerHeight', 800)
+ vi.stubGlobal('ResizeObserver', class { observe() {} disconnect() {} })
+ vi.stubGlobal('getComputedStyle', (element: { computed: Record<string, string> }) => element.computed)
+ const render = renderer(() => Ask({ id: 'morph', recording: false, anchor, onSource() {} }))
+ let tree = render()
+ find(tree, 'chat-open').props.ref.current = button
+ find(tree, 'chat-open').props.onClick()
+ tree = render()
+ const panel = find(tree, 'chat-panel')
+ panel.props.ref.current = dialog
+ panel.props.children[0].props.ref.current = shell
+ panel.props.children[1].props.ref.current = body
+ // The conversation mounts before its ID resolves; clipping must not postpone the editable composer.
+ expect(panel.props.children[1].props.children[1].props).toMatchObject({ id: '', panel: true, pendingDraftKey: 'meeting/morph' })
+ vi.mocked(useLayoutEffect).mock.lastCall![0]()
+ expect(input.focus).toHaveBeenCalledWith({ preventScroll: true })
+
+ const lerp = (a: string, b: string, p: number) => parseFloat(a) + (parseFloat(b) - parseFloat(a)) * p
+ const clip = (value: string) => {
+ const n = value.match(/-?\d+(?:\.\d+)?/g)!.map(Number)
+ return n.length === 2 ? [n[0], n[0], n[0], n[0], n[1]] : n
+ }
+ const check = (expand: boolean) => {
+ const [shape, shapeTiming] = shell.animate.mock.calls.at(-2)!
+ const [crop, cropTiming] = body.animate.mock.calls.at(-2)!
+ expect(shapeTiming.duration).toBe(cropTiming.duration)
+ expect(shapeTiming.easing).toBe(cropTiming.easing)
+ expect(cropTiming.fill).toBe(expand ? 'backwards' : 'forwards')
+ expect(shapeTiming.fill).toBe('both')
+ expect(shape[1].width).toBe(expand ? 'calc(100% + 2px)' : `${from.width}px`)
+ expect(shape.every(frame => !frame.transform)).toBe(true)
+ const at = (p: number) => {
+ const used = (frame: Keyframe, key: string) => String(frame[key]).includes('100%') ? `${to[key as 'width' | 'height']}px` : String(frame[key])
+ const bounds = Object.fromEntries(['left', 'top', 'width', 'height', 'borderRadius'].map(key => [key, lerp(used(shape[0], key), used(shape[1], key), p)]))
+ const start = clip(String(crop[0].clipPath)), end = clip(String(crop[1].clipPath))
+ const inset = start.map((value, i) => value + (end[i] - value) * p)
+ return { bounds, inset }
+ }
+ // All intermediate rectangles AND rounded corners agree, not just the two endpoints.
+ for (let frame = 0; frame <= 100; frame++) {
+ const { bounds, inset: [top, right, bottom, left, radius] } = at(frame / 100)
+ expect(box.left + left).toBeCloseTo(to.left + 1 + bounds.left + 1)
+ expect(box.top + top).toBeCloseTo(to.top + 1 + bounds.top + 1)
+ expect(box.right - right).toBeCloseTo(to.left + 1 + bounds.left + bounds.width - 1)
+ expect(box.bottom - bottom).toBeCloseTo(to.top + 1 + bounds.top + bounds.height - 1)
+ expect(radius).toBeCloseTo(bounds.borderRadius - 1)
+ }
+ // A fast toggle resumes from the same on-screen bounds and radius.
+ const { bounds, inset } = at(.4)
+ Object.assign(shell.computed, Object.fromEntries(Object.entries(bounds).map(([key, value]) => [key, `${value}px`])))
+ body.computed.clipPath = `inset(${inset.slice(0, 4).map(n => `${n}px`).join(' ')} round ${inset[4]}px)`
+ }
+ check(true)
+ find(tree, 'chat-open').props.onClick()
+ check(false)
+ find(tree, 'chat-open').props.onClick()
+ check(true)
+ for (const element of [shell, body, button, dialog]) {
+ for (const result of element.animate.mock.results) result.value.playState = 'finished'
+ }
+ Object.assign(shell.computed, { left: '-1px', top: '-1px', width: `${to.width}px`, height: `${to.height}px`, borderRadius: '12px' })
+ body.computed.clipPath = 'none'
+ find(tree, 'chat-open').props.onClick()
+ check(false)
+})
diff --git a/app/test/scrollFade.test.ts b/app/test/scrollFade.test.ts
new file mode 100644
index 00000000..5b9c1355
--- /dev/null
+++ b/app/test/scrollFade.test.ts
@@ -0,0 +1,26 @@
+import { readFileSync } from 'node:fs'
+import { expect, it } from 'vitest'
+
+it('uses the same fade for notes and transcript with no vertical space outside the note scroll viewport', () => {
+ const read = (path: string) => readFileSync(new URL(`../src/renderer/src/${path}`, import.meta.url), 'utf8')
+ const css = read('workspace.css')
+ const frame = css.match(/^\.note-reading-frame \{([^}]+)\}/m)![1]
+ expect(frame).toContain('margin:0 calc(')
+ expect(frame).toContain('padding:0 2px')
+ expect(css).toContain('.note-reading-clip { height:100%;overflow:hidden;border-radius:10px; }')
+ expect(css).toContain('.main-window .note-reading-clip>.note-notes-pane { height:100%;')
+ // Both panes use the approved shared default: moving the viewport must not change Transcript's fade.
+ expect(read('components/NoteReadingPane.tsx')).toContain('<ScrollFade enabled={active}><section')
+ expect(read('components/Transcript.tsx')).toContain('<ScrollFade enabled={active && loaded}><ol')
+ expect(read('components/ScrollFade.tsx')).toContain('size = 20')
+})
+
+it('keeps note text, generation rim and footer controls at their existing insets', () => {
+ const css = readFileSync(new URL('../src/renderer/src/workspace.css', import.meta.url), 'utf8')
+ // Moving 8px margin + 2px padding inside the scroller keeps the original 22px/40px text offsets.
+ expect(css).toContain('.note-reading-frame .note-notes-body { max-width:none;padding-block:22px 40px;padding-inline:12px 8px; }')
+ expect(css).toContain('.note-summary-rim { inset:8px 0;')
+ expect(css).toContain('.note-reading-frame::before { inset:8px 0; }')
+ expect(css).toMatch(/\.note-summary-status \{[^}]*bottom:18px;/)
+ expect(css).toMatch(/\.note-latest \{[^}]*bottom:18px;/)
+})