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: one set of timings, gentler curves, quick opens that match on click and shortcut, and steadier text

Eric Brownroutbfd6d8e20875
diff --git a/app/e2e/chat.spec.ts b/app/e2e/chat.spec.ts
index 1db3cc1a..158be9a0 100644
--- a/app/e2e/chat.spec.ts
+++ b/app/e2e/chat.spec.ts
@@ -324,7 +324,7 @@ test('an unacknowledged question cannot be sent twice, and a rejected request ke
})
-test('Ask grows out of its button without stretching its content, preserves its draft, and respects reduced motion', async () => {
+test('Ask grows from its button identically for either trigger and keeps typing available', async () => {
const { app, page } = await launch()
try {
const id = await fake<string>(app, 'bigMeeting', 10)
@@ -332,10 +332,15 @@ test('Ask grows out of its button without stretching its content, preserves its
await page.emulateMedia({ reducedMotion: 'no-preference' })
const trigger = page.getByTestId('chat-open')
await trigger.click()
- // only the surface stretches out of the button; the chat inside keeps its size
- const shell = page.locator('.chat-morph-surface')
- const frames = await shell.evaluate((el) => el.getAnimations().map(a => (a.effect as KeyframeEffect).getKeyframes()).find(k => k.some(f => f.transform)))
- expect(frames?.at(-1)?.transform).toBe('none')
+ 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)))
+ 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')
+ 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')
await page.getByTestId('chat-input').fill('Keep this thought')
@@ -344,14 +349,14 @@ test('Ask grows out of its button without stretching its content, preserves its
await expect(trigger).toBeFocused()
await page.keyboard.press('Meta+j')
await expect(page.getByTestId('chat-input')).toBeFocused()
- // ⌘J grows it out of the button too
- expect(await shell.evaluate(el => el.getAnimations().length)).toBeGreaterThan(0)
+ expect(await surface.evaluate(el => el.getAnimations().map(a => a.effect!.getTiming().duration))).toEqual([180, 120])
await page.keyboard.press('Escape')
await expect(trigger).toBeFocused()
await page.emulateMedia({ reducedMotion: 'reduce' })
await page.keyboard.press('Meta+j')
await expect(page.getByTestId('chat-input')).toHaveValue('Keep this thought')
- expect(await shell.evaluate((el) => el.getAnimations().length)).toBe(0)
+ await expect(panel).toHaveCSS('transform', 'none')
+ expect(await panel.evaluate(el => el.getAnimations().map(a => a.effect!.getTiming().duration))).toEqual([120])
await page.keyboard.press('Escape')
await expect(trigger).toBeFocused()
} finally { await app.close() }
diff --git a/app/e2e/chatEntrance.spec.ts b/app/e2e/chatEntrance.spec.ts
index 5692744c..7feb2ef2 100644
--- a/app/e2e/chatEntrance.spec.ts
+++ b/app/e2e/chatEntrance.spec.ts
@@ -53,7 +53,7 @@ test('Ask starters hide without moving the landing layout', async ({}, info) =>
const title = page.locator('.ask-home-title'), titleBox = await title.boundingBox()
await page.getByTestId('chat-page-input').fill('@')
await expect(page.getByTestId('chat-starter').first()).toBeHidden()
- await expect(page.getByTestId('chat-starters')).toHaveCSS('transition-duration', '0s')
+ await expect(page.getByTestId('chat-starters')).toHaveCSS('transition-duration', '0.12s, 0s')
expect(await title.boundingBox()).toEqual(titleBox)
}
} finally { await app.close() }
diff --git a/app/e2e/folders.spec.ts b/app/e2e/folders.spec.ts
index c12ef03e..8d1e26e1 100644
--- a/app/e2e/folders.spec.ts
+++ b/app/e2e/folders.spec.ts
@@ -34,7 +34,7 @@ const openNote = async (page: Page, title: string) => {
await expect(page.getByTestId('note-title')).toHaveText(title)
}
-test('folder icons stay still and Trash animates once on hover in either sidebar size and respect reduced motion', async () => {
+test('folder and Trash icons stay still on hover in either sidebar size and respect reduced motion', async () => {
const { app, page } = await launch()
try {
await page.emulateMedia({ reducedMotion: 'no-preference' })
@@ -46,7 +46,7 @@ test('folder icons stay still and Trash animates once on hover in either sidebar
const svg = row.locator('svg').first()
await expect(svg).toHaveCSS('animation-name', 'none')
await row.hover()
- await expect(svg).toHaveCSS('animation-name', await row.getAttribute('data-testid') === 'nav-trash' ? 'icon-lift' : 'none')
+ await expect(svg).toHaveCSS('animation-name', 'none')
await expect(svg).toHaveCSS('animation-iteration-count', '1')
await page.emulateMedia({ reducedMotion: 'reduce' })
await expect(svg).toHaveCSS('animation-name', 'none')
diff --git a/app/e2e/liveTranscript.spec.ts b/app/e2e/liveTranscript.spec.ts
index e5322d20..d724be1d 100644
--- a/app/e2e/liveTranscript.spec.ts
+++ b/app/e2e/liveTranscript.spec.ts
@@ -110,14 +110,14 @@ test('the live transcript reads like a conversation: your bubbles at the end, th
} finally { await app.close() }
})
-test('with reduced motion, live words show at once and the dots hold still', async () => {
+test('with reduced motion, live words fade briefly and the dots hold still', async () => {
const { app, page } = await launch({ YOGURT_FAKE_SPEECH: '1' })
try {
await page.emulateMedia({ reducedMotion: 'reduce' })
await start(app, page)
const live = page.getByTestId('transcript-partial').first()
await expect(live).toBeVisible({ timeout: 15_000 })
- expect(await live.evaluate((el) => [getComputedStyle(el.querySelector('.live-word')!).animationName, getComputedStyle(el.querySelector('.live-dots i')!).animationName])).toEqual(['none', 'none'])
+ expect(await live.evaluate((el) => [getComputedStyle(el.querySelector('.live-word')!).animationName, getComputedStyle(el.querySelector('.live-dots i')!).animationName])).toEqual(['motion-fade', 'none'])
} finally { await app.close() }
})
diff --git a/app/e2e/loadingAndFeedback.spec.ts b/app/e2e/loadingAndFeedback.spec.ts
index a6b45bac..077d9aba 100644
--- a/app/e2e/loadingAndFeedback.spec.ts
+++ b/app/e2e/loadingAndFeedback.spec.ts
@@ -94,7 +94,7 @@ test('toast yields to Ask Yogurt and returns without replacing its Undo action',
return !!a && !!b && a.x + a.width + 10 <= b.x
}).toBe(true)
await toast.hover()
- await page.locator('.chat-morph-surface').evaluate(el => Promise.allSettled(el.getAnimations().map(a => a.finished)))
+ await page.getByTestId('chat-panel').evaluate(el => Promise.allSettled(el.getAnimations({ subtree: true }).map(a => a.finished)))
await page.emulateMedia({ colorScheme: 'dark' })
await page.screenshot({ path: testInfo.outputPath('toast-beside-chat.png') })
await page.getByTestId('chat-close').click()
@@ -106,7 +106,7 @@ test('toast yields to Ask Yogurt and returns without replacing its Undo action',
const a = await toast.boundingBox(), b = await page.getByTestId('chat-panel').boundingBox()
return !!a && !!b && b.y + b.height + 8 <= a.y
}).toBe(true)
- await page.locator('.chat-morph-surface').evaluate(el => Promise.allSettled(el.getAnimations().map(a => a.finished)))
+ await page.getByTestId('chat-panel').evaluate(el => Promise.allSettled(el.getAnimations({ subtree: true }).map(a => a.finished)))
await page.screenshot({ path: testInfo.outputPath('toast-narrow-chat.png') })
await page.getByTestId('trash-undo').click()
await expect(toast).toHaveCount(0)
diff --git a/app/e2e/menuMotion.spec.ts b/app/e2e/menuMotion.spec.ts
index 0cc8081d..6f379c4a 100644
--- a/app/e2e/menuMotion.spec.ts
+++ b/app/e2e/menuMotion.spec.ts
@@ -26,7 +26,7 @@ async function launch() {
const motion = (surface: Locator) => surface.evaluate((el) => {
const style = getComputedStyle(el), origin = style.transformOrigin.split(' ').map(parseFloat)
- return { animation: style.animationName, x: origin[0], y: origin[1], width: (el as HTMLElement).offsetWidth }
+ return { transition: style.transitionProperty, duration: style.transitionDuration, x: origin[0], y: origin[1], width: (el as HTMLElement).offsetWidth }
})
test('keyboard menus open without animation, focus immediately and dismiss back to their triggers', async () => {
@@ -38,7 +38,7 @@ test('keyboard menus open without animation, focus immediately and dismiss back
await trigger.focus()
await page.keyboard.press(key)
await expect(surface).toBeVisible()
- expect((await motion(surface)).animation).toBe('none')
+ expect((await motion(surface)).duration).toBe('0s')
await expect(page.getByTestId(menu.first)).toBeFocused()
await page.keyboard.press('Escape')
await expect(surface).toHaveCount(0)
@@ -47,7 +47,7 @@ test('keyboard menus open without animation, focus immediately and dismiss back
} finally { await app.close() }
})
-test('pointer menus share anchored entry in LTR and RTL; reduced motion removes it without delaying focus', async () => {
+test('pointer menus share anchored entry in LTR and RTL; reduced motion keeps only the short fade without delaying focus', async () => {
const { app, page } = await launch()
try {
await page.emulateMedia({ reducedMotion: 'no-preference' })
@@ -58,7 +58,8 @@ test('pointer menus share anchored entry in LTR and RTL; reduced motion removes
await page.getByTestId(menu.trigger).click()
await expect(surface).toBeVisible()
const actual = await motion(surface)
- expect(actual.animation).not.toBe('none')
+ expect(actual.transition).toBe('opacity, transform')
+ expect(actual.duration).toBe('0.18s, 0.18s')
expect(actual.y).toBe(0)
const left = menu.logical && (menu.end ? dir === 'rtl' : dir === 'ltr')
expect(actual.x).toBeCloseTo(left ? 0 : actual.width, 1)
@@ -72,7 +73,8 @@ test('pointer menus share anchored entry in LTR and RTL; reduced motion removes
const surface = page.getByTestId(menu.surface)
await page.getByTestId(menu.trigger).click()
await expect(surface).toBeVisible()
- expect((await motion(surface)).animation).toBe('none')
+ expect((await motion(surface)).transition).toBe('opacity')
+ expect((await motion(surface)).duration).toBe('0.12s')
await expect(page.getByTestId(menu.first)).toBeFocused()
await page.keyboard.press('Escape')
await expect(surface).toHaveCount(0)
diff --git a/app/e2e/modalMotion.spec.ts b/app/e2e/modalMotion.spec.ts
index dee17e05..139d7328 100644
--- a/app/e2e/modalMotion.spec.ts
+++ b/app/e2e/modalMotion.spec.ts
@@ -3,7 +3,7 @@ import { mkdtempSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
-test('shared dialogs use the animated shell, keep focus safe, and dismiss without opening commands', async () => {
+test('shared dialogs use one soft surface, keep focus safe, and dismiss without opening commands', async () => {
const app = await electron.launch({ args: [join(import.meta.dirname, '../out/main/index.js')], env: {
...process.env, YOGURT_FAKE: '1', YOGURT_USER_DATA: mkdtempSync(join(tmpdir(), 'yogurt-modal-motion-')),
} })
@@ -12,49 +12,41 @@ test('shared dialogs use the animated shell, keep focus safe, and dismiss withou
await expect(page.getByTestId('home')).toBeVisible()
await page.emulateMedia({ reducedMotion: 'no-preference' })
const trigger = page.getByTestId('folder-create')
- await trigger.click()
- const modal = page.getByTestId('folder-name')
- await expect(modal).toBeVisible()
- await expect.poll(() => modal.locator('.dialog-motion-surface').evaluate(el => el.getAnimations().length)).toBe(1)
- const motion = await modal.evaluate(async el => {
- const shell = el.querySelector<HTMLElement>('.dialog-motion-surface')!
- const content = el.querySelector<HTMLElement>('.dialog-motion-content')!
- const animation = shell.getAnimations()[0]
- const timing = animation.effect!.getTiming()
- // Seek the real animation so a busy CI worker cannot miss its short opening.
- animation.pause()
+ const capture = page.evaluate(async () => {
+ let el: HTMLElement | null = null, animations: Animation[] = []
+ for (let frame = 0; frame < 120; frame++) {
+ await new Promise(requestAnimationFrame)
+ el = document.querySelector('[data-testid="folder-name"]')
+ animations = el?.getAnimations() ?? []
+ if (animations.length) break
+ }
+ if (!el || !animations.length) throw new Error('Dialog entry did not animate')
+ animations.forEach(a => a.pause())
+ const durations = animations.map(a => a.effect!.getTiming().duration)
const samples = []
- for (const time of [0, 280 * .72, 280]) {
- animation.currentTime = time
+ for (const time of [0, 144, 240]) {
+ animations.forEach(a => { a.currentTime = time })
await new Promise(requestAnimationFrame)
- const shape = getComputedStyle(shell), text = getComputedStyle(content)
- const matrix = new DOMMatrix(shape.transform)
- const box = content.getBoundingClientRect()
- samples.push({
- scaleX: matrix.m11, scaleY: matrix.m22, y: matrix.m42, opacity: Number(shape.opacity),
- outerTransform: getComputedStyle(el).transform, textTransform: text.transform, textFilter: text.filter,
- box: { x: box.x, y: box.y, width: box.width, height: box.height },
- })
+ const style = getComputedStyle(el), matrix = new DOMMatrix(style.transform)
+ samples.push({ scaleX: matrix.m11, scaleY: matrix.m22, opacity: Number(style.opacity) })
}
- animation.finish()
- return { samples, duration: timing.duration, iterations: timing.iterations }
+ animations.forEach(a => a.finish())
+ return { durations, samples }
})
- expect(motion.duration).toBe(280)
- expect(motion.iterations).toBe(1)
- for (const [frame, expected] of motion.samples.map((frame, i) => [frame, [
- { scaleX: .94, scaleY: .86, y: 12, opacity: 0 },
- { scaleX: 1.008, scaleY: 1.018, y: -1, opacity: 1 },
- { scaleX: 1, scaleY: 1, y: 0, opacity: 1 },
- ][i]] as const)) {
- expect(frame.scaleX).toBeCloseTo(expected.scaleX, 3)
- expect(frame.scaleY).toBeCloseTo(expected.scaleY, 3)
- expect(frame.y).toBeCloseTo(expected.y, 3)
- expect(frame.opacity).toBeCloseTo(expected.opacity, 3)
- expect(frame.outerTransform).toBe('none')
- expect(frame.textTransform).toBe('none')
- expect(frame.textFilter).toBe('none')
- expect(frame.box).toEqual(motion.samples[0].box)
+ await trigger.click()
+ const modal = page.getByTestId('folder-name')
+ await expect(modal).toBeVisible()
+ const motion = await capture
+ expect(motion.durations.every(duration => duration === 240)).toBe(true)
+ expect(motion.samples[0].scaleX).toBeCloseTo(.97, 3)
+ expect(motion.samples[0].opacity).toBe(0)
+ for (const sample of motion.samples) {
+ expect(sample.scaleX).toBeCloseTo(sample.scaleY, 4)
+ expect(sample.scaleX).toBeLessThanOrEqual(1.02)
}
+ expect(motion.samples.at(-1)!.scaleX).toBeCloseTo(1, 3)
+ expect(motion.samples.at(-1)!.opacity).toBe(1)
+ await expect(modal.locator('.dialog-motion-surface,.dialog-motion-content')).toHaveCount(0)
await expect(page.locator('.app-modal-backdrop')).toBeVisible()
await expect(page.getByTestId('folder-name-input')).toBeFocused()
await page.keyboard.press('Meta+k')
@@ -65,11 +57,10 @@ test('shared dialogs use the animated shell, keep focus safe, and dismiss withou
await page.emulateMedia({ reducedMotion: 'reduce' })
await trigger.click()
await expect(page.getByTestId('folder-name-input')).toBeFocused()
- await expect(modal.locator('.dialog-motion-surface')).toHaveCSS('transform', 'none')
- await expect(modal.locator('.dialog-motion-content')).toHaveCSS('filter', 'none')
- expect(await modal.evaluate(el => el.getAnimations({ subtree: true }).length)).toBe(0)
- const reducedBox = await modal.locator('.dialog-motion-content').boundingBox()
- expect(reducedBox).toEqual(motion.samples.at(-1)!.box)
+ await expect(modal).toHaveCSS('transform', 'none')
+ await expect(modal).toHaveCSS('filter', 'none')
+ await expect(modal).toHaveCSS('transition-property', 'opacity')
+ await expect(modal).toHaveCSS('transition-duration', '0.12s')
await page.getByTestId('folder-name-cancel').click()
await expect(modal).toHaveCount(0)
await expect(trigger).toBeFocused()
diff --git a/app/e2e/noteTools.spec.ts b/app/e2e/noteTools.spec.ts
index 4f3c7dd7..fe61f1b4 100644
--- a/app/e2e/noteTools.spec.ts
+++ b/app/e2e/noteTools.spec.ts
@@ -30,7 +30,7 @@ test('meeting tools expose all copy choices, an anchored search, and a multiline
await search.click()
expect((await field.boundingBox())!.width).toBe(224)
await expect(field).toHaveCSS('transition-property', 'background-color, border-color')
- await expect(field).toHaveCSS('transition-duration', '0.1s, 0.1s')
+ await expect(field).toHaveCSS('transition-duration', '0.12s, 0.12s')
await expect(field).toHaveCSS('box-shadow', 'none')
await expect(search).toHaveCSS('text-align', 'start')
await page.getByTestId('note-transcript-toggle').click()
diff --git a/app/e2e/recordingReminder.spec.ts b/app/e2e/recordingReminder.spec.ts
index 03294278..538b987c 100644
--- a/app/e2e/recordingReminder.spec.ts
+++ b/app/e2e/recordingReminder.spec.ts
@@ -35,7 +35,7 @@ for (const theme of ['light', 'dark'] as const) test(`standard recording reminde
return !!a && !!b && a.x + a.width + 10 <= b.x
}).toBe(true)
await toast.hover()
- await page.locator('.chat-morph-surface').evaluate(el => Promise.allSettled(el.getAnimations().map(a => a.finished)))
+ await page.getByTestId('chat-panel').evaluate(el => Promise.allSettled(el.getAnimations({ subtree: true }).map(a => a.finished)))
await page.screenshot({ path: info.outputPath(`reminder-${theme}-ask.png`) })
await page.keyboard.press('F6')
await toast.getByRole('button', { name: 'Close', exact: true }).focus()
diff --git a/app/e2e/sidebarIcons.spec.ts b/app/e2e/sidebarIcons.spec.ts
index f5fb5223..2085abd3 100644
--- a/app/e2e/sidebarIcons.spec.ts
+++ b/app/e2e/sidebarIcons.spec.ts
@@ -38,22 +38,22 @@ for (const theme of ['light', 'dark'] as const) test(`sidebar icon scope and mot
}
await svg.evaluate(el => { el.getAnimations({ subtree: true }).forEach(a => a.finish()) })
}
- const hover = async (id: string, motion: string | null) => {
+ const hover = async (id: string) => {
const control = page.getByTestId(id), svg = control.locator('svg').first()
await page.mouse.move(600, 80)
await expect.poll(() => names(svg)).toEqual([])
await control.hover()
- await expect.poll(() => names(svg)).toEqual(motion === 'icon-write' ? [motion, motion] : motion ? [motion] : [])
+ await expect.poll(() => names(svg)).toEqual([])
await saveFrames(control, id)
await page.emulateMedia({ colorScheme: theme, reducedMotion: 'reduce' })
await expect.poll(() => names(svg)).toEqual([])
await page.emulateMedia({ colorScheme: theme, reducedMotion: 'no-preference' })
}
- for (const [id, motion] of [['nav-home', 'icon-write'], ['nav-chat', 'icon-write'], ['settings-open', 'icon-turn']] as const) await hover(id, motion)
- await hover('nav-trash', 'icon-lift')
- await hover('search-open', null)
+ for (const id of ['nav-home', 'nav-chat', 'settings-open']) await hover(id)
+ await hover('nav-trash')
+ await hover('search-open')
await page.evaluate(() => window.yogurt.folders.create('Project'))
- await hover('sidebar-folder-open', null)
+ await hover('sidebar-folder-open')
await page.mouse.move(600, 80)
const search = page.getByTestId('search-open').locator('svg')
await expect(search).toHaveAttribute('width', '16')
@@ -67,7 +67,7 @@ for (const theme of ['light', 'dark'] as const) test(`sidebar icon scope and mot
})
writeFileSync(testInfo.outputPath('icon-review', theme, 'search.svg'), svg)
}
- await hover('sidebar-collapse', null)
+ await hover('sidebar-collapse')
await page.getByTestId('sidebar-collapse').click()
const expand = page.getByTestId('sidebar-expand')
await expect(expand).toHaveAttribute('aria-expanded', 'false')
@@ -87,15 +87,15 @@ for (const theme of ['light', 'dark'] as const) test(`sidebar icon scope and mot
await page.keyboard.press('Control+Meta+s')
await expect(page.getByTestId('sidebar-expand').locator('.sidebar-toggle-pane')).toHaveCSS('transition-duration', '0s')
await page.keyboard.press('Control+Meta+s')
- await hover('chat-open', null)
- await hover('share-button', null)
+ await hover('chat-open')
+ await hover('share-button')
await page.getByTestId('share-button').click()
- for (const id of ['share-copy-notes', 'share-copy-summary', 'share-copy-transcript']) await hover(id, null)
+ for (const id of ['share-copy-notes', 'share-copy-summary', 'share-copy-transcript']) await hover(id)
await page.keyboard.press('Escape')
await page.getByTestId('chat-open').click()
await page.getByTestId('chat-input').fill('When does the site go live?')
await page.getByTestId('chat-input').press('Enter')
await expect(page.getByTestId('chat-copy-answer')).toBeVisible({ timeout: 20000 })
- await hover('chat-copy-answer', null)
+ await hover('chat-copy-answer')
} finally { await app.close() }
})
diff --git a/app/e2e/sidebarMotion.spec.ts b/app/e2e/sidebarMotion.spec.ts
index ec144a49..42d98042 100644
--- a/app/e2e/sidebarMotion.spec.ts
+++ b/app/e2e/sidebarMotion.spec.ts
@@ -40,22 +40,26 @@ test('sidebar reveal keeps its toggle anchored and can reverse before it finishe
const 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-gap { transition-duration:60s!important; }' })
- await gap.evaluate(async () => {
+ const motionStyle = await page.addStyleTag({ content: '.workspace-sidebar { transition-duration:60s!important; }' })
+ await sidebar.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(() => gap.evaluate((el) => {
+ await expect.poll(() => sidebar.evaluate((el) => {
const animation = el.getAnimations().find(a => a instanceof CSSTransition && a.transitionProperty === 'width')
if (!animation) return false
animation.pause(); animation.currentTime = 18_000
return true
})).toBe(true)
- const midway = await gap.evaluate(el => el.getBoundingClientRect().width)
+ 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)
expect(midway).toBeGreaterThan(56)
expect(midway).toBeLessThan(208)
await motionStyle.evaluate(el => { el.parentNode?.removeChild(el) })
@@ -204,7 +208,7 @@ test('keyboard, reduced motion and narrow-window sidebar changes remain immediat
} finally { await app.close() }
})
-test('a note keeps its title, transcript and controls in place at the start of both sidebar directions', async () => {
+test('a note adopts its final layout once and stays still throughout 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 }))
@@ -226,18 +230,25 @@ test('a note keeps its title, transcript and controls in place at the start of b
await 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] - before[i][key]), `${selectors[i]} ${key}, window ${width}`).toBeLessThan(1)
+ expect(Math.abs(start[i][key] - middle[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/Agenda.tsx b/app/src/renderer/src/components/Agenda.tsx
index c83f7995..52fd6d15 100644
--- a/app/src/renderer/src/components/Agenda.tsx
+++ b/app/src/renderer/src/components/Agenda.tsx
@@ -11,7 +11,7 @@ import { pickNext } from '../../../shared/comingUp'
import { daysAgo, timeOf, useDay } from '../dates'
import { eventPhase, shiftDay, weekDates } from '../agenda'
import { useAgendaCard } from '../useAgendaCard'
-import { scrollBehavior, surfaceMotion } from '../motion'
+import { motion, scrollBehavior, usePopoverPresence } from '../motion'
import { peopleSummary, personName, useMyName } from './People'
type Actions = {
@@ -21,7 +21,7 @@ type Actions = {
}
type Day = { at: number; status: CalendarStatus; events: AgendaEvent[] }
-type Inspection = { at: number; id: string }
+type Inspection = { at: number; id: string; pointer: boolean }
let lastView: { selected: number; week: number } | undefined
let lastDay: Day | undefined
let watchingCalendars = false
@@ -95,6 +95,8 @@ export function Agenda({ revision, recording, onStart, onOpen }: Actions & { rev
const primary = pickNext(events, now)
const defaultEvent = relativeDay === 0 ? events.find(e => e.id === primary) ?? events.find(e => e.start > now) ?? events.at(-1) : events[0]
const detail = inspected?.at === selected ? events.find(e => e.id === inspected.id) : undefined
+ const presence = usePopoverPresence(detail, !!inspected?.pointer)
+ const shownDetail = presence.value
useLayoutEffect(() => {
if (!defaultEvent || !scroll.current) return
const key = `${selected}/${jump}`
@@ -136,15 +138,15 @@ export function Agenda({ revision, recording, onStart, onOpen }: Actions & { rev
</section>
: <div data-testid="coming-up" className="agenda-events">
{calendar.events.length === 0 ? <div className="agenda-status"><CalendarDays size={18} strokeWidth={1.75} aria-hidden="true" /><h3>{t('No meetings')}</h3><p>{t('Your calendar is clear.')}</p></div>
- : calendar.events.map((event) => <Event key={event.id} event={event} me={me} now={now} near={event.id === primary} initial={event.id === defaultEvent?.id} selected={event.id === detail?.id} onInspect={button => { opener.current = button; setInspected({ at: selected, id: event.id }) }} recording={recording} />)}
+ : calendar.events.map((event) => <Event key={event.id} event={event} me={me} now={now} near={event.id === primary} initial={event.id === defaultEvent?.id} selected={event.id === detail?.id} onInspect={(button, pointer) => { opener.current = button; setInspected({ at: selected, id: event.id, pointer }) }} recording={recording} />)}
</div>)}
</LoadingContent></div></ScrollFade>
- {calendar?.status === 'granted' && detail && <EventDetails key={detail.id} event={detail} recording={recording} onStart={onStart} now={now} onOpen={onOpen} onClose={closeDetails} opener={opener.current} />}
+ {calendar?.status === 'granted' && shownDetail && <EventDetails motionProps={presence.props} key={shownDetail.id} event={shownDetail} recording={recording} onStart={onStart} now={now} onOpen={onOpen} onClose={closeDetails} opener={opener.current} />}
</aside>
}
export function Event({ event, me, now, near, initial, selected, onInspect, recording, loading = false }: Pick<Actions, 'recording'> & {
- loading?: boolean; event: AgendaEvent; me: string; now: number; near: boolean; initial: boolean; selected: boolean; onInspect: (button: HTMLButtonElement) => void
+ loading?: boolean; event: AgendaEvent; me: string; now: number; near: boolean; initial: boolean; selected: boolean; onInspect: (button: HTMLButtonElement, pointer: boolean) => void
}) {
const phase = eventPhase(event, now)
const mine = recording?.eventId === event.id
@@ -158,7 +160,7 @@ export function Event({ event, me, now, near, initial, selected, onInspect, reco
const to = el.getBoundingClientRect().height
height.current = to
if (!loading && from !== undefined && from !== to && scrollBehavior() !== 'auto') {
- animation.current = el.animate([{ height: `${from}px` }, { height: `${to}px` }], { duration: surfaceMotion.resizeMs, easing: surfaceMotion.settleEase })
+ animation.current = el.animate([{ height: `${from}px` }, { height: `${to}px` }], { duration: motion.base, easing: motion.ease })
}
})
useEffect(() => () => animation.current?.cancel(), [])
@@ -167,7 +169,7 @@ export function Event({ event, me, now, near, initial, selected, onInspect, reco
<div className="agenda-time">{loading ? <span className="loading-bar" style={{ width: 45 }} /> : timeOf(event.start)}</div>
<div className="agenda-event-body">
<div className="agenda-heading">
- <h3><button disabled={loading} data-testid={loading ? undefined : "event-details"} className="agenda-title" aria-expanded={selected} aria-controls={selected ? "agenda-event-details" : undefined} onClick={e => onInspect(e.currentTarget)}>{loading ? <span className="loading-bar" style={{ width: '85%' }} /> : event.title || t('Meeting')}</button></h3>
+ <h3><button disabled={loading} data-testid={loading ? undefined : "event-details"} className="agenda-title" aria-expanded={selected} aria-controls={selected ? "agenda-event-details" : undefined} onClick={e => onInspect(e.currentTarget, e.detail > 0)}>{loading ? <span className="loading-bar" style={{ width: '85%' }} /> : event.title || t('Meeting')}</button></h3>
{!loading && marker && <span className="agenda-marker" role="img" aria-label={marker}>
{mine ? <LevelBars height={14} className="agenda-levels" testId="agenda-recording-levels" paused={recording.paused} stillBars /> : <FileText size={13} strokeWidth={1.75} aria-hidden="true" />}
</span>}
@@ -178,7 +180,7 @@ export function Event({ event, me, now, near, initial, selected, onInspect, reco
</article>
}
-function EventDetails({ event, recording, onOpen, onStart, now, onClose, opener }: { event: AgendaEvent; now: number; onClose: (restoreFocus?: boolean) => void; opener: HTMLButtonElement | null } & Pick<Actions, 'recording' | 'onOpen' | 'onStart'>) {
+function EventDetails({ motionProps, event, recording, onOpen, onStart, now, onClose, opener }: { motionProps: ReturnType<typeof usePopoverPresence>['props']; event: AgendaEvent; now: number; onClose: (restoreFocus?: boolean) => void; opener: HTMLButtonElement | null } & Pick<Actions, 'recording' | 'onOpen' | 'onStart'>) {
const panel = useRef<HTMLDialogElement>(null)
const scroll = useRef<HTMLDivElement>(null)
const [expanded, setExpanded] = useState(false)
@@ -200,6 +202,7 @@ function EventDetails({ event, recording, onOpen, onStart, now, onClose, opener
}
useAgendaCard(panel, opener, onClose)
useEffect(() => {
+ if (motionProps.inert) return
const el = panel.current!
const outside = (e: PointerEvent) => { if (!el.contains(e.target as Node) && !opener?.contains(e.target as Node)) onClose(false) }
const escape = (e: KeyboardEvent) => {
@@ -209,9 +212,9 @@ function EventDetails({ event, recording, onOpen, onStart, now, onClose, opener
document.addEventListener('pointerdown', outside)
document.addEventListener('keydown', escape, true)
return () => { document.removeEventListener('pointerdown', outside); document.removeEventListener('keydown', escape, true) }
- }, [onClose, opener])
+ }, [onClose, opener, motionProps.inert])
const url = event.url?.trim()
- return <dialog ref={panel} id="agenda-event-details" data-testid="event-details-content" className="agenda-inspector" aria-labelledby="agenda-detail-title" onCancel={e => { e.preventDefault(); onClose() }}>
+ return <dialog {...motionProps} ref={panel} id="agenda-event-details" data-testid="event-details-content" className="agenda-inspector menu-entry" aria-labelledby="agenda-detail-title" onCancel={e => { e.preventDefault(); onClose() }}>
<i className="agenda-inspector-arrow" aria-hidden="true" />
<div className="agenda-inspector-content">
<div className="agenda-inspector-heading"><h3 id="agenda-detail-title" tabIndex={-1}>{event.title || t('Meeting')}</h3>
diff --git a/app/src/renderer/src/components/AskConversation.tsx b/app/src/renderer/src/components/AskConversation.tsx
index 66e581fb..c58d491b 100644
--- a/app/src/renderer/src/components/AskConversation.tsx
+++ b/app/src/renderer/src/components/AskConversation.tsx
@@ -27,11 +27,12 @@ const starters = (chips: ContextTarget[], recording: boolean) => chips.length ==
: [t('What are my next steps this week?'), t('What did we decide last week?'), t('Catch me up on yesterday')]
/** One composer and thread for both the page and the note panel. Draft writes never wait for the model. */
-export function AskConversation({ id, initial, home = false, panel = false, recording = false, onSelect, onSource, onDeleted, onClose, onExpand }: {
- id: string; initial?: ConversationView; home?: boolean; panel?: boolean; recording?: boolean; onDeleted: () => void; onClose?: () => void; onExpand?: () => void; onSelect: (id: string) => void; onSource: (source: LibrarySource, match?: string) => void
+export function AskConversation({ id, pendingDraftKey, initial, home = false, panel = false, recording = false, onSelect, onSource, onDeleted, onClose, onExpand }: {
+ id: string; pendingDraftKey?: string; initial?: ConversationView; home?: boolean; panel?: boolean; recording?: boolean; onDeleted: () => void; onClose?: () => void; onExpand?: () => void; onSelect: (id: string) => void; onSource: (source: LibrarySource, match?: string) => void
}) {
const [chat, setChat] = useState(initial)
- const [text, setText] = useState(drafts.get(id) ?? initial?.draft ?? '')
+ const [text, setText] = useState((pendingDraftKey ? drafts.get(pendingDraftKey) : undefined) ?? drafts.get(id) ?? initial?.draft ?? '')
+ const edited = useRef(false)
const [error, setError] = useState(false)
const [sending, setSending] = useState(false)
const [changing, setChanging] = useState(false)
@@ -49,7 +50,16 @@ export function AskConversation({ id, initial, home = false, panel = false, reco
useEffect(() => {
if (!id) return
let active = true, revision = 0
- setError(false); setMention(undefined)
+ setError(false)
+ const pending = pendingDraftKey ? drafts.get(pendingDraftKey) : undefined
+ if (pending !== undefined) {
+ edited.current = true
+ drafts.set(id, pending)
+ drafts.delete(pendingDraftKey!)
+ void window.yogurt.conversations.draft(id, pending).then(() => {
+ if (drafts.get(id) === pending) drafts.delete(id)
+ }).catch(() => { if (active) setError(true) })
+ }
const off = window.yogurt.conversations.onChange(v => { if (v.id === id) { revision++; setChat(v) } })
const load = (first = false) => {
const request = ++revision
@@ -58,7 +68,7 @@ export function AskConversation({ id, initial, home = false, panel = false, reco
if (!v) throw new Error('Conversation not found')
if (request === revision) setChat(v)
if (first) {
- if (!initial) setText(drafts.get(id) ?? v.draft)
+ if (!initial && !edited.current) setText(drafts.get(id) ?? v.draft)
}
}).catch(() => { if (active && request === revision) setError(true) })
}
@@ -93,7 +103,10 @@ export function AskConversation({ id, initial, home = false, panel = false, reco
const landing = home || (!panel && unsent)
const chips = chat ? attachContext(chat.chips, chat.draftChips) : []
const saveText = (value: string) => {
- setText(value); drafts.set(id, value)
+ edited.current = true
+ setText(value)
+ if (id || pendingDraftKey) drafts.set(id || pendingDraftKey!, value)
+ if (!id) return
void window.yogurt.conversations.draft(id, value).then(() => { if (drafts.get(id) === value) drafts.delete(id) }).catch(() => setError(true))
}
const detectMention = (value: string, caret: number) => {
@@ -172,12 +185,12 @@ export function AskConversation({ id, initial, home = false, panel = false, reco
</div>
<div className={`ask-composer${panel ? ' chat-composer' : ''}`}>
{error && <p data-testid={panel ? "chat-send-error" : "chat-page-error"} role="alert" className="chat-error">{t("Couldn't save your changes")}</p>}
- <LoadingContent pending={!chat && !error} onReady={() => { if (chat) input.current?.focus({ preventScroll: true }) }} testId={landing ? "chat-loading" : undefined}><form className="ask-box" data-busy={busy || undefined} data-testid={`${prefix}-box`} onSubmit={e => { e.preventDefault(); send(text) }} onBlur={e => { if (!e.currentTarget.contains(e.relatedTarget)) setMention(undefined) }}>
+ <LoadingContent pending={!panel && !chat && !error} onReady={() => { if (chat) input.current?.focus({ preventScroll: true }) }} testId={landing ? "chat-loading" : undefined}><form className="ask-box" data-busy={busy || undefined} data-testid={`${prefix}-box`} onSubmit={e => { e.preventDefault(); send(text) }} onBlur={e => { if (!e.currentTarget.contains(e.relatedTarget)) setMention(undefined) }}>
<span className="ask-border" aria-hidden="true" />
<AskContext chips={chips} disabled={busy} onRemove={remove} />
<div className="ask-field">
- <textarea ref={input} id={panel ? 'meeting-question' : 'library-question'} data-testid={`${prefix}-input`} rows={1} maxLength={4000}
- placeholder={panel ? t('Ask anything') : t('Ask about your meetings')} aria-label={panel ? t('Ask anything') : t('Ask about your meetings')} value={text} disabled={!chat} readOnly={sending || changing}
+ <textarea autoFocus={panel} ref={input} id={panel ? 'meeting-question' : 'library-question'} data-testid={`${prefix}-input`} rows={1} maxLength={4000}
+ placeholder={panel ? t('Ask anything') : t('Ask about your meetings')} aria-label={panel ? t('Ask anything') : t('Ask about your meetings')} value={text} disabled={!panel && !chat} readOnly={sending || changing}
role="combobox" aria-autocomplete="list" aria-expanded={!!mention} aria-controls={mention ? `${prefix}-contexts` : undefined}
aria-activedescendant={mention && targets[selected] ? `${prefix}-context-${selected}` : undefined}
onChange={e => { saveText(e.target.value); detectMention(e.target.value, e.target.selectionStart) }}
diff --git a/app/src/renderer/src/components/Chat.tsx b/app/src/renderer/src/components/Chat.tsx
index 95fce6ba..19215918 100644
--- a/app/src/renderer/src/components/Chat.tsx
+++ b/app/src/renderer/src/components/Chat.tsx
@@ -1,25 +1,26 @@
import { useEffect, useLayoutEffect, useRef, useState } from 'react'
import { createPortal } from 'react-dom'
-import { X } from 'lucide-react'
import type { LibrarySource } from '../../../shared/types'
import { t } from '../../../shared/i18n'
import { keys, onMac } from '../keys'
import { MessageCircle } from './Icons'
import { setToastDialog } from './TrashToast'
import { AskConversation } from './AskConversation'
+import { motion as timing } from '../motion'
import { rememberScrollPositions } from '../useScrollMemory'
/** The existing panel shell; its conversation and composer are shared with the Ask page. */
export function Ask({ id, recording, anchor, onSource }: { id: string; recording: boolean; anchor: HTMLElement | null; onSource: (s: LibrarySource, match?: string) => void }) {
const [open, setOpen] = useState(false)
const [conversationId, setConversationId] = useState<string>()
+ const [conversationVersion, setConversationVersion] = useState(0)
const [error, setError] = useState(false)
const [narrow, setNarrow] = useState(() => window.matchMedia('(max-width: 999px)').matches)
const trigger = useRef<HTMLButtonElement>(null)
const panel = useRef<HTMLDialogElement>(null)
const surface = useRef<HTMLDivElement>(null)
const contents = useRef<HTMLDivElement>(null)
- const motion = useRef<Animation[]>([])
+ const animations = useRef<Animation[]>([])
const animateOpen = useRef(false)
const closing = useRef(false)
useEffect(() => { setOpen(false); setConversationId(undefined); setError(false); closing.current = false }, [id])
@@ -37,22 +38,28 @@ export function Ask({ id, recording, anchor, onSource }: { id: string; recording
}, [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,
// 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: boolean) => {
+ 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 = motion.current.some(animation => animation.playState === 'running')
+ const running = animations.current.some(animation => animation.playState === 'running')
const was = { transform: getComputedStyle(shell).transform, radius: getComputedStyle(shell).borderRadius, shell: getComputedStyle(shell).opacity,
- body: getComputedStyle(body).opacity, clip: getComputedStyle(body).clipPath, button: getComputedStyle(button).opacity }
- motion.current.forEach(animation => animation.cancel()); motion.current = []
- if (!animate || window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
+ 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
+ if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
+ const fade = dialog.animate([{ opacity: running ? was.dialog : expand ? 0 : 1 }, { opacity: expand ? 1 : 0 }],
+ { duration: timing.micro, easing: timing.ease, fill: 'both' })
+ animations.current = [fade]
+ 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)`
- // opening springs out of the button; closing speeds up into it, so it lands as the button fades back in
- const duration = expand ? 260 : 220, easing = expand ? 'cubic-bezier(.22,1.06,.36,1)' : 'cubic-bezier(.4,0,.2,1)', handoff = expand ? 50 : 90
+ // The anchored shape settles without overshoot; text stays at its final size.
+ 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 },
@@ -60,15 +67,15 @@ export function Ask({ id, recording, anchor, onSource }: { id: string; recording
const crop = body.animate([{ clipPath: running && was.clip !== 'none' ? was.clip : expand ? cropped : 'inset(0px round 12px)' }, { clipPath: expand ? 'inset(0px round 12px)' : cropped }],
{ duration, easing, fill: expand ? 'backwards' : 'forwards' })
const content = body.animate([{ opacity: running ? was.body : expand ? 0 : 1 }, { opacity: expand ? 1 : 0 }],
- { duration: expand ? 160 : 120, delay: expand ? 60 : 0, easing: 'ease-out', fill: 'both' })
+ { duration: timing.micro, easing, fill: 'both' })
// opening: the button fades as the surface appears over it; closing: the surface fades as it lands on the button
- const trade = { duration: handoff, delay: expand ? 0 : duration - handoff, easing: 'ease-out', fill: 'both' as const }
+ const trade = { duration: handoff, delay: expand ? 0 : duration - handoff, easing, fill: 'both' as const }
const cover = shell.animate([{ opacity: running ? was.shell : expand ? 0 : 1 }, { opacity: expand ? 1 : 0 }], trade)
const label = button.animate([{ opacity: running ? was.button : expand ? 1 : 0 }, { opacity: expand ? 0 : 1 }], trade)
- motion.current = [shape, crop, content, cover, label]
+ animations.current = [shape, crop, content, cover, label]
return shape
}
- useEffect(() => () => motion.current.forEach((animation) => animation.cancel()), [])
+ useEffect(() => () => animations.current.forEach((animation) => animation.cancel()), [])
useLayoutEffect(() => {
if (!open || !anchor || !panel.current) return
const dialog = panel.current
@@ -82,9 +89,9 @@ export function Ask({ id, recording, anchor, onSource }: { id: string; recording
// Native modal behavior makes the covered note inert at narrow widths; desktop stays editable.
if (narrow) dialog.showModal(); else dialog.show()
setToastDialog(narrow ? dialog : null)
+ dialog.querySelector('textarea')?.focus({ preventScroll: true })
morph(true, animateOpen.current)
animateOpen.current = false
- panel.current?.querySelector('textarea')?.focus({ preventScroll: true })
const observer = new ResizeObserver(position)
observer.observe(anchor)
window.addEventListener('resize', position)
@@ -93,14 +100,14 @@ export function Ask({ id, recording, anchor, onSource }: { id: string; recording
const close = (animate = true) => {
if (closing.current) return
closing.current = true
- const animation = morph(false, animate)
+ const exit = morph(false, animate)
const done = () => {
if (!closing.current) return
closing.current = false
panel.current?.close(); setOpen(false)
trigger.current?.focus({ preventScroll: true })
}
- if (animation) void animation.finished.then(done, () => {})
+ if (exit) void exit.finished.then(done, () => {})
else done()
}
@@ -110,21 +117,18 @@ export function Ask({ id, recording, anchor, onSource }: { id: string; recording
onCancel={event => { event.preventDefault(); close() }}>
<div ref={surface} className="chat-morph-surface" aria-hidden="true" />
<div ref={contents} className="chat-panel-contents">
- {!conversationId && <header className="ask-conversation-head"><h2 id="meeting-chat-title">{t('New chat')}</h2>
- <button data-testid="chat-close" className="chat-icon" onClick={() => close()} aria-label={t('Close')}><X size={16} aria-hidden="true" /></button>
- </header>}
{error && <p role="alert">{t("Yogurt couldn't answer that.")}</p>}
- {conversationId && <AskConversation key={conversationId} id={conversationId} panel recording={recording} onSelect={setConversationId} onClose={() => close()}
- onExpand={() => { rememberScrollPositions(); close(false); window.yogurt.nav.go(`/chat/${conversationId}`) }}
+ <AskConversation key={`${id}/${conversationVersion}`} id={conversationId ?? ''} pendingDraftKey={`meeting/${id}`} panel recording={recording} onSelect={next => { setConversationId(next); setConversationVersion(version => version + 1) }} onClose={() => close()}
+ onExpand={conversationId ? () => { rememberScrollPositions(); close(false); window.yogurt.nav.go(`/chat/${conversationId}`) } : undefined}
onDeleted={() => { close(false); setConversationId(undefined); window.yogurt.nav.go('/chat') }}
- onSource={(source, match) => { close(false); onSource(source, match) }} />}
+ onSource={(source, match) => { close(false); onSource(source, match) }} />
</div>
</dialog>
return <>
<button id="meeting-ask" ref={trigger} data-testid="chat-open" className="chat-trigger" type="button" aria-expanded={open} aria-controls="meeting-chat"
- title={onMac() ? t('Ask Yogurt (⌘J)') : `${t('Ask Yogurt')} (${keys('⌘J')})`} onClick={event => {
- // ⌘J opens through a programmatic click, so it morphs the same as a mouse click
- if (closing.current) { closing.current = false; morph(true, true) }
+ title={onMac() ? t('Ask Yogurt (⌘J)') : `${t('Ask Yogurt')} (${keys('⌘J')})`} onClick={() => {
+ // Programmatic and pointer opens share the same anchored motion.
+ if (closing.current) { closing.current = false; morph(true) }
animateOpen.current = true; setError(false); setOpen(true)
panel.current?.querySelector('textarea')?.focus({ preventScroll: true })
}}><MessageCircle size={16} strokeWidth={1.75} aria-hidden="true" /><span>{t('Ask Yogurt')}</span><kbd aria-hidden="true">{keys('⌘J')}</kbd></button>
diff --git a/app/src/renderer/src/components/ConversationActions.tsx b/app/src/renderer/src/components/ConversationActions.tsx
index 24863175..197c1cfa 100644
--- a/app/src/renderer/src/components/ConversationActions.tsx
+++ b/app/src/renderer/src/components/ConversationActions.tsx
@@ -13,15 +13,16 @@ export function ConversationActions({ id, title, onNew, onDeleted, onEdit, class
const button = useRef<HTMLButtonElement>(null)
const container = useRef<HTMLElement | null>(null)
const mountButton = useCallback((node: HTMLButtonElement | null) => { button.current = node; container.current = node?.closest('dialog') ?? null }, [])
+ const [pointer, setPointer] = useState(false)
const [dialog, setDialog] = useState<Edit>()
const edit = (kind: Edit) => { button.current?.focus(); setDialog(kind); onEdit?.(kind) }
const cancel = () => { setDialog(undefined); button.current?.focus({ preventScroll: true }) }
return <>
- <Menu.Root modal={false}>
+ <Menu.Root modal={false} onOpenChange={(open, details) => { if (open) setPointer(details.event instanceof MouseEvent && details.event.detail > 0) }}>
<Menu.Trigger ref={mountButton} data-testid="chat-menu" className={`chat-icon ask-menu-trigger ${className}`} aria-label={t('More')} title={t('More')}><Ellipsis size={17} aria-hidden="true" /></Menu.Trigger>
<Menu.Portal container={container}>
<Menu.Positioner side="bottom" align="end" sideOffset={6} className="ask-menu-positioner">
- <Menu.Popup className="menu-entry ask-actions-menu" aria-label={t('More')} finalFocus={dialog ? false : button} onKeyDown={e => { if (e.key === 'Escape') e.stopPropagation() }}>
+ <Menu.Popup data-pointer={pointer} className="menu-entry ask-actions-menu" aria-label={t('More')} finalFocus={dialog ? false : button} onKeyDown={e => { if (e.key === 'Escape') e.stopPropagation() }}>
<Menu.Item data-testid="chat-rename" onClick={() => edit('rename')}><Pencil size={14} aria-hidden="true" />{t('Rename')}</Menu.Item>
{onNew && <Menu.Item data-testid="chat-new" onClick={onNew}><Plus size={14} aria-hidden="true" />{t('New chat')}</Menu.Item>}
<Menu.Item data-testid="chat-delete" className="text-danger" onClick={() => edit('delete')}><Trash2 size={14} aria-hidden="true" />{t('Delete')}</Menu.Item>
@@ -51,7 +52,7 @@ export function ConversationDialog({ id, title, kind, container, onClose, onDele
} catch { setError(true) }
finally { setBusy(false) }
}
- return <Modal fade container={container} busy={busy} testId={kind === 'delete' ? 'chat-delete-confirm' : 'chat-rename-dialog'}
+ return <Modal container={container} busy={busy} testId={kind === 'delete' ? 'chat-delete-confirm' : 'chat-rename-dialog'}
role={kind === 'delete' ? 'alertdialog' : 'dialog'} onCancel={onClose}
title={kind === 'delete' ? t('Delete “{title}”?', { title: title || t('New chat') }) : t('Rename “{title}”', { title: title || t('New chat') })}
description={kind === 'delete' ? osWords({ mac: t('This conversation is removed from this Mac for good. Your meetings stay as they are.'), other: t('This conversation is removed from this computer for good. Your meetings stay as they are.') }) : undefined}>
diff --git a/app/src/renderer/src/components/FinishSetup.tsx b/app/src/renderer/src/components/FinishSetup.tsx
index 45590663..f80e6038 100644
--- a/app/src/renderer/src/components/FinishSetup.tsx
+++ b/app/src/renderer/src/components/FinishSetup.tsx
@@ -22,6 +22,7 @@ export function FinishSetup({ collapsed = false }: { collapsed?: boolean }) {
const [percent, setPercent] = useState(0)
const trigger = useRef<HTMLButtonElement>(null)
const panel = useRef<HTMLDialogElement>(null)
+ const [pointer, setPointer] = useState(false)
const menu = useRef<HTMLDivElement>(null)
const [items, setItems] = useState<MissingPermission[]>([])
// Replies from before Hide or Undo must not bring back the old checklist state.
@@ -115,11 +116,11 @@ export function FinishSetup({ collapsed = false }: { collapsed?: boolean }) {
<div className="finish-setup-header">
<h2>{t('Finish setup')}</h2>
<div className="finish-setup-controls">
- <Menu.Root modal={false}>
+ <Menu.Root modal={false} onOpenChange={(open, details) => { if (open) setPointer(details.event instanceof MouseEvent && details.event.detail > 0) }}>
<Menu.Trigger data-testid="finish-setup-more" aria-label={t('More')} title={t('More')} className="finish-setup-close no-drag"><Ellipsis size={14} aria-hidden="true" /></Menu.Trigger>
<Menu.Portal>
<Menu.Positioner side="bottom" align="end" sideOffset={6} className="ask-menu-positioner">
- <Menu.Popup ref={menu} className="menu-entry ask-actions-menu" aria-label={t('More')} onKeyDown={e => { if (e.key === 'Escape') e.stopPropagation() }}>
+ <Menu.Popup data-pointer={pointer} ref={menu} className="menu-entry ask-actions-menu" aria-label={t('More')} onKeyDown={e => { if (e.key === 'Escape') e.stopPropagation() }}>
<Menu.Item data-testid="finish-setup-hide" onClick={() => void hide()}>{t('Hide checklist')}</Menu.Item>
</Menu.Popup>
</Menu.Positioner>
diff --git a/app/src/renderer/src/components/FolderPicker.tsx b/app/src/renderer/src/components/FolderPicker.tsx
index 56014dbd..400b3610 100644
--- a/app/src/renderer/src/components/FolderPicker.tsx
+++ b/app/src/renderer/src/components/FolderPicker.tsx
@@ -6,7 +6,7 @@ import { t } from '../../../shared/i18n'
import { setMeetingsInFolder, useFolders } from '../folders'
import { folderCheck, nextFolderCheck, reconcileFolderChecks, type FolderMemberships, type PendingFolderChecks } from '../folderSelection'
import { toasts } from './TrashToast'
-import { useReducedMotion } from '../motion'
+import { motion, useReducedMotion, usePopoverPresence } from '../motion'
export type FolderSuggestion = { folder: Folder; dismiss: () => void }
@@ -81,6 +81,7 @@ export function FolderChip({ meetingId, onNew, suggestion: manualSuggestion, row
const [transition, setTransition] = useState<{ folder: Folder; phase: 'saving' | 'accepted' | 'dismissed' | 'settled' } | null>(null)
const [adding, setAdding] = useState(false)
const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)
+ const presence = usePopoverPresence(open, open === 'pointer')
const root = useRef<HTMLDivElement>(null)
const chip = useRef<HTMLButtonElement>(null)
useEffect(() => {
@@ -143,8 +144,7 @@ export function FolderChip({ meetingId, onNew, suggestion: manualSuggestion, row
setTransition(transition.phase === 'accepted' ? { ...transition, phase: 'settled' } : null)
requestAnimationFrame(() => { if (document.activeElement === document.body) (row ? focus : chip.current)?.focus({ preventScroll: true }) })
}
- if (reduced) { finish(); return }
- const timer = setTimeout(finish, 180)
+ const timer = setTimeout(finish, reduced ? motion.micro : motion.base)
return () => clearTimeout(timer)
}, [transition, reduced])
const appearance = proposed ?? (folders?.length === 1 ? folders[0] : undefined)
@@ -163,7 +163,7 @@ export function FolderChip({ meetingId, onNew, suggestion: manualSuggestion, row
<button data-testid="folder-suggestion-confirm" className="workspace-icon" disabled={adding || !!held} onClick={() => void confirmSuggestion()} aria-label={t('Add to folder')} title={t('Add to folder')}><Check size={row ? 12 : 15} aria-hidden="true" /></button>
</div>
</div> : trigger}
- {open && <div data-testid="folder-menu" data-pointer={open === 'pointer'} data-anchor="start" role="menu" aria-label={t('Add to folder')} onKeyDown={key}
+ {presence.value && <div data-testid="folder-menu" {...presence.props} data-anchor="start" role="menu" aria-label={t('Add to folder')} onKeyDown={key}
className="menu-entry absolute start-0 top-full z-30 mt-2 max-h-80 w-60 overflow-y-auto rounded-xl border border-line bg-float p-1.5 shadow-[var(--shadow)]">
<FolderPicker autoFocus testId="folder-chip-list" meetingId={meetingId} suggestedId={proposed?.id} onNew={() => { setOpen(false); onNew?.() }} />
</div>}
diff --git a/app/src/renderer/src/components/FoldersNav.tsx b/app/src/renderer/src/components/FoldersNav.tsx
index 841a6a26..b0273fe8 100644
--- a/app/src/renderer/src/components/FoldersNav.tsx
+++ b/app/src/renderer/src/components/FoldersNav.tsx
@@ -2,7 +2,8 @@ import { Loading } from './Loading'
import { LoadingContent } from './LoadingContent'
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, useReducedMotion } from 'motion/react'
+import { Reorder, useDragControls } from 'motion/react'
+import { useReducedMotion, usePopoverPresence } from '../motion'
import type { Folder } from '../../../shared/types'
import { t } from '../../../shared/i18n'
import { FolderGlyph } from './FolderAppearance'
@@ -80,6 +81,7 @@ function FolderItem({ folder, collapsed, current, go, onRename, onDelete, onAppe
const [moving, setMoving] = useState(false)
const [drop, setDrop] = useState(false)
const [menu, setMenu] = useState<{ style: CSSProperties; pointer: boolean }>()
+ const presence = usePopoverPresence(menu, !!menu?.pointer)
const row = useRef<HTMLDivElement>(null)
const more = useRef<HTMLButtonElement>(null)
const open = useRef<HTMLButtonElement>(null)
@@ -136,7 +138,7 @@ function FolderItem({ folder, collapsed, current, go, onRename, onDelete, onAppe
aria-label={t('More for “{name}”', { name: folder.name })} title={t('More')} onClick={(e) => (menu ? setMenu(undefined) : openMenu(e.detail > 0))}>
<Ellipsis size={15} aria-hidden="true" />
</button>
- {menu && <div ref={list} data-testid="sidebar-folder-menu" role="menu" aria-label={folder.name} data-pointer={menu.pointer} data-anchor="start" onKeyDown={key} style={menu.style}
+ {presence.value && <div ref={list} data-testid="sidebar-folder-menu" role="menu" aria-label={folder.name} {...presence.props} data-anchor="start" onKeyDown={key} style={presence.value.style}
className="menu-entry z-[70] rounded-xl border border-line bg-float p-1.5 shadow-[var(--shadow)]">
<button role="menuitem" data-testid="sidebar-folder-appearance" onClick={() => run(onAppearance)} className="flex w-full items-center gap-2.5 text-start">
<Palette size={15} aria-hidden="true" className="text-muted" />{t('Change icon')}
diff --git a/app/src/renderer/src/components/MeetingRow.tsx b/app/src/renderer/src/components/MeetingRow.tsx
index 0a7f3eba..4b52cc7a 100644
--- a/app/src/renderer/src/components/MeetingRow.tsx
+++ b/app/src/renderer/src/components/MeetingRow.tsx
@@ -1,3 +1,4 @@
+import { usePopoverPresence } from '../motion'
import { useEffect, useId, useLayoutEffect, useRef, useState, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react'
import { createPortal } from 'react-dom'
import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'
@@ -18,6 +19,9 @@ export function MeetingRow({ id, recording, children, selected, targets, members
}) {
const row = useRef<HTMLLIElement>(null), button = useRef<HTMLButtonElement>(null), menu = useRef<HTMLDivElement>(null)
const [open, setOpen] = useState<'button' | { x: number; y: number } | null>(null)
+ const [pointer, setPointer] = useState(false)
+ // Context menus stay instant; anchored button menus share the popover motion.
+ const presence = usePopoverPresence(open, pointer && open === 'button')
const [inFolders, setInFolders] = useState(false), [namingFolder, setNamingFolder] = useState(false)
const [suggestedId, setSuggestedId] = useState<string>()
const folderTargets = suggestedId ? [id] : targets
@@ -60,10 +64,10 @@ export function MeetingRow({ id, recording, children, selected, targets, members
if (e.key === 'ContextMenu' || (e.shiftKey && e.key === 'F10')) { e.preventDefault(); const box = row.current!.getBoundingClientRect(); show({ x: box.left + 20, y: box.bottom }); return }
deleteMeetingFromKey(e, e.target === row.current?.querySelector('.native-meeting-link'), busy || (recording && !selected), () => onTrash(targets))
}}>
- {children(folderId => { setSuggestedId(folderId); setInFolders(true); setOpen('button') },
+ {children(folderId => { setPointer(!document.activeElement?.matches(':focus-visible')); setSuggestedId(folderId); setInFolders(true); setOpen('button') },
<button ref={button} data-testid="past-note-more" className="workspace-icon meeting-more row-swap-actions" aria-label={t('More')} title={t('More')} aria-haspopup="menu" aria-expanded={!!open} aria-controls={open ? menuId : undefined}
- onClick={() => open ? close() : show('button')}><Ellipsis size={14} aria-hidden="true" /></button>)}
- {open && createPortal(<div ref={menu} id={menuId} data-testid="meeting-row-menu" role="menu" aria-label={t('More')} onKeyDown={menuKey}
+ onClick={e => { setPointer(e.detail > 0); if (open) close(); else show('button') }}><Ellipsis size={14} aria-hidden="true" /></button>)}
+ {presence.value && createPortal(<div {...presence.props} ref={menu} id={menuId} data-testid="meeting-row-menu" role="menu" aria-label={t('More')} onKeyDown={menuKey}
className="menu-entry meeting-row-menu" style={{ visibility: 'hidden' }}>
{inFolders ? <FolderPicker key={folderTargets.join(',')} meetingIds={folderTargets} memberships={memberships} suggestedId={memberships[id]?.length ? undefined : suggestedId} testId="meeting-row-folders" onNew={() => { close(); setNamingFolder(true) }} /> : <>
{!selected && <><button role="menuitem" data-testid="meeting-select" onClick={() => { onSelect(); close() }}><ListChecks size={15} aria-hidden="true" />{t('Select')}</button><div role="separator" className="meeting-menu-divider" /></>}
diff --git a/app/src/renderer/src/components/MeetingSelectionBar.tsx b/app/src/renderer/src/components/MeetingSelectionBar.tsx
index a0443818..5846bf0b 100644
--- a/app/src/renderer/src/components/MeetingSelectionBar.tsx
+++ b/app/src/renderer/src/components/MeetingSelectionBar.tsx
@@ -1,3 +1,4 @@
+import { usePopoverPresence } from '../motion'
import { useEffect, useLayoutEffect, useRef, useState, type RefObject } from 'react'
import { createPortal } from 'react-dom'
import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'
@@ -15,6 +16,8 @@ export function MeetingSelectionBar({ ids, memberships, list, busy, clear, trash
}) {
const bar = useRef<HTMLDivElement>(null), trigger = useRef<HTMLButtonElement>(null), menu = useRef<HTMLDivElement>(null)
const [open, setOpen] = useState(false), [naming, setNaming] = useState(false)
+ const [pointer, setPointer] = useState(false)
+ const presence = usePopoverPresence(open, pointer)
useLayoutEffect(() => {
const pane = list.current?.closest<HTMLElement>('.native-library'), el = bar.current
if (!pane || !el) return
@@ -48,8 +51,8 @@ export function MeetingSelectionBar({ ids, memberships, list, busy, clear, trash
{ids.length === 1 && <small>{t('Click meetings to add more')}</small>}
</span>
<div className="meeting-selection-folder">
- <button ref={trigger} className="workspace-button" disabled={busy} aria-haspopup="menu" aria-expanded={open} onClick={() => setOpen(!open)}><Folder size={14} aria-hidden="true" />{t('Add to folder')}</button>
- {open && <div ref={menu} role="menu" aria-label={t('Add to folder')} className="menu-entry meeting-selection-menu" style={{ visibility: 'hidden' }} onKeyDown={e => {
+ <button ref={trigger} className="workspace-button" disabled={busy} aria-haspopup="menu" aria-expanded={open} onClick={e => { setPointer(e.detail > 0); setOpen(!open) }}><Folder size={14} aria-hidden="true" />{t('Add to folder')}</button>
+ {presence.value && <div {...presence.props} data-anchor="bottom-start" ref={menu} role="menu" aria-label={t('Add to folder')} className="menu-entry meeting-selection-menu" style={{ visibility: 'hidden' }} onKeyDown={e => {
const items = Array.from(menu.current?.querySelectorAll<HTMLElement>('[role="menuitem"]:not(:disabled), [role="menuitemcheckbox"]:not(:disabled)') ?? [])
const at = items.indexOf(document.activeElement as HTMLElement)
if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); setOpen(false); trigger.current?.focus() }
diff --git a/app/src/renderer/src/components/MicMenu.tsx b/app/src/renderer/src/components/MicMenu.tsx
index 6f1cebb0..2ff86d78 100644
--- a/app/src/renderer/src/components/MicMenu.tsx
+++ b/app/src/renderer/src/components/MicMenu.tsx
@@ -1,3 +1,4 @@
+import { usePopoverPresence } from '../motion'
import { useCallback, useEffect, useRef, useState, type KeyboardEvent } from 'react'
import { Check, ChevronDown, Info, Mic } from 'lucide-react'
import { Pause } from './Icons'
@@ -22,6 +23,7 @@ const FELL_BACK_MS = 8000
export function MicMenu({ recording, paused }: { recording: boolean; paused?: boolean }) {
const [view, setView] = useState<MicsView>()
const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)
+ const presence = usePopoverPresence(open, open === 'pointer')
/** the mic that went away, for the note saying Auto took over */
const [lost, setLost] = useState<string | null>(null)
const root = useRef<HTMLDivElement>(null)
@@ -93,8 +95,8 @@ export function MicMenu({ recording, paused }: { recording: boolean; paused?: bo
{lost ? t("{name} isn't available anymore. Recording continues with Auto.", { name: lost }) : t("Your mic isn't available anymore. Recording continues with Auto.")}
</span>
)}
- {open && view && (
- <div data-testid="mic-menu" data-pointer={open === 'pointer'} data-anchor="bottom-start" role="menu" aria-label={t('Microphone')} onKeyDown={onKey}
+ {presence.value && view && (
+ <div data-testid="mic-menu" {...presence.props} data-anchor="bottom-start" role="menu" aria-label={t('Microphone')} onKeyDown={onKey}
className="menu-entry absolute bottom-full start-0 z-30 mb-2 w-72 rounded-xl border border-line bg-float p-1.5 text-ink shadow-[var(--shadow)]">
<button role="menuitemradio" aria-checked={view.choice === null} data-testid="mic-auto" onClick={() => void choose(null)} className={row}>
<span className="flex min-w-0 flex-col">
diff --git a/app/src/renderer/src/components/Modal.tsx b/app/src/renderer/src/components/Modal.tsx
index 8f7dae6c..6bab96aa 100644
--- a/app/src/renderer/src/components/Modal.tsx
+++ b/app/src/renderer/src/components/Modal.tsx
@@ -1,16 +1,15 @@
import { useEffect, useRef, useState, type ReactNode } from 'react'
import { Dialog } from '@animate-ui/react/primitives/base-ui/dialog'
-import { useReducedMotion } from 'motion/react'
import { MotionPopup } from './MotionPopup'
-import { surfaceMotion } from '../motion'
+import { motion, useReducedMotion } from '../motion'
export const ModalClose = Dialog.Close
/** Shared accessible dialog with restrained motion and safe initial focus. */
-export function Modal({ title, description, children, onCancel, busy = false, role = 'dialog', testId, fade = false, container }: {
+export function Modal({ title, description, children, onCancel, busy = false, role = 'dialog', testId, container }: {
title: string; description?: string; children: ReactNode
onCancel: () => void; busy?: boolean; role?: 'dialog' | 'alertdialog'; testId?: string
- fade?: boolean; container?: HTMLElement | null
+ container?: HTMLElement | null
}) {
const [open, setOpen] = useState(true)
const reduce = useReducedMotion()
@@ -21,16 +20,16 @@ export function Modal({ title, description, children, onCancel, busy = false, ro
useEffect(() => {
if (open) return
// Keep conditionally mounted callers alive until the primitive's exit finishes.
- const timer = setTimeout(() => cancel.current(), reduce ? 0 : fade ? 160 : surfaceMotion.exitHoldMs)
+ const timer = setTimeout(() => cancel.current(), reduce ? motion.micro : motion.base)
return () => clearTimeout(timer)
- }, [open, reduce, fade])
+ }, [open, reduce])
return <Dialog.Root open={open} onOpenChange={(next, event) => {
if (!next && busy) { event.cancel(); return }
setOpen(next)
}}>
<Dialog.Portal keepMounted container={container}>
- <Dialog.Backdrop className="app-modal-backdrop no-drag" transition={{ duration: reduce ? 0 : fade ? .16 : .2 }} exitTransition={{ duration: reduce ? 0 : surfaceMotion.exitMs / 1000 }} />
- <MotionPopup ref={dialog} open={open} reduced={!!reduce} fade={fade} data-testid={testId} role={role} aria-modal="true" aria-busy={busy || undefined}
+ <Dialog.Backdrop className="app-modal-backdrop no-drag" transition={{ ease: motion.out, duration: (reduce ? motion.micro : motion.surface) / 1000 }} exitTransition={{ ease: motion.out, duration: (reduce ? motion.micro : motion.base) / 1000 }} />
+ <MotionPopup ref={dialog} data-testid={testId} role={role} aria-modal="true" aria-busy={busy || undefined}
className="app-modal no-drag" finalFocus={opener} initialFocus={() => {
const first = dialog.current?.querySelector<HTMLElement>('[data-dialog-focus], [data-dialog-cancel]')
if (first instanceof HTMLInputElement) first.select()
diff --git a/app/src/renderer/src/components/MotionPopup.tsx b/app/src/renderer/src/components/MotionPopup.tsx
index 27e4eb8a..a9248c70 100644
--- a/app/src/renderer/src/components/MotionPopup.tsx
+++ b/app/src/renderer/src/components/MotionPopup.tsx
@@ -1,66 +1,10 @@
import { Dialog } from '@base-ui/react/dialog'
-import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, type ComponentPropsWithoutRef } from 'react'
-import { surfaceMotion } from '../motion'
+import { forwardRef, type ComponentPropsWithoutRef } from 'react'
-/** Base UI keeps focus, dismissal and title semantics; only the decorative shell stretches. */
-export const MotionPopup = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<typeof Dialog.Popup> & { open: boolean; reduced: boolean; fade?: boolean }>(
- function MotionPopup({ open, reduced, fade = false, children, className, ...props }, ref) {
- const popup = useRef<HTMLDivElement>(null)
- const surface = useRef<HTMLDivElement>(null)
- const contents = useRef<HTMLDivElement>(null)
- const animations = useRef<Animation[]>([])
- useImperativeHandle(ref, () => popup.current!, [])
- useLayoutEffect(() => {
- const el = popup.current, shell = surface.current, body = contents.current
- if (!el || !shell || !body) return
- const running = animations.current.some(animation => animation.playState === 'running')
- const shape = getComputedStyle(shell), text = getComputedStyle(body)
- const transform = shape.transform, opacity = shape.opacity, textOpacity = text.opacity, clip = text.clipPath
- const popupOpacity = getComputedStyle(el).opacity
- animations.current.forEach(animation => animation.cancel())
- animations.current = []
- if (reduced) return
- if (fade) {
- animations.current = [el.animate([{ opacity: running ? popupOpacity : open ? 0 : 1 }, { opacity: open ? 1 : 0 }], { duration: 160, easing: 'ease-out', fill: 'both' })]
- return
- }
- const duration = open ? surfaceMotion.settleMs : surfaceMotion.exitMs
- const frames: Keyframe[] = open ? [
- { transform: running ? transform : 'translateY(12px) scale(.94, .86)', opacity: running ? opacity : 0, easing: surfaceMotion.settleEase },
- { transform: 'translateY(-1px) scale(1.008, 1.018)', opacity: 1, offset: surfaceMotion.settleAt, easing: 'ease-out' },
- { transform: 'none', opacity: 1 },
- ] : [
- { transform: running ? transform : 'none', opacity: running ? opacity : 1 },
- { transform: 'translateY(6px) scale(.98, .96)', opacity: 0 },
- ]
- // The content stays at its final size, cropped to the stretching surface so it never shows past the surface's edge.
- const box = body.getBoundingClientRect(), round = getComputedStyle(el).borderRadius
- const cropped = (y: number, sx: number, sy: number) => {
- const side = (1 - sx) / 2 * box.width, edge = (1 - sy) / 2 * box.height
- return `inset(${edge + y}px ${side}px ${edge - y}px ${side}px round ${round})`
- }
- const crops: Keyframe[] = open ? [
- { clipPath: running && clip !== 'none' ? clip : cropped(12, .94, .86), easing: surfaceMotion.settleEase },
- { clipPath: cropped(-1, 1.008, 1.018), offset: surfaceMotion.settleAt, easing: 'ease-out' },
- { clipPath: cropped(0, 1, 1) },
- ] : [
- { clipPath: running && clip !== 'none' ? clip : cropped(0, 1, 1) },
- { clipPath: cropped(6, .98, .96) },
- ]
- animations.current = [
- shell.animate(frames, { duration, easing: open ? 'linear' : 'ease-out', fill: 'both' }),
- body.animate(crops, { duration, easing: open ? 'linear' : 'ease-out', fill: open ? 'backwards' : 'forwards' }),
- body.animate([{ opacity: running ? textOpacity : open ? 0 : 1 }, { opacity: open ? 1 : 0 }], {
- duration: open ? 150 : 90, delay: open ? 35 : 0, easing: 'ease-out', fill: 'both',
- }),
- // Base UI observes animations on the popup itself before completing its exit.
- el.animate([{ opacity: 1 }, { opacity: 1 }], { duration, fill: 'both' }),
- ]
- }, [open, reduced, fade])
- useEffect(() => () => animations.current.forEach(animation => animation.cancel()), [])
- return <Dialog.Popup {...props} ref={popup} className={state => `${typeof className === 'function' ? className(state) : className ?? ''} dialog-motion`}>
- <div ref={surface} className="dialog-motion-surface" aria-hidden="true" />
- <div ref={contents} className="dialog-motion-content">{children}</div>
- </Dialog.Popup>
+/** The dialog primitive owns focus and the interruptible entry/exit lifecycle. */
+export const MotionPopup = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<typeof Dialog.Popup>>(
+ function MotionPopup({ className, ...props }, ref) {
+ return <Dialog.Popup {...props} ref={ref}
+ className={state => `${typeof className === 'function' ? className(state) : className ?? ''} dialog-motion`} />
},
)
diff --git a/app/src/renderer/src/components/NoteDate.tsx b/app/src/renderer/src/components/NoteDate.tsx
index 525e52dc..946463f3 100644
--- a/app/src/renderer/src/components/NoteDate.tsx
+++ b/app/src/renderer/src/components/NoteDate.tsx
@@ -1,3 +1,4 @@
+import { usePopoverPresence } from '../motion'
import { useCallback, useEffect, useRef, useState, type RefObject } from 'react'
import { ScrollFade } from './ScrollFade'
import { CalendarDays, Check, ChevronDown, ChevronLeft, ChevronRight, Clock, ExternalLink, Link2, Link2Off, X } from 'lucide-react'
@@ -10,6 +11,7 @@ import { peopleSummary, useMyName } from './People'
export function NoteDate({ m }: { m: Meeting }) {
const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)
+ const presence = usePopoverPresence(open, open === 'pointer')
const chip = useRef<HTMLButtonElement>(null)
const close = useCallback((restore = true) => { setOpen(false); if (restore) chip.current?.focus({ preventScroll: true }) }, [])
return <div className="relative">
@@ -17,11 +19,11 @@ export function NoteDate({ m }: { m: Meeting }) {
className="note-chip flex items-center gap-1.5 rounded-md border border-line px-2.5 text-[13px] text-muted">
<CalendarDays size={14} strokeWidth={1.75} aria-hidden="true" />{noteDateLabel(m.startedAt)}
</button>
- {open && <DateCard key={`${m.id}/${m.eventId}`} m={m} chip={chip} pointer={open === 'pointer'} onClose={close} />}
+ {presence.value && <DateCard key={`${m.id}/${m.eventId}`} m={m} chip={chip} motionProps={presence.props} onClose={close} />}
</div>
}
-function DateCard({ m, chip, pointer, onClose }: { m: Meeting; chip: RefObject<HTMLButtonElement | null>; pointer: boolean; onClose: (restore?: boolean) => void }) {
+function DateCard({ m, chip, motionProps, onClose }: { m: Meeting; chip: RefObject<HTMLButtonElement | null>; motionProps: ReturnType<typeof usePopoverPresence>['props']; onClose: (restore?: boolean) => void }) {
const card = useRef<HTMLDivElement>(null)
// no calendar on this computer (Windows, Linux): the date and length only, as for a note with no event
const calendar = window.yogurt.capabilities.calendar
@@ -30,7 +32,7 @@ function DateCard({ m, chip, pointer, onClose }: { m: Meeting; chip: RefObject<H
const [revision, setRevision] = useState(0)
const [picking, setPicking] = useState(false)
const toggle = useRef<HTMLButtonElement>(null)
- useNotePopover(card, chip, onClose)
+ useNotePopover(card, chip, onClose, !motionProps.inert)
useEffect(() => {
if (!linked) return
let active = true
@@ -43,7 +45,7 @@ function DateCard({ m, chip, pointer, onClose }: { m: Meeting; chip: RefObject<H
const at = event?.start ?? m.startedAt
const minutes = Math.max(0, Math.round((m.durationMs ?? (m.endedAt ? m.endedAt - m.startedAt : m.state === 'recording' ? Date.now() - m.startedAt : 0)) / 60_000))
const url = event?.url?.trim()
- return <div ref={card} data-testid="note-date-card" data-pointer={pointer} data-anchor="start" role="dialog" aria-label={t('Date')}
+ return <div ref={card} data-testid="note-date-card" {...motionProps} data-anchor="start" role="dialog" aria-label={t('Date')}
className="people-card menu-entry note-date-card absolute start-0 top-full z-30 mt-2 w-[min(340px,calc(100vw-48px))] rounded-lg border border-line bg-float text-ink shadow-[var(--shadow)]"
onKeyDown={e => { if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); onClose() } }}>
<div className="agenda-inspector-content">
diff --git a/app/src/renderer/src/components/NoteMenu.tsx b/app/src/renderer/src/components/NoteMenu.tsx
index e8787b00..e41a9501 100644
--- a/app/src/renderer/src/components/NoteMenu.tsx
+++ b/app/src/renderer/src/components/NoteMenu.tsx
@@ -1,3 +1,4 @@
+import { usePopoverPresence } from '../motion'
import { useEffect, useRef, useState, type KeyboardEvent, type ReactNode } from 'react'
import { ChevronRight, Ellipsis, FolderIcon, Pencil, Trash2 } from 'lucide-react'
import { t } from '../../../shared/i18n'
@@ -8,18 +9,19 @@ import { t } from '../../../shared/i18n'
*/
export function NoteMenu({ recording, savePending, onRename, onDelete, folders, trashed }: { recording: boolean; savePending?: boolean; onRename: () => void; onDelete: () => void; folders?: (close: () => void) => ReactNode; /** in the Trash already: Delete is for good */ trashed?: boolean }) {
const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)
+ const presence = usePopoverPresence(open, open === 'pointer')
const [inFolders, setInFolders] = useState(false)
const root = useRef<HTMLDivElement>(null)
const button = useRef<HTMLButtonElement>(null)
const first = useRef<HTMLButtonElement>(null)
useEffect(() => {
- if (!open) { setInFolders(false); return }
+ if (!open) { if (!presence.value) setInFolders(false); return }
first.current?.focus()
const away = (e: MouseEvent) => { if (!root.current?.contains(e.target as Node)) setOpen(false) }
document.addEventListener('mousedown', away)
return () => document.removeEventListener('mousedown', away)
- }, [open])
+ }, [open, presence.value])
const onKey = (e: KeyboardEvent) => {
const list = Array.from(root.current?.querySelectorAll<HTMLButtonElement>('[role="menuitem"]:not(:disabled), [role="menuitemcheckbox"]') ?? [])
const at = list.indexOf(document.activeElement as HTMLButtonElement)
@@ -35,8 +37,8 @@ export function NoteMenu({ recording, savePending, onRename, onDelete, folders,
<div ref={root} className="relative">
<button ref={button} data-testid="note-menu-button" aria-haspopup="menu" aria-expanded={!!open} aria-label={t('More')} title={t('More')}
onClick={(e) => setOpen((o) => o ? false : e.detail > 0 ? 'pointer' : 'keyboard')} className="bar-btn grid size-7 place-items-center rounded-md text-muted"><Ellipsis size={17} strokeWidth={1.75} aria-hidden="true" /></button>
- {open && (
- <div data-testid="note-menu" data-pointer={open === 'pointer'} role="menu" aria-label={t('More')} onKeyDown={onKey}
+ {presence.value && (
+ <div data-testid="note-menu" {...presence.props} role="menu" aria-label={t('More')} onKeyDown={onKey}
className="menu-entry absolute end-0 top-full z-30 mt-2 w-60 rounded-xl border border-line bg-float p-1.5 shadow-[var(--shadow)]">
{inFolders && folders ? folders(() => { setOpen(false); button.current?.focus() }) : <>
<button ref={first} role="menuitem" data-testid="note-rename" onClick={() => run(onRename)} className={row}>
diff --git a/app/src/renderer/src/components/NotesSetup.tsx b/app/src/renderer/src/components/NotesSetup.tsx
index 8e6079c7..52152421 100644
--- a/app/src/renderer/src/components/NotesSetup.tsx
+++ b/app/src/renderer/src/components/NotesSetup.tsx
@@ -53,8 +53,8 @@ export function NotesSetup({ go }: { go: (route: string) => void }) {
const fraction = upgrading ? setup.notesUpgradeFraction : setup.notesFraction
const percent = fraction !== undefined && Number.isFinite(fraction) ? Math.floor(Math.max(0, Math.min(1, fraction)) * 100) : undefined
return <DirectionProvider direction={dirOf(language())}><span className="notes-download-status">
- <Popover.Root open={open} onOpenChange={setOpen}>
- <Popover.Trigger data-testid="notes-setup-open" aria-label={label} title={label} onClick={e => setPointer(e.detail > 0)}
+ <Popover.Root open={open} onOpenChange={(next, details) => { if (next) setPointer(details.event instanceof MouseEvent && details.event.detail > 0); setOpen(next) }}>
+ <Popover.Trigger data-testid="notes-setup-open" aria-label={label} title={label}
className="bar-btn notes-download-trigger no-drag">
<span aria-hidden="true" data-failed={failed} data-upgrade={upgrading} className="notes-download-dot" />
<span className="truncate">{label}</span>
diff --git a/app/src/renderer/src/components/People.tsx b/app/src/renderer/src/components/People.tsx
index 85a07fb5..6fd203fc 100644
--- a/app/src/renderer/src/components/People.tsx
+++ b/app/src/renderer/src/components/People.tsx
@@ -1,3 +1,4 @@
+import { usePopoverPresence } from '../motion'
import { attendeePrivacy, emailName } from '../../../shared/people'
import { toasts } from './TrashToast'
import { useCallback, useEffect, useRef, useState, type KeyboardEvent, type RefObject } from 'react'
@@ -49,6 +50,7 @@ export function useMyName() {
/** Attendee membership and inline person editing, separate from the calendar details. */
export function People({ m }: { m: Meeting }) {
const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)
+ const presence = usePopoverPresence(open, open === 'pointer')
const me = useMyName()
const chip = useRef<HTMLButtonElement>(null)
const close = useCallback((restore = true) => { setOpen(false); if (restore) chip.current?.focus({ preventScroll: true }) }, [])
@@ -60,18 +62,18 @@ export function People({ m }: { m: Meeting }) {
className="note-chip flex items-center gap-1.5 rounded-md border border-line px-2.5 text-[13px] text-muted">
<span data-testid="note-attendees-summary" className="flex items-center gap-1.5"><Users size={14} strokeWidth={1.75} aria-hidden="true" />{peopleChipSummary(m.attendees, me)}</span>
</button>
- {open && <Card m={m} me={me} pointer={open === 'pointer'} chip={chip} onClose={close} />}
+ {presence.value && <Card m={m} me={me} motionProps={presence.props} chip={chip} onClose={close} />}
</div>
)
}
-function Card({ m, me, pointer, chip, onClose }: { m: Meeting; me: string; pointer: boolean; chip: RefObject<HTMLButtonElement | null>; onClose: (restore?: boolean) => void }) {
+function Card({ m, me, motionProps, chip, onClose }: { m: Meeting; me: string; motionProps: ReturnType<typeof usePopoverPresence>['props']; chip: RefObject<HTMLButtonElement | null>; onClose: (restore?: boolean) => void }) {
const [text, setText] = useState('')
const [adding, setAdding] = useState(() => !m.attendees.some(p => !same(p.name, me)))
const [focused, setFocused] = useState(false)
const input = useRef<HTMLInputElement>(null)
const card = useRef<HTMLDivElement>(null)
- useNotePopover(card, chip, onClose)
+ useNotePopover(card, chip, onClose, !motionProps.inert)
useEffect(() => { if (adding) input.current?.focus({ preventScroll: true }) }, [adding])
const save = async (people: Person[]) => {
try { await window.yogurt.meetings.setAttendees(m.id, people); return true }
@@ -91,7 +93,7 @@ function Card({ m, me, pointer, chip, onClose }: { m: Meeting; me: string; point
const others = m.attendees.map((p, i) => ({ p, i })).filter(({ p }) => !same(p.name, me))
return (
- <div ref={card} data-testid="people-card" data-pointer={pointer} data-anchor="start" role="dialog" aria-label={t('People')} onKeyDown={key}
+ <div ref={card} data-testid="people-card" {...motionProps} data-anchor="start" role="dialog" aria-label={t('People')} onKeyDown={key}
className="people-card menu-entry absolute start-0 top-full z-30 mt-2 w-[min(340px,calc(100vw-48px))] rounded-lg border border-line bg-float text-ink shadow-[var(--shadow)]">
<ul data-testid="people-list" className="people-list max-h-64 overflow-y-auto p-1.5">
<Row name={me || t('Me')} email={m.attendees.find(p => same(p.name, me))?.email} mine />
diff --git a/app/src/renderer/src/components/ScrollFade.tsx b/app/src/renderer/src/components/ScrollFade.tsx
index 9e97efc2..152b4095 100644
--- a/app/src/renderer/src/components/ScrollFade.tsx
+++ b/app/src/renderer/src/components/ScrollFade.tsx
@@ -1,7 +1,9 @@
import type { ReactElement } from 'react'
+import { motion, useReducedMotion } from '../motion'
import { ScrollFade as Fade } from '@animate-ui/react/primitives/effects/scroll-fade'
/** Fade only overflowing edges of the existing scroller; no extra layout or moving text. */
export function ScrollFade({ children, enabled = true, size = 20 }: { children: ReactElement; enabled?: boolean; size?: number }) {
- return <Fade asChild enabled={enabled} size={size} shrink={0} blur={0} transition={{ duration: 0.16, ease: 'easeOut' }}>{children}</Fade>
+ const reduced = useReducedMotion()
+ return <Fade asChild enabled={enabled} size={size} shrink={0} blur={0} transition={{ duration: (reduced ? motion.micro : motion.base) / 1000, ease: motion.out }}>{children}</Fade>
}
diff --git a/app/src/renderer/src/components/Search.tsx b/app/src/renderer/src/components/Search.tsx
index a94b7aef..368ec4b0 100644
--- a/app/src/renderer/src/components/Search.tsx
+++ b/app/src/renderer/src/components/Search.tsx
@@ -1,7 +1,6 @@
import { Dialog } from '@animate-ui/react/primitives/base-ui/dialog'
-import { useReducedMotion } from 'motion/react'
import { MotionPopup } from './MotionPopup'
-import { surfaceMotion } from '../motion'
+import { motion } from '../motion'
import { FolderGlyph } from './FolderAppearance'
import { Swap } from './Swap'
import { Fragment, useEffect, useRef, useState } from 'react'
@@ -32,14 +31,13 @@ export function Search({ folder, folders, onOpen, onNavigate, onSettingsChange,
sidebarCollapsed: boolean; onToggleSidebar: () => void
}) {
const [open, setOpen] = useState(true)
- const reduce = useReducedMotion()
const close = useRef(onClose)
close.current = onClose
useEffect(() => {
if (open) return
- const timer = setTimeout(() => close.current(), reduce ? 0 : surfaceMotion.exitHoldMs)
+ const timer = setTimeout(() => close.current(), motion.micro)
return () => clearTimeout(timer)
- }, [open, reduce])
+ }, [open])
const [q, setQ] = useState('')
const [scope, setScope] = useState(folder)
const [people, setPeople] = useState<Person[]>([])
@@ -196,8 +194,8 @@ export function Search({ folder, folders, onOpen, onNavigate, onSettingsChange,
return (
<Dialog.Root open={open} onOpenChange={setOpen}>
<Dialog.Portal keepMounted>
- <Dialog.Backdrop className="search-backdrop no-drag fixed inset-0 z-[100]" transition={{ duration: reduce ? 0 : .2 }} exitTransition={{ duration: reduce ? 0 : surfaceMotion.exitMs / 1000 }} />
- <MotionPopup open={open} reduced={!!reduce} initialFocus={input} finalFocus={() => before} data-testid="search" role="dialog" aria-modal="true" aria-label={t('Search and commands')} onKeyDown={onKeyDown}
+ <Dialog.Backdrop className="search-backdrop no-drag fixed inset-0 z-[100]" transition={{ ease: motion.out, duration: motion.micro / 1000 }} exitTransition={{ ease: motion.out, duration: motion.micro / 1000 }} />
+ <MotionPopup initialFocus={input} finalFocus={() => before} data-testid="search" role="dialog" aria-modal="true" aria-label={t('Search and commands')} onKeyDown={onKeyDown}
// a click anywhere in the panel keeps typing, arrows and Esc in the search box
onMouseDown={(e) => { if (e.target !== input.current) { e.preventDefault(); input.current?.focus() } }}
className="search-panel flex max-h-[74vh] w-full max-w-[640px] flex-col overflow-hidden rounded-2xl border border-line bg-float">
diff --git a/app/src/renderer/src/components/ShareMenu.tsx b/app/src/renderer/src/components/ShareMenu.tsx
index 6d8301f0..ac12a65a 100644
--- a/app/src/renderer/src/components/ShareMenu.tsx
+++ b/app/src/renderer/src/components/ShareMenu.tsx
@@ -1,3 +1,4 @@
+import { usePopoverPresence } from '../motion'
import { Copy } from './Icons'
import { useCallback, useEffect, useRef, useState, type KeyboardEvent } from 'react'
import { Check, CircleAlert, FileDown, ChevronDown } from 'lucide-react'
@@ -11,6 +12,7 @@ type Feedback = { text: string; kind: 'copied' | 'saved' | 'notice' | 'error' }
/** Copy choices stay beside the meeting controls. Saving before use protects the latest edits. */
export function ShareMenu({ id, shown, status, hasEnhanced, beforeUse }: { id: string; shown: 'mine' | 'enhanced'; status: NoteStatus; hasEnhanced: boolean; beforeUse: () => Promise<boolean> }) {
const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)
+ const presence = usePopoverPresence(open, open === 'pointer')
const [said, setSaid] = useState<Feedback>()
const root = useRef<HTMLDivElement>(null)
const button = useRef<HTMLButtonElement>(null)
@@ -91,8 +93,8 @@ export function ShareMenu({ id, shown, status, hasEnhanced, beforeUse }: { id: s
<Copy size={13} strokeWidth={1.75} aria-hidden="true" />{t('Copy')}
<ChevronDown size={12} strokeWidth={1.75} aria-hidden="true" />
</button>
- {open && (
- <div data-testid="share-menu" data-pointer={open === 'pointer'} role="menu" aria-label={t('Copy and export')} onKeyDown={onMenuKey}
+ {presence.value && (
+ <div data-testid="share-menu" {...presence.props} role="menu" aria-label={t('Copy and export')} onKeyDown={onMenuKey}
className="menu-entry absolute end-0 top-full z-30 mt-2 w-60 rounded-xl border border-line bg-float p-1.5 text-ink shadow-[var(--shadow)]">
<button ref={(el) => { items.current[0] = el }} role="menuitem" data-testid="share-copy-notes" onClick={() => run(() => void copy('notes', 'mine'))} className={row}>
<Copy size={15} strokeWidth={1.75} aria-hidden="true" className="text-muted" /><span className="flex-1">{t('Copy my notes')}</span>
diff --git a/app/src/renderer/src/components/SpokenMenu.tsx b/app/src/renderer/src/components/SpokenMenu.tsx
index f8da94a2..6c8ff1d7 100644
--- a/app/src/renderer/src/components/SpokenMenu.tsx
+++ b/app/src/renderer/src/components/SpokenMenu.tsx
@@ -1,3 +1,4 @@
+import { usePopoverPresence } from '../motion'
import { useEffect, useRef, useState, type KeyboardEvent } from 'react'
import { Check, ChevronDown, Info, Languages } from 'lucide-react'
import { WHISPER_LANGUAGES, type Spoken } from '../../../shared/spoken'
@@ -13,6 +14,7 @@ export const spokenName = (s: Spoken): string => (s === 'en' ? t('English') : t(
export function SpokenMenu() {
const [spoken, setSpoken] = useState<Spoken>()
const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)
+ const presence = usePopoverPresence(open, open === 'pointer')
const root = useRef<HTMLDivElement>(null)
const button = useRef<HTMLButtonElement>(null)
@@ -65,8 +67,8 @@ export function SpokenMenu() {
<span data-testid="spoken-name" className="truncate">{spokenName(spoken)}</span>
<ChevronDown size={11} aria-hidden="true" className="shrink-0" />
</button>
- {open && (
- <div data-testid="spoken-menu" data-pointer={open === 'pointer'} data-anchor="bottom-start" role="menu" aria-label={t('Spoken language')} onKeyDown={onKey}
+ {presence.value && (
+ <div data-testid="spoken-menu" {...presence.props} data-anchor="bottom-start" role="menu" aria-label={t('Spoken language')} onKeyDown={onKey}
className="menu-entry absolute bottom-full start-0 z-30 mb-2 w-64 rounded-xl border border-line bg-float p-1.5 text-ink shadow-[var(--shadow)]">
<button role="menuitemradio" aria-checked={spoken === 'en'} data-testid="spoken-en" onClick={() => choose('en')} className={row}>
<span className="flex min-w-0 flex-col">
diff --git a/app/src/renderer/src/components/TrashToast.tsx b/app/src/renderer/src/components/TrashToast.tsx
index cd0ff4a9..605c1421 100644
--- a/app/src/renderer/src/components/TrashToast.tsx
+++ b/app/src/renderer/src/components/TrashToast.tsx
@@ -3,6 +3,7 @@ import { Toast } from '@animate-ui/react/primitives/base-ui/toast'
import { X } from 'lucide-react'
import { t } from '../../../shared/i18n'
import type { SetupState, UpdateStatus } from '../../../shared/types'
+import { motion, useReducedMotion } from '../motion'
import { notesReadyNotice } from '../notesSetup'
import { trashMeetings, restoreMeetings } from '../trashMeetings'
@@ -134,10 +135,11 @@ export function TrashToast({ go }: { go: (route: string) => void }) {
}
function ToastList() {
+ const reduced = useReducedMotion()
const { toasts: shown } = Toast.useToastManager<{ testId?: string; actionTestId?: string }>()
- return shown.map(item => <Toast.Root key={item.id} toast={item} className="app-toast" swipeDirection={['down', 'right']}
+ return shown.map(item => <Toast.Root key={item.id} toast={item} className="app-toast" transition={{ duration: (reduced ? motion.micro : motion.surface) / 1000, ease: motion.softCurve }} exitTransition={{ duration: (reduced ? motion.micro : motion.base) / 1000, ease: motion.out }} swipeDirection={['down', 'right']}
data-kind={item.data?.testId} data-testid={item.transitionStatus === 'ending' ? undefined : item.data?.testId ?? 'app-toast'}>
- <Toast.Content className="app-toast-content">
+ <Toast.Content className="app-toast-content" transition={{ duration: motion.micro / 1000, ease: motion.out }}>
<Toast.Title className="app-toast-title" />
{item.actionProps && <Toast.Action className="app-toast-action" data-testid={item.data?.actionTestId} />}
<Toast.Close className="app-toast-close" aria-label={t('Close')}><X size={14} aria-hidden="true" /></Toast.Close>
diff --git a/app/src/renderer/src/components/ViewPill.tsx b/app/src/renderer/src/components/ViewPill.tsx
index 4d28d949..2a15fadb 100644
--- a/app/src/renderer/src/components/ViewPill.tsx
+++ b/app/src/renderer/src/components/ViewPill.tsx
@@ -1,3 +1,4 @@
+import { usePopoverPresence } from '../motion'
import { useEffect, useRef, useState, type RefObject } from 'react'
import { Ellipsis, RotateCcw } from 'lucide-react'
import { t } from '../../../shared/i18n'
@@ -14,6 +15,7 @@ export function SummaryActions({ hasSummary, canWriteAgain, onWriteAgain, menuBu
}) {
const action = hasSummary ? t('Regenerate summary') : t('Generate summary')
const [open, setOpen] = useState<false | 'pointer' | 'keyboard'>(false)
+ const presence = usePopoverPresence(open, open === 'pointer')
const root = useRef<HTMLDivElement>(null)
const item = useRef<HTMLButtonElement>(null)
useEffect(() => {
@@ -29,8 +31,8 @@ export function SummaryActions({ hasSummary, canWriteAgain, onWriteAgain, menuBu
onClick={(e) => setOpen((o) => o ? false : e.detail > 0 ? 'pointer' : 'keyboard')} className="note-view-menu">
<Ellipsis size={15} strokeWidth={1.75} aria-hidden="true" />
</button>
- {open && (
- <div role="menu" data-testid="note-view-menu-list" data-pointer={open === 'pointer'} data-anchor="end" aria-label={t('Summary')}
+ {presence.value && (
+ <div role="menu" data-testid="note-view-menu-list" {...presence.props} data-anchor="end" aria-label={t('Summary')}
onKeyDown={(e) => { if (e.key === 'Escape' || e.key === 'Tab') { e.preventDefault(); setOpen(false); menuButton.current?.focus() } }}
className="menu-entry absolute end-0 top-full z-30 mt-2 w-52 rounded-xl border border-line bg-float p-1.5 text-ink shadow-[var(--shadow)]">
<button ref={item} role="menuitem" data-testid="note-write-again" disabled={!canWriteAgain} onClick={() => { setOpen(false); onWriteAgain() }}
diff --git a/app/src/renderer/src/components/Workspace.tsx b/app/src/renderer/src/components/Workspace.tsx
index 6206f1ba..3e9135c7 100644
--- a/app/src/renderer/src/components/Workspace.tsx
+++ b/app/src/renderer/src/components/Workspace.tsx
@@ -13,6 +13,7 @@ import { FileText, MessageCircle, Search, Settings, SidebarToggle } from './Icon
import { 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'>
@@ -27,7 +28,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 ? 0.2 : 0, ease: [0.22, 1, 0.36, 1] as [number, number, number, number] }
+ const sidebarTransition = { duration: sidebarMotion ? motion.surface / 1000 : 0, ease: motion.out }
const note = route.startsWith('/note/')
// a saved chat (/chat/<id>) is still under Chat
const section = route.startsWith('/settings/') ? '/settings' : route.startsWith('/chat/') ? '/chat' : route
@@ -77,7 +78,8 @@ 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>
- <Sidebar.Gap className="workspace-sidebar-gap" transition={sidebarTransition} />
+ {/* Reserve the final width once; only the absolute sidebar animates. */}
+ <div className="workspace-sidebar-gap" aria-hidden="true" />
<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/motion.ts b/app/src/renderer/src/motion.ts
index f164ad6b..270d2fcd 100644
--- a/app/src/renderer/src/motion.ts
+++ b/app/src/renderer/src/motion.ts
@@ -1,23 +1,24 @@
-import { useEffect, useState } from 'react'
+import { useEffect, useLayoutEffect, useState } from 'react'
import { cubicBezier } from 'motion'
import { followMotion } from '../../shared/follow'
const REDUCED = '(prefers-reduced-motion: reduce)'
-const SETTLE = [.16, .8, .25, 1] as const
+const OUT = [.23, 1, .32, 1] as const
+const SOFT = [.23, 1.15, .32, 1] as const
+const MOVE = [.77, 0, .175, 1] as const
+const easeOut = cubicBezier(...OUT)
-/** One stretch and settle on opening surfaces. Reading content never scales or blurs. */
-export const surfaceMotion = {
- resizeMs: 180,
- pullMs: 260,
- settleMs: 280,
- exitMs: 160,
- exitHoldMs: 180,
- pullEase: 'cubic-bezier(.18,.8,.25,1)',
- settleEase: `cubic-bezier(${SETTLE.join(',')})`,
- releaseEase: 'cubic-bezier(.2,0,.25,1)',
- settleAt: 0.72,
+export const motion = {
+ micro: 120, base: 180, surface: 240,
+ askExit: 150, // The anchored panel closes just faster than it opens.
+ ease: `cubic-bezier(${OUT.join(',')})`, move: `cubic-bezier(${MOVE.join(',')})`,
+ // One gentle rebound (under 2%) for surfaces and controls that already had bounce.
+ soft: `cubic-bezier(${SOFT.join(',')})`, out: OUT, softCurve: SOFT,
} as const
+// Citation goo keeps its own timing, outside the UI motion tokens.
+export const surfaceMotion = { settleMs: 280 } as const
+
/** Scripted scrolling respects the same system preference as CSS motion. Read it at use time. */
export const scrollBehavior = (): ScrollBehavior =>
window.matchMedia(REDUCED).matches ? 'auto' : 'smooth'
@@ -39,13 +40,13 @@ export function useReducedMotion(): boolean {
* Scrolls `el` to `top` over a moment, frame by frame, and returns a way to stop it. The browser's own smooth scroll
* can't be stopped, and one that starts as a person turns the wheel swallows their scroll. Jumps with reduced motion.
*/
-export function glide(el: HTMLElement, top: number, done: () => void, ms = 240): () => void {
+export function glide(el: HTMLElement, top: number, done: () => void, ms: number = motion.surface): () => void {
if (scrollBehavior() === 'auto') { el.scrollTop = top; done(); return () => {} }
const from = el.scrollTop, t0 = performance.now()
let frame = 0
const step = (now: number) => {
const p = Math.min(1, (now - t0) / ms)
- el.scrollTop = from + (top - from) * (1 - (1 - p) ** 3)
+ el.scrollTop = from + (top - from) * easeOut(p)
if (p < 1) frame = requestAnimationFrame(step)
else done()
}
@@ -55,14 +56,14 @@ export function glide(el: HTMLElement, top: number, done: () => void, ms = 240):
/** One frame loop takes the latest seek; earlier motion keeps its momentum until the final target settles. */
export function followGlide(el: HTMLElement, done: () => void) {
- const motion = followMotion(el.scrollTop, surfaceMotion.settleMs, cubicBezier(...SETTLE))
+ const scroll = followMotion(el.scrollTop, motion.surface, easeOut)
let target = el.scrollTop, frame = 0
const step = (now: number) => {
frame = 0
if (scrollBehavior() === 'auto') { el.scrollTop = target; done(); return }
- motion.to(target, now)
- el.scrollTop = motion.at(now)
- if (motion.active) frame = requestAnimationFrame(step)
+ scroll.to(target, now)
+ el.scrollTop = scroll.at(now)
+ if (scroll.active) frame = requestAnimationFrame(step)
else done()
}
return {
@@ -71,3 +72,22 @@ export function followGlide(el: HTMLElement, done: () => void) {
get active() { return frame !== 0 },
}
}
+
+/** Keep custom popovers mounted for the shared exit, without retaining interactive controls. */
+export function usePopoverPresence<T>(open: T, pointer: boolean) {
+ const [last, setLast] = useState({ value: open, pointer })
+ useLayoutEffect(() => {
+ if (open) { setLast({ value: open, pointer }); return }
+ if (!last.value) return
+ const timer = setTimeout(() => setLast({ value: open, pointer: false }), motion.micro)
+ return () => clearTimeout(timer)
+ }, [open, pointer])
+ return {
+ value: open || (last.pointer ? last.value : undefined),
+ props: {
+ 'data-pointer': open ? pointer : last.pointer,
+ 'data-ending-style': open ? undefined : '',
+ inert: !open,
+ },
+ }
+}
diff --git a/app/src/renderer/src/screens/ChatPage.tsx b/app/src/renderer/src/screens/ChatPage.tsx
index a63e3b52..375be24e 100644
--- a/app/src/renderer/src/screens/ChatPage.tsx
+++ b/app/src/renderer/src/screens/ChatPage.tsx
@@ -19,6 +19,7 @@ export function ChatPage({ id, go, openSource }: { id: string | null; go: (route
const [prepared, setPrepared] = useState<ConversationView>()
const [error, setError] = useState(false)
const [recent, setRecent] = useState(false)
+ const [recentPointer, setRecentPointer] = useState(false)
const recentButton = useRef<HTMLButtonElement>(null)
const [editing, setEditing] = useState<{ id: string; title: string; kind: 'rename' | 'delete' }>()
const [showAll, setShowAll] = useState(false)
@@ -28,7 +29,7 @@ export function ChatPage({ id, go, openSource }: { id: string | null; go: (route
const navigation = useRef(0)
const change = (update: () => void) => {
transition.current?.skipTransition()
- if (!page.current?.startViewTransition || window.matchMedia('(prefers-reduced-motion: reduce)').matches) { update(); return }
+ if (!page.current?.startViewTransition) { update(); return }
transition.current = page.current.startViewTransition(() => flushSync(update))
void transition.current.ready.catch(() => {})
}
@@ -75,11 +76,11 @@ export function ChatPage({ id, go, openSource }: { id: string | null; go: (route
{!id && <StartRecording />}
<div className="ask-page-toolbar">
{id && <button className="ask-back" onClick={back}><ArrowLeft size={14} aria-hidden="true" />{t('Ask')}</button>}
- <Popover.Root open={recent} onOpenChange={next => { setRecent(next); if (!next) setShowAll(false) }}>
+ <Popover.Root open={recent} onOpenChange={(next, details) => { if (next) setRecentPointer(details.event instanceof MouseEvent && details.event.detail > 0); setRecent(next); if (!next) setShowAll(false) }}>
<Popover.Trigger ref={recentButton} data-testid="chat-recent" className="ask-recent-button"><Clock size={14} aria-hidden="true" />{t('Recent')}</Popover.Trigger>
<Popover.Portal>
<Popover.Positioner side="bottom" align="end" sideOffset={8} collisionPadding={16} className="ask-recent-positioner">
- <Popover.Popup data-testid="chat-recent-list" className="ask-history" aria-label={t('Conversations')}>
+ <Popover.Popup data-testid="chat-recent-list" className="menu-entry ask-history" data-pointer={recentPointer} aria-label={t('Conversations')}>
<ScrollFade><div className="ask-history-scroll">
<LoadingContent pending={!list} skeleton={<Loading layout="history" />}>
{list && !history.groups.some(g => g.length) && <p className="ask-history-empty">{t('Your conversations will show up here.')}</p>}
diff --git a/app/src/renderer/src/screens/Note.tsx b/app/src/renderer/src/screens/Note.tsx
index b468008c..bf41832a 100644
--- a/app/src/renderer/src/screens/Note.tsx
+++ b/app/src/renderer/src/screens/Note.tsx
@@ -4,7 +4,7 @@ import type { LibrarySource } from '../../../shared/types'
import { flushSync } from 'react-dom'
import { Loading } from '../components/Loading'
import { LoadingContent } from '../components/LoadingContent'
-import { useReducedMotion } from '../motion'
+import { motion, useReducedMotion } from '../motion'
import { useEffect, useLayoutEffect, useMemo, useRef, useState, type KeyboardEvent } from 'react'
import { useScrollMemory } from '../useScrollMemory'
import { AudioLines, Lock, RotateCcw, Trash2, TextAlignStart, TriangleAlert } from 'lucide-react'
@@ -187,7 +187,7 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource }: {
summaryButton.current?.focus({ preventScroll: true })
}
if (reducedMotion) { enter(); return }
- const timer = setTimeout(enter, 120)
+ const timer = setTimeout(enter, motion.micro)
return () => clearTimeout(timer)
}, [id, finishRequested, hasEnhanced, reducedMotion])
const mineSave = useAutosave(id, 'mine', notes?.mine ?? '', notes?.saves?.mine)
@@ -237,7 +237,7 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource }: {
if (side) pick(side)
}
const root = panels.current
- if ((next === primary && (!side || side === shown)) || !root?.startViewTransition || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
+ if ((next === primary && (!side || side === shown)) || !root?.startViewTransition) {
update()
return
}
diff --git a/app/src/renderer/src/setup.css b/app/src/renderer/src/setup.css
index 61a3e578..d2628a1f 100644
--- a/app/src/renderer/src/setup.css
+++ b/app/src/renderer/src/setup.css
@@ -22,7 +22,7 @@
.settings-permission-status { display:inline-flex;align-items:center;padding:1px 6px;border-radius:4px;font-size:11px;line-height:16px;font-weight:400;color:var(--muted);background:var(--control); }
.settings-action { flex:none;max-width:170px; }
.settings-action.workspace-button { height:auto;min-height:30px;white-space:normal;line-height:17px;text-align:center; }
-.settings-link { display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:28px;padding:4px 7px;border-radius:5px;font-size:12px;line-height:18px;color:var(--muted);transition:background-color 120ms ease,color 120ms ease; }
+.settings-link { display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:28px;padding:4px 7px;border-radius:5px;font-size:12px;line-height:18px;color:var(--muted);transition:background-color var(--dur-micro) ease,color var(--dur-micro) ease; }
.settings-link:hover:not(:disabled) { background:var(--control-hover);color:var(--ink); }
.settings-link:active:not(:disabled) { background:var(--control-pressed); }
.settings-link:disabled { opacity:.5; }
@@ -33,9 +33,9 @@
#settings-app-language { width:240px; }
.settings-select:focus-visible { outline:2px solid var(--focus);outline-offset:2px; }
.settings-name-field:focus-visible { outline:2px solid var(--focus);outline-offset:2px; }
-.settings-toggle { position:relative;flex:none;width:38px;height:22px;border:1px solid var(--control-border);border-radius:12px;background:var(--control-pressed);box-shadow:inset 0 1px 2px #00000014;transition:background-color 160ms ease,border-color 160ms ease; }
+.settings-toggle { position:relative;flex:none;width:38px;height:22px;border:1px solid var(--control-border);border-radius:12px;background:var(--control-pressed);box-shadow:inset 0 1px 2px #00000014;transition:background-color var(--dur-micro) ease,border-color var(--dur-micro) ease; }
.settings-toggle[aria-checked=true] { background:var(--primary);border-color:var(--primary); }
-.settings-toggle-knob { position:absolute;inset-block-start:2px;inset-inline-start:2px;width:16px;height:16px;border-radius:50%;background:linear-gradient(#fff,#f5f5f7);box-shadow:0 1px 3px #0003,inset 0 0 0 .5px #0000000a;transition:transform 300ms cubic-bezier(.34,1.35,.64,1),width 160ms cubic-bezier(.22,1,.36,1); }
+.settings-toggle-knob { position:absolute;inset-block-start:2px;inset-inline-start:2px;width:16px;height:16px;border-radius:50%;background:linear-gradient(#fff,#f5f5f7);box-shadow:0 1px 3px #0003,inset 0 0 0 .5px #0000000a;transition:transform var(--dur-base) var(--ease-soft),width var(--dur-micro) var(--ease-out); }
.settings-toggle[aria-checked=true] .settings-toggle-knob { transform:translateX(16px); }
.settings-toggle:dir(rtl)[aria-checked=true] .settings-toggle-knob { transform:translateX(-16px); }
/* the knob slides past and settles, and stretches toward where it's going while pressed */
@@ -53,14 +53,14 @@
.settings-backup-actions { display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:14px; }
.settings-backup-actions .workspace-button { font-size:12px; }
.settings-backup-status { display:flex;flex-wrap:wrap;align-items:center;gap:5px 10px;margin-top:12px;font-size:12px;line-height:18px; }
-.settings-jargon-field { position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:5px;min-height:34px;margin-top:11px;padding:4px 5px;border:1px solid var(--line);border-radius:6px;background:var(--bg);cursor:text;transition:border-color 120ms ease,box-shadow 120ms ease; }
+.settings-jargon-field { position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:5px;min-height:34px;margin-top:11px;padding:4px 5px;border:1px solid var(--line);border-radius:6px;background:var(--bg);cursor:text;transition:border-color var(--dur-micro) ease,box-shadow var(--dur-micro) ease; }
.settings-jargon-field:focus-within { border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft); }
.settings-jargon-input { flex:1;min-width:150px;height:24px;padding-inline:5px;background:transparent;color:var(--ink);font-size:13px;outline:none; }
.settings-jargon-input:focus-visible { outline:none; }
.settings-jargon-input::placeholder { color:var(--muted); }
.settings-jargon-chip { display:inline-flex;align-items:center;gap:2px;max-width:100%;height:24px;padding-inline:8px 3px;border-radius:5px;background:var(--control);color:var(--ink);font-size:12px;line-height:18px;cursor:default; }
.settings-jargon-chip>span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
-.settings-jargon-remove { display:grid;place-items:center;flex:none;width:18px;height:18px;border-radius:4px;color:var(--muted);transition:background-color 120ms ease,color 120ms ease; }
+.settings-jargon-remove { display:grid;place-items:center;flex:none;width:18px;height:18px;border-radius:4px;color:var(--muted);transition:background-color var(--dur-micro) ease,color var(--dur-micro) ease; }
.settings-jargon-remove:hover { color:var(--ink);background:var(--control-hover); }
.settings-jargon-remove:active { background:var(--control-pressed); }
.settings-jargon-remove:focus-visible { outline:2px solid var(--focus);outline-offset:0; }
@@ -129,14 +129,14 @@
.ob-guide-help summary { display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer;list-style:none; }
.ob-guide-help summary::-webkit-details-marker { display:none; }
/* a small chevron that turns as it opens, like Settings' Calendars */
-.ob-guide-help summary::after { content:"";flex:none;width:6px;height:6px;margin-inline-end:3px;border-inline-end:1.5px solid currentColor;border-block-end:1.5px solid currentColor;transform:rotate(-45deg);transition:transform 200ms cubic-bezier(.16,.8,.25,1); }
+.ob-guide-help summary::after { content:"";flex:none;width:6px;height:6px;margin-inline-end:3px;border-inline-end:1.5px solid currentColor;border-block-end:1.5px solid currentColor;transform:rotate(-45deg);transition:transform var(--dur-base) var(--ease-out); }
.ob-guide-help summary:dir(rtl)::after { transform:rotate(45deg); }
.ob-guide-help[open] summary::after { transform:rotate(45deg); }
/* it opens like the other expanding sections: the height grows while the content softens in */
.ob-guide-help { interpolate-size:allow-keywords; }
-.ob-guide-help::details-content { height:0;overflow:hidden;opacity:0;filter:blur(2px);transition:height 220ms cubic-bezier(.22,1,.36,1),opacity 140ms ease-out,filter 140ms ease-out,content-visibility 220ms allow-discrete; }
-.ob-guide-help[open]::details-content { height:auto;opacity:1;filter:blur(0);transition:height 300ms cubic-bezier(.22,1,.36,1),opacity 220ms ease-out 40ms,filter 220ms ease-out 40ms,content-visibility 300ms allow-discrete; }
-@media (prefers-reduced-motion:reduce) { .ob-guide-help::details-content,.ob-guide-help summary::after { transition:none; } }
+.ob-guide-help::details-content { height:0;overflow:hidden;opacity:0;filter:blur(2px);transition:height var(--dur-base) var(--ease-out),opacity var(--dur-micro) var(--ease-out),filter var(--dur-micro) var(--ease-out),content-visibility var(--dur-base) allow-discrete; }
+.ob-guide-help[open]::details-content { height:auto;opacity:1;filter:blur(0);transition:height var(--dur-surface) var(--ease-out),opacity var(--dur-base) var(--ease-out) 40ms,filter var(--dur-base) var(--ease-out) 40ms,content-visibility var(--dur-surface) allow-discrete; }
+@media (prefers-reduced-motion:reduce) { .ob-guide-help::details-content,.ob-guide-help[open]::details-content { filter:none;transition:opacity var(--dur-micro) var(--ease-out),content-visibility var(--dur-micro) allow-discrete; } .ob-guide-help summary::after { transition:none; } }
.ob-guide-help summary:focus-visible { outline:2px solid var(--focus);outline-offset:3px;border-radius:2px; }
.ob-guide-help-content { display:grid;justify-items:start;gap:12px;padding-top:12px; }
.ob-note:has(>.ob-guide-help) { gap:12px; }
@@ -194,7 +194,7 @@
.ob-side { display:flex;flex-direction:column;min-width:0;min-height:0;overflow-y:auto;padding:52px clamp(32px,5.4vw,76px) 24px; }
.ob-brand { display:flex;flex:none;align-items:center;height:28px; }
.ob-main { display:flex;flex:1;flex-direction:column;justify-content:center;padding-block:28px; }
-.ob-copy { display:flex;flex-direction:column;max-width:400px;animation:ob-in 460ms cubic-bezier(.23,1,.32,1) both; }
+.ob-copy { display:flex;flex-direction:column;max-width:400px;animation:ob-in 320ms var(--ease-out) both; }
/* two lines of room, words at the bottom: a short headline sits right above its sentence, and the sentence never moves */
.ob-title { display:flex;align-items:flex-end;min-height:2.2em;font-family:var(--font-brand);font-size:36px;line-height:1.1;font-weight:600;letter-spacing:-.035em;color:var(--heading); }
.ob-title>span { text-wrap:balance; }
@@ -209,8 +209,8 @@
.ob-steps [data-done=true] { background:var(--accent); }
/* One button system: primary and quiet share the height, radius, padding and type; quiet has no fill until hovered */
-.ob-button { display:inline-flex;align-items:center;justify-content:center;gap:7px;height:36px;min-width:112px;padding:0 18px;border:1px solid transparent;border-radius:9px;font-size:13px;line-height:18px;font-weight:550;white-space:nowrap;transition:background-color 140ms ease,color 140ms ease,box-shadow 140ms ease,transform 120ms cubic-bezier(.23,1,.32,1); }
-.ob-button:active:not(:disabled) { transform:scale(.98); }
+.ob-button { display:inline-flex;align-items:center;justify-content:center;gap:7px;height:36px;min-width:112px;padding:0 18px;border:1px solid transparent;border-radius:9px;font-size:13px;line-height:18px;font-weight:550;white-space:nowrap;transition:background-color var(--dur-micro) ease,color var(--dur-micro) ease,box-shadow var(--dur-micro) ease,transform var(--dur-micro) var(--ease-out); }
+.ob-button:active:not(:disabled) { transform:scale(.97); }
.ob-button:disabled { opacity:.55;cursor:default; }
.ob-button:focus-visible { outline:2px solid #6F00FF38;outline-offset:2px; }
.ob-button.primary { color:#fff;background:linear-gradient(180deg,#8A3DFF,#6F00FF 60%,#6700EC);border-color:#6200E0;box-shadow:inset 0 1px 0 #FFFFFF40,0 1px 2px #4A00AA2E,0 4px 12px -4px #6F00FF73; }
@@ -229,7 +229,7 @@
.ob-note-line { display:flex;align-items:center;gap:7px; }
.ob-note-line svg { flex:none;color:var(--accent); }
.ob-note-error { color:var(--danger); }
-.ob-link { display:inline-flex;align-items:center;gap:6px;height:26px;margin-inline-start:-7px;padding-inline:7px;border-radius:6px;font-size:12px;font-weight:500;color:var(--accent);transition:background-color 120ms ease; }
+.ob-link { display:inline-flex;align-items:center;gap:6px;height:26px;margin-inline-start:-7px;padding-inline:7px;border-radius:6px;font-size:12px;font-weight:500;color:var(--accent);transition:background-color var(--dur-micro) ease; }
.ob-link:hover { background:var(--control); }
.ob-link:focus-visible { outline:2px solid var(--focus);outline-offset:1px; }
@@ -241,7 +241,7 @@
.ob-progress-percent { text-align:end;white-space:nowrap; }
.ob-stage { container-type:inline-size;position:relative;display:grid;place-items:center;min-width:0;margin:10px;margin-inline-start:0;overflow:hidden;border:1px solid var(--ob-stage-line);border-radius:14px;background:var(--ob-stage-bg); }
-.ob-stage-art { display:grid;place-items:center;width:100%;height:100%;padding:40px 32px;animation:ob-art-in 620ms cubic-bezier(.23,1,.32,1) both; }
+.ob-stage-art { display:grid;place-items:center;width:100%;height:100%;padding:40px 32px;animation:ob-art-in 400ms var(--ease-out) both; }
@keyframes ob-in { from { opacity:0;transform:translateY(8px); } to { opacity:1;transform:none; } }
@keyframes ob-art-in { from { opacity:0;transform:scale(.97); } to { opacity:1;transform:none; } }
@keyframes ob-rise { from { opacity:0;transform:translateY(6px); } to { opacity:1;transform:none; } }
@@ -386,7 +386,8 @@
.ob-actions { margin-top:18px; }
}
@media (prefers-reduced-motion: reduce) {
- .boot-band,.ob-copy,.ob-stage-art,.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-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; }
/* the end of each story, still */
.ob-swap-from { animation:none;opacity:0; }
@@ -403,7 +404,7 @@
.settings-calendar-summary { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
@media (prefers-reduced-motion:no-preference) {
- .settings-disclosure>svg { transition:transform 200ms cubic-bezier(.16,.8,.25,1); }
+ .settings-disclosure>svg { transition:transform var(--dur-base) var(--ease-out); }
}
.settings-group>.loading-content+.loading-content .settings-row::before { content:"";position:absolute;inset-block-start:0;inset-inline:20px;height:1px;background:var(--line); }
@@ -411,3 +412,5 @@
.settings-calendar-list .settings-row:first-child { position:relative; }
.settings-calendar-list .settings-row:first-child::before { content:"";position:absolute;inset-block-start:0;inset-inline:20px;height:1px;background:var(--line); }
+
+@media (prefers-reduced-motion:reduce) { .ob-button:active:not(:disabled) { transform:none; } }
diff --git a/app/src/renderer/src/styles.css b/app/src/renderer/src/styles.css
index a2c2aad9..d7211465 100644
--- a/app/src/renderer/src/styles.css
+++ b/app/src/renderer/src/styles.css
@@ -10,6 +10,12 @@
}
:root {
+ --dur-micro: 120ms;
+ --dur-base: 180ms;
+ --dur-surface: 240ms;
+ --ease-out: cubic-bezier(.23,1,.32,1);
+ --ease-in-out: cubic-bezier(.77,0,.175,1);
+ --ease-soft: cubic-bezier(.23,1.15,.32,1);
--bg: #FFFFFF;
--card: #F6F6F8;
--ink: #23242A;
@@ -155,7 +161,7 @@ body {
/* Native thin overlay scrollbars, shared by every main-window scroll surface. */
.main-window * { scrollbar-width:thin;scrollbar-color:transparent transparent;scrollbar-gutter:auto; }
.main-window :is(*:hover,*:focus-visible,[data-scrolling]) { scrollbar-color:color-mix(in srgb,var(--muted) 25%,transparent) transparent; }
-@layer base { @media (prefers-reduced-motion:no-preference) { :where(.main-window :is(.overflow-auto,.overflow-y-auto,.workspace-sidebar-body,.native-library,.agenda-scroll,.agenda-inspector-scroll,.note-notes-pane,.note-layout,.chat-thread,.chat-history,.settings-scroll,.shortcuts-list,.citation-excerpt,.note-date-events,.finish-setup,.ob-side)) { transition:scrollbar-color 200ms; } } }
+@layer base { @media (prefers-reduced-motion:no-preference) { :where(.main-window :is(.overflow-auto,.overflow-y-auto,.workspace-sidebar-body,.native-library,.agenda-scroll,.agenda-inspector-scroll,.note-notes-pane,.note-layout,.chat-thread,.chat-history,.settings-scroll,.shortcuts-list,.citation-excerpt,.note-date-events,.finish-setup,.ob-side)) { transition:scrollbar-color var(--dur-micro) ease; } } }
@media (prefers-contrast:more),(forced-colors:active) {
.main-window :is(*,*:hover,*:focus-visible,[data-scrolling]) { scrollbar-width:auto;scrollbar-color:auto; }
.main-window *::-webkit-scrollbar { width:6px;height:6px; }
@@ -175,7 +181,7 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
touch-action: none;
}
.widget-pill:focus-visible { outline: 2px solid var(--pill-accent); outline-offset: -3px; }
-.widget-btn { color:#fff;background:#6F00FF;transition: transform 120ms ease, background-color 120ms ease; }
+.widget-btn { color:#fff;background:#6F00FF;transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) ease; }
.widget-btn-secondary { color:var(--pill-ink);background:#39393E; }
.widget-btn:disabled { opacity:.55; }
.widget-retry { color:#FFB0BD; }
@@ -192,7 +198,7 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
.widget-time { white-space:nowrap;font-size:10px;font-weight:500;font-variant-numeric:tabular-nums;line-height:15px;opacity:.8; }
.widget-preview { position:absolute;left:0;top:52px;display:flex;flex-direction:column;padding:0 4px 12px 12px;color:var(--pill-ink);font-size:14px;line-height:21px;transform-origin:50% 0;cursor:default; }
/* closed: the transcript stays mounted but unpainted (hidden once the close has played, its live dots paused); the meter repaints only itself */
-.widget-preview[aria-hidden=true] { visibility:hidden;transition:visibility 0s linear 250ms; }
+.widget-preview[aria-hidden=true] { visibility:hidden;transition:visibility 0s linear var(--dur-base); }
.widget-preview[aria-hidden=true] * { animation-play-state:paused !important; }
[data-testid=widget-wave] { will-change:transform; }
.widget-preview[aria-hidden=true] { pointer-events:none; }
@@ -223,7 +229,7 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
.note-view-menu { display:grid;place-items:center;width:28px;height:28px;border-radius:4px;color:var(--muted); }
.note-view-menu:hover,.note-view-menu[aria-expanded=true] { background:var(--control-hover);color:var(--ink); }
.note-chip, .note-record-action { height:32px; }
-.note-chip, .share-btn, .person-remove { transition: background-color 140ms ease, color 140ms ease, opacity 140ms ease, box-shadow 140ms ease; }
+.note-chip, .share-btn, .person-remove { transition: background-color var(--dur-micro) ease, color var(--dur-micro) ease, opacity var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) ease; }
.note-chip:hover, .note-chip[aria-expanded="true"] { background:var(--control-hover);color:var(--ink); }
.note-chip:focus-visible, .share-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.share-btn:hover { background:var(--control-hover); }
@@ -231,7 +237,7 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
.person-row:hover { background: color-mix(in srgb, var(--line) 45%, transparent); }
/* keyboard focus shows a row's actions; the focus the card takes when it opens doesn't, so only the hovered row shows them */
.person-row:hover .person-remove, .person-row:has(:focus-visible) .person-remove { opacity: 1; }
-.menu-entry { transform-origin: top right; }
+.menu-entry { transform-origin:var(--transform-origin, top right); }
/* Menus share the floating surface in each theme. */
.menu-entry[role="menu"] { color:var(--ink);border-color:var(--line);border-radius:9px;padding:5px;background:var(--float);box-shadow:var(--shadow); }
.menu-entry[role="menu"] :is([role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]) { min-height:32px;border-radius:5px;padding:6px 9px;font-size:12px;line-height:20px; }
@@ -246,22 +252,21 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
/* the mic menu opens upward from the status line under the note's bar */
.menu-entry[data-anchor="bottom-start"] { transform-origin: bottom left; }
[dir="rtl"] .menu-entry[data-anchor="bottom-start"] { transform-origin: bottom right; }
-.menu-entry[data-pointer="true"] { animation: menu-in 140ms cubic-bezier(0.2, 0.8, 0.2, 1); }
-@keyframes menu-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
-@media (prefers-reduced-motion: reduce) { .note-chip, .share-btn, .person-remove, .menu-entry[data-pointer] { animation: none; transition: none; } }
-.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }
-.ghost-btn { display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 4px 8px; color: var(--muted); transition: color 120ms ease, background-color 120ms ease; }
+.menu-entry[data-pointer=true] { transition:opacity var(--dur-base) var(--ease-out),transform var(--dur-base) var(--ease-out); }
+.menu-entry[data-pointer=true][data-starting-style] { opacity:0;transform:scale(.97); }
+@starting-style { .menu-entry[data-pointer=true] { opacity:0;transform:scale(.97); } }
+.menu-entry[data-pointer=true][data-ending-style] { opacity:0;transform:none;transition:opacity var(--dur-micro) var(--ease-out);pointer-events:none; }
+@media (prefers-reduced-motion:reduce) {
+ .note-chip,.share-btn,.person-remove { transition:opacity var(--dur-micro) var(--ease-out); }
+ .menu-entry[data-pointer=true] { transition:opacity var(--dur-micro) var(--ease-out); }
+ .menu-entry[data-pointer=true][data-starting-style] { transform:none; }
+ @starting-style { .menu-entry[data-pointer=true] { transform:none; } }
+}
+
+.ghost-btn { display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 4px 8px; color: var(--muted); transition: color var(--dur-micro) ease, background-color var(--dur-micro) ease; }
.ghost-btn:hover, .ghost-btn[aria-pressed="true"] { color:var(--ink);background:var(--control-hover); }
-.switch-marker { transition: inset-inline-start 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
-.rec-dot { animation: rec-pulse 1.6s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: 0.35; } }
-.panel-in { animation: panel-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
-@keyframes panel-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
-[dir="rtl"] .panel-in { animation-name: panel-in-rtl; }
-@keyframes panel-in-rtl { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
-.skeleton { background: linear-gradient(90deg, var(--line) 0%, color-mix(in srgb, var(--line) 40%, var(--card)) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
-.writing-label { animation: rec-pulse 1.8s ease-in-out infinite; }
/* Notes are the primary surface: calm body text and deliberate section hierarchy. */
.note-prose, .note-empty { font-size: 15px; line-height: 1.7; }
@@ -292,16 +297,11 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
/* the chat's answers have no gutter for the # */
.chat-answer h1::before, .chat-answer h2::before, .chat-answer h3::before { content: none; }
@keyframes fade-in { from { opacity: 0.4; } to { opacity: 1; } }
-@media (prefers-reduced-motion: reduce) {
- .switch-marker, .panel-in, .rec-dot, .skeleton, .writing-label { animation: none; transition: none; }
-}
/* ---- the transcript ---- */
/* chat: the conversation rises into place; an answer's words fade up as they arrive */
-.chat-in { animation: chat-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
-@keyframes chat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
-.fw { animation: fade-in 140ms ease-out both; }
-@keyframes fw { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
+.chat-in { animation: motion-fade var(--dur-base) var(--ease-out) both; }
+.fw { animation: fade-in var(--dur-micro) var(--ease-out) both; }
.chat-answer { font-size: 14.5px; line-height: 1.6; }
/* text still streaming in (useSmoothText): a soft pulsing dot after the last word, in the last block or list item */
:where(.stream-caret, .streaming .note-prose):empty::after,
@@ -314,22 +314,22 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
@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>* { grid-area:1/1;display:inline-flex;transition:opacity var(--dur-base) var(--ease-out),filter var(--dur-base) var(--ease-out),transform var(--dur-base) var(--ease-soft); }
.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; }
+.swap-in { animation:swap-in var(--dur-base) var(--ease-out) both; }
@keyframes swap-in { from { opacity:0;filter:blur(2px); } }
-.follow-arrow { transition:transform 240ms cubic-bezier(.34,1.3,.64,1); }
+.follow-arrow { transition:transform var(--dur-base) var(--ease-soft); }
.follow-arrow[data-up=true] { transform:rotate(180deg); }
-@media (prefers-reduced-motion:reduce) { .swap>*,.swap-in,.follow-arrow { transition:none;animation:none; } }
+@media (prefers-reduced-motion:reduce) { .swap>* { transition:opacity var(--dur-micro) var(--ease-out);transform:none!important;filter:none!important; } .swap-in { animation:motion-fade var(--dur-micro) var(--ease-out); } .follow-arrow { transition:none; } }
/* Expanding sections (Settings → Calendars): the panel grows to its height while the content softens in, and closes a little quicker */
-.accordion { display:grid;grid-template-rows:0fr;transition:grid-template-rows 220ms cubic-bezier(.22,1,.36,1); }
-.accordion[data-open=true] { grid-template-rows:1fr;transition-duration:300ms; }
-.accordion>* { min-height:0;overflow:hidden;opacity:0;filter:blur(2px);visibility:hidden;transition:opacity 140ms ease-out,filter 140ms ease-out,visibility 220ms; }
-.accordion[data-open=true]>* { opacity:1;filter:blur(0);visibility:visible;transition:opacity 220ms ease-out 40ms,filter 220ms ease-out 40ms,visibility 0s; }
-@media (prefers-reduced-motion:reduce) { .accordion,.accordion>* { transition:none; } }
+.accordion { display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--dur-base) var(--ease-out); }
+.accordion[data-open=true] { grid-template-rows:1fr;transition-duration:var(--dur-surface); }
+.accordion>* { min-height:0;overflow:hidden;opacity:0;filter:blur(2px);visibility:hidden;transition:opacity var(--dur-micro) var(--ease-out),filter var(--dur-micro) var(--ease-out),visibility var(--dur-base); }
+.accordion[data-open=true]>* { opacity:1;filter:blur(0);visibility:visible;transition:opacity var(--dur-base) var(--ease-out) 40ms,filter var(--dur-base) var(--ease-out) 40ms,visibility 0s; }
+@media (prefers-reduced-motion:reduce) { .accordion { transition:none; } .accordion>*,.accordion[data-open=true]>* { filter:none;transition:opacity var(--dur-micro) var(--ease-out),visibility var(--dur-micro); } .accordion[data-open=true]>* { transition-delay:0s; } }
/* 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; }
.summary-surface, .summary-waiting { position: relative; }
@@ -353,33 +353,31 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
.summary-ink-layer { display: none; }
}
.chat-answer > * + * { margin-top: 0.45em; }
-@media (prefers-reduced-motion: reduce) { .chat-in, .fw { animation: none; transition: none; } .stream-caret::after, .stream-caret *::after, .streaming .note-prose::after, .streaming .note-prose *::after { animation: none; } }
+@media (prefers-reduced-motion: reduce) { .chat-in, .fw { animation:motion-fade var(--dur-micro) var(--ease-out); } .stream-caret::after, .stream-caret *::after, .streaming .note-prose::after, .streaming .note-prose *::after { animation: none; } }
-.line-in { animation: line-in 260ms ease-out; }
-@keyframes line-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
+.line-in { animation: motion-fade var(--dur-base) var(--ease-out) both; }
/* the transcript as a conversation: compact bubbles of one fill, the mic's side at the end, the other side's at the start */
.bubble { max-width: min(85%, 560px); padding: 5px 10px; border-radius: 9px; font-size: 13.5px; line-height: 1.5; text-align: start; overflow-wrap: anywhere; color: var(--ink); }
.bubble-me, .bubble-them { background: var(--control); }
.bubble .line { border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.bubble [data-playing]::before { content: none; }
-.turn-time { opacity: 0; transition: opacity 140ms ease; }
+.turn-time { opacity: 0; transition: opacity var(--dur-micro) var(--ease-out); }
.transcript-turn:hover .turn-time, .transcript-turn:has([data-playing]) .turn-time { opacity: 1; }
/* words not final yet: lighter, each new one fading in, three soft dots after them; once final they deepen in place */
.live-words { color: var(--muted); }
-.live-word { animation: live-word 240ms ease-out both; }
-@keyframes live-word { from { opacity: 0; } to { opacity: 1; } }
+.live-word { animation: motion-fade var(--dur-base) var(--ease-out) both; }
.live-dots { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 7px; height: 1em; vertical-align: -0.1em; }
.live-dots i { width: 4px; height: 4px; border-radius: 999px; background: var(--muted); animation: live-dot 1.2s ease-in-out infinite; }
.live-dots i:nth-child(2) { animation-delay: 0.2s; }
.live-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes live-dot { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
-.line-settle { animation: line-settle 420ms ease-out; }
+.line-settle { animation: line-settle var(--dur-surface) var(--ease-out); }
@keyframes line-settle { from { color: var(--muted); } to { color: var(--ink); } }
@media (prefers-reduced-motion: reduce) {
- .live-word, .line-settle { animation: none; }
+ .live-word { animation:motion-fade var(--dur-micro) var(--ease-out); } .line-settle { animation:none; }
.live-dots i { animation: none; opacity: 0.6; }
}
-.line-playable { transition: background-color 140ms ease; }
+.line-playable { transition: background-color var(--dur-micro) ease; }
.line-playable:hover { background: color-mix(in srgb, var(--line) 55%, transparent); }
.line-playable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* the line being played: the accent's soft tint with a bar at its start (like a live meeting in the agenda), its time
@@ -390,44 +388,29 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
[data-playing] .line-time { opacity: 1; color: var(--accent); }
.transcript-turn:has([data-playing]) .line-who:not([data-color]) { color: var(--accent); }
/* names arrive once the meeting is over: they slide in above the lines, which stay where they are */
-.name-in { animation: name-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
-@keyframes name-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
-/* the recording bar's wave sits in a small ring */
-.rec-level { transition: background-color 140ms ease, color 140ms ease; }
-.rec-level:hover { background: var(--card); color: var(--ink); }
-.rec-level[aria-expanded="true"] { background: var(--card); }
-.player-btn { transition: transform 120ms ease, opacity 120ms ease; }
+.name-in { animation: motion-fade var(--dur-base) var(--ease-out) both; }
+.player-btn { transition: transform var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out); }
.player-btn:hover { opacity: 0.88; }
-.player-btn:active { transform: scale(0.92); }
+.player-btn:active { transform: scale(.97); }
/* a slim track that fills in accent up to where playback is */
.scrubber { -webkit-appearance: none; appearance: none; height: 16px; background: transparent; cursor: pointer; }
.scrubber::-webkit-slider-runnable-track { height: 3px; border-radius: 999px; background: linear-gradient(to right, var(--accent) var(--fill), var(--line) var(--fill)); }
[dir="rtl"] .scrubber::-webkit-slider-runnable-track { background: linear-gradient(to left, var(--accent) var(--fill), var(--line) var(--fill)); }
-.scrubber::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 3px var(--float); transition: transform 120ms ease; }
-.scrubber:hover::-webkit-slider-thumb, .scrubber:active::-webkit-slider-thumb { transform: scale(1.2); }
+.scrubber::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 3px var(--float); }
.scrubber:focus-visible { outline: none; }
.scrubber:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--float), 0 0 0 5px var(--accent); }
@media (prefers-reduced-motion: reduce) {
- .line-in, .name-in { animation: none; }
+ .line-in, .name-in { animation:motion-fade var(--dur-micro) var(--ease-out); }
}
/* ---- home and search ---- */
-.home-btn, .home-pill, .bar-btn { transition: transform 120ms ease, opacity 140ms ease, background-color 140ms ease, color 140ms ease; }
-.home-btn:hover { opacity: 0.88; }
-.home-btn:active, .home-pill:active { transform: scale(0.97); }
-.home-pill:hover { background: var(--card); }
+.bar-btn { transition: transform var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out), background-color var(--dur-micro) ease, color var(--dur-micro) ease; }
.bar-btn:hover { color: var(--ink); background: var(--card); }
-.note-card { transition: background-color 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
-.note-card:hover { background: var(--card); }
/* the note's title renames on click: a faint wash says so */
-.note-title-btn { transition: background-color 140ms ease; }
+.note-title-btn { transition: background-color var(--dur-micro) ease; }
.note-title-btn:hover { background: color-mix(in srgb, var(--line) 60%, transparent); }
.note-title-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
-/* a card's delete button shows on hover or focus, so the list stays calm */
-.card-delete { opacity: 0; transition: opacity 140ms ease, color 140ms ease; }
-.card-row:hover .card-delete, .card-delete:focus-visible { opacity: 1; }
-.card-delete:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
-.note-card:focus-visible, .home-btn:focus-visible, .home-pill:focus-visible, .bar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
+.bar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* a long list: days off screen skip layout and paint until they scroll near */
.past-day { content-visibility: auto; contain-intrinsic-size: auto 320px; }
.search-backdrop { background:var(--scrim); }
@@ -435,8 +418,8 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
.search-header { flex:none;border-bottom:1px solid var(--line); }
.search-input-row { display:flex;align-items:center;gap:14px;padding-inline:22px; }
.swap.search-intent { width:24px;height:24px; }
-.swap.search-intent>* { filter:none;transform:none;transition:opacity 120ms ease; }
-@media (prefers-reduced-motion:reduce) { .swap.search-intent>* { transition:none; } }
+.swap.search-intent>* { filter:none;transform:none;transition:opacity var(--dur-micro) var(--ease-out); }
+@media (prefers-reduced-motion:reduce) { .swap.search-intent>* { transition:opacity var(--dur-micro) var(--ease-out); } }
.search-field { position:relative;min-width:0;flex:1;font-size:22px;font-weight:500;line-height:30px;letter-spacing:-.02em; }
.search-field input { position:relative;display:block;width:100%;min-width:0;height:76px;padding:23px 0;border:0;background:transparent;color:var(--ink);caret-color:var(--accent);font:inherit;letter-spacing:inherit;outline:none; }
.search-field input::placeholder { color:var(--muted);font-weight:400; }
@@ -474,11 +457,13 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
.app-modal { position:fixed;top:50%;left:50%;translate:-50% -50%;z-index:101;width:min(340px,calc(100vw - 40px));max-height:calc(100vh - 40px);padding:0;overflow:auto;border:1px solid var(--line);border-radius:16px;background:var(--float);color:var(--ink);box-shadow:var(--shadow);text-align:start;outline:none; }
/* Keep the outgoing dialog from passing clicks to controls behind it. */
.app-modal-backdrop { pointer-events:auto!important;position:fixed;inset:0;z-index:100;background:var(--scrim); }
-.app-modal.dialog-motion, .app-modal.dialog-motion[data-testid=shortcuts-dialog], .search-panel.dialog-motion { display:flex;flex-direction:column;overflow:visible;border-color:transparent;background:transparent;box-shadow:none; }
-.dialog-motion-surface { position:absolute;inset:-1px;pointer-events:none;border:1px solid var(--line);border-radius:inherit;background:var(--float);box-shadow:var(--shadow);transform-origin:center; }
-.dialog-motion-content { position:relative;display:flex;flex:1;min-height:0;flex-direction:column;overflow:auto;border-radius:inherit; }
-.search-panel>.dialog-motion-content, .app-modal[data-testid=shortcuts-dialog]>.dialog-motion-content { overflow:hidden; }
-@media (prefers-reduced-motion:reduce) { .app-modal { scale:1!important;transition:none; } }
+.dialog-motion { display:flex;flex-direction:column;transform-origin:center;transition:opacity var(--dur-surface) var(--ease-out),transform var(--dur-surface) var(--ease-soft); }
+.dialog-motion[data-starting-style] { opacity:0;transform:scale(.97); }
+.dialog-motion[data-ending-style] { opacity:0;transform:scale(.98);transition-duration:var(--dur-base);transition-timing-function:var(--ease-out); }
+@media (prefers-reduced-motion:reduce) {
+ .dialog-motion,.dialog-motion[data-ending-style] { transition:opacity var(--dur-micro) var(--ease-out); }
+ .dialog-motion[data-starting-style],.dialog-motion[data-ending-style] { transform:none; }
+}
.app-modal[data-testid=delete-confirm] { width:min(294px,calc(100vw - 40px));border-radius:17px; }
.app-modal[data-testid=delete-confirm] .modal-copy { padding:21px 19px 20px; }
.app-modal[data-testid=delete-confirm] .modal-copy p { font-size:11px;line-height:17px; }
@@ -496,27 +481,20 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
.inline-error-action:focus-visible { outline:2px solid var(--focus);outline-offset:2px; }
.inline-error-in-dialog { margin:0 19px 16px;padding:0;border:0;border-radius:0;background:transparent;font-size:12px;line-height:18px; }
.modal-actions { display:flex;flex-direction:column;gap:7px;padding:0 20px 20px; }
-.modal-button { display:inline-flex;align-items:center;justify-content:center;min-height:33px;width:100%;padding:6px 12px;border:1px solid transparent;border-radius:7px;background:var(--control);font-size:12px;font-weight:500;transition:background-color 120ms ease; }
+.modal-button { display:inline-flex;align-items:center;justify-content:center;min-height:33px;width:100%;padding:6px 12px;border:1px solid transparent;border-radius:7px;background:var(--control);font-size:12px;font-weight:500;transition:background-color var(--dur-micro) ease; }
.modal-button:hover:not(:disabled) { background:var(--control-hover); }
.modal-button.danger { color:var(--danger-control-ink);background:var(--danger-soft); }
.modal-button.danger:hover:not(:disabled) { background:color-mix(in srgb,var(--danger-soft) 87%,var(--danger)); }
.modal-button.primary { background:var(--primary);color:#fff; }
.modal-button.primary:hover:not(:disabled) { background:var(--primary-hover); }
.modal-button:disabled { opacity:.55; }
-@keyframes search-in { from { opacity: 0; transform: translateY(-6px) scale(0.99); } to { opacity: 1; transform: none; } }
.search-row[aria-selected="true"] { background:var(--selected); }
-.home-toast { box-shadow: var(--shadow); animation: search-in 160ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.search-mark { background: var(--accent-soft); color: var(--ink); border-radius: 3px; padding: 0 1px; }
@media (prefers-reduced-motion: reduce) {
- .home-btn, .home-pill, .bar-btn, .note-card, .search-backdrop, .search-panel, .home-toast { animation: none; transition: none; }
+ .bar-btn { transition:none; }
}
/* ---- first run and settings ---- */
-.step-in { animation: fade-in 180ms ease-out both; }
-.toggle { transition: background-color 160ms ease; }
-.toggle-knob { transition: inset-inline-start 180ms cubic-bezier(0.2, 0.8, 0.2, 1); }
-.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
-@media (prefers-reduced-motion: reduce) { .step-in, .toggle, .toggle-knob { animation: none; transition: none; } }
/* The window frame and content share a fixed, quiet baseline. */
.window-bar { background: var(--chrome); border-bottom: 1px solid var(--line); }
@@ -543,9 +521,6 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
.calendar-schedule [data-testid="event"] { min-height: 76px; }
.past-day > ul { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.card-row + .card-row { border-top: 1px solid var(--line); }
-.note-card { border: 0; border-radius: 0; background: var(--bg); padding-block: 15px; }
-.note-card > span > span:first-child { font-size: 14px; font-weight: 550; letter-spacing: -.012em; }
-.note-card [data-testid="past-note-preview"] { margin-top: 4px; font-size: 13px; }
.document-main { background: var(--bg); }
.document-body { padding-top: 86px; }
.document-meta { padding-bottom:18px; }
@@ -561,9 +536,7 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
.note-primary-tabs [role=tab] { display:flex;align-items:center;gap:7px;height:36px;padding-inline:1px;border-bottom:2px solid transparent;color:var(--muted);font-size:13px;font-weight:500; }
.note-primary-tabs [role=tab][aria-selected=true] { color:var(--ink); }
.note-primary-tabs [role=tab]:hover { color:var(--ink); }
-@media (prefers-reduced-motion:no-preference) {
- .note-primary-tabs[data-summary-arriving=true] #note-summary-tab { animation:summary-tab-arrive 120ms cubic-bezier(.16,.8,.25,1) both; }
-}
+.note-primary-tabs[data-summary-arriving=true] #note-summary-tab { animation:summary-tab-arrive var(--dur-micro) var(--ease-out) both; }
@keyframes summary-tab-arrive { from { opacity:0; } }
.note-reading-area { position:relative;display:flex;flex:1;min-height:0; }
@@ -571,15 +544,13 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
/* Reading panels must never superimpose outgoing and incoming text. */
:is(.note-panels,.ask-page)::view-transition-group(root) { animation:none; }
:is(.note-panels,.ask-page)::view-transition-old(root) { display:none;animation:none; }
-:is(.note-panels,.ask-page)::view-transition-new(root) { animation:note-panel-in 120ms ease-out both;mix-blend-mode:normal; }
+:is(.note-panels,.ask-page)::view-transition-new(root) { animation:note-panel-in var(--dur-micro) var(--ease-out) both;mix-blend-mode:normal; }
@keyframes note-panel-in { from { opacity:0; } }
-@media (prefers-reduced-motion:reduce) {
- :is(.note-panels,.ask-page)::view-transition-new(root) { animation:none; }
-}
+
.note-tab-indicator { position:absolute;inset-inline-start:0;bottom:-1px;height:2px;width:var(--tab-width,0px);border-radius:1px;background:var(--primary);transform:translateX(var(--tab-x,0px));pointer-events:none; }
@media(prefers-reduced-motion:no-preference) {
- .note-layout[data-tab-pointer=true] .note-tab-indicator { transition:transform 180ms cubic-bezier(.23,1,.32,1),width 180ms cubic-bezier(.23,1,.32,1); }
+ .note-layout[data-tab-pointer=true] .note-tab-indicator { transition:transform var(--dur-base) var(--ease-out),width var(--dur-base) var(--ease-out); }
}
.note-content { min-height:0;min-width:0;flex:1; }
/* The summary grows past the fold while it streams; with a classic scrollbar, a gutter that appears mid-stream would shift the centred text sideways. */
@@ -627,13 +598,6 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
[data-icon=Loader] { animation:icon-spin 1s linear infinite; }
[data-icon] path { transform-box:fill-box;transform-origin:center; }
@keyframes icon-spin { to { transform:rotate(360deg); } }
-@keyframes icon-write { from { stroke-dashoffset:1;opacity:.2; } to { stroke-dashoffset:0;opacity:1; } }
-@keyframes icon-turn { 0%,100% { transform:rotate(0); } 60% { transform:rotate(30deg); } }
-@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
- .workspace-sidebar .workspace-nav:hover>[data-icon=MessageCircle] path:not(:first-child),.workspace-sidebar .workspace-nav:hover>[data-icon=FileText] path:not(:last-child) { stroke-dasharray:1;animation:icon-write 280ms cubic-bezier(.22,1,.36,1) both; }
- .workspace-sidebar .workspace-nav:hover>[data-icon=MessageCircle] path:last-child,.workspace-sidebar .workspace-nav:hover>[data-icon=FileText] path:first-child { animation-delay:65ms; }
- .workspace-sidebar .workspace-nav:hover>[data-icon=Settings] { animation:icon-turn 360ms ease-out; }
-}
@media (prefers-reduced-motion:reduce) { [data-icon=Loader] { animation:none; } }
.chat-icon { display:grid;place-items:center;width:28px;height:28px;flex-shrink:0;border-radius:5px;color:var(--muted); }
@@ -666,7 +630,7 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
@media(max-width:999px) and (max-height:420px) {
.chat-panel { inset-block:16px;height:calc(100dvh - 32px);max-height:calc(100dvh - 32px); }
}
-.note-record-action { display:flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;padding-inline:12px;border:1px solid var(--line);border-radius:6px;background:var(--float);box-shadow:var(--shadow-soft);color:var(--ink);font-size:12px;font-weight:500;white-space:nowrap;transition:background-color 120ms ease,color 120ms ease; }
+.note-record-action { display:flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;padding-inline:12px;border:1px solid var(--line);border-radius:6px;background:var(--float);box-shadow:var(--shadow-soft);color:var(--ink);font-size:12px;font-weight:500;white-space:nowrap;transition:background-color var(--dur-micro) ease,color var(--dur-micro) ease; }
.note-record-action:hover:not(:disabled) { background:var(--control-hover); }
.note-record-action:active:not(:disabled) { background:var(--control-pressed);box-shadow:none; }
.note-record-action:disabled { opacity:.45; }
@@ -679,7 +643,7 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
.note-primary-tools .transcript-actions { order:-1;margin-inline-start:0; }
.transcript-toolbar { display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;padding:10px 12px;border-bottom:1px solid var(--line); }
.transcript-search-field { display:flex;align-items:center;gap:8px;flex:0 1 auto;width:68px;max-width:100%;min-width:32px;height:32px;padding-inline:0;border:1px solid transparent;border-radius:6px;background:transparent; }
-.transcript-search-field { transition:background-color 100ms ease,border-color 100ms ease; }
+.transcript-search-field { transition:background-color var(--dur-micro) ease,border-color var(--dur-micro) ease; }
@media(prefers-reduced-motion:reduce) { .transcript-search-field { transition:none; } }
/* collapsed it reads as a button: a pointer, no hover box (with no padding yet it hugged the word); it opens on click */
.transcript-search-field,.transcript-search-field [data-testid="transcript-search"] { cursor:pointer; }
@@ -790,8 +754,8 @@ html:not(.widget) button:focus-visible, html:not(.widget) input:focus-visible {
.loading-content[data-loading-phase=waiting]>.loading-placeholder { visibility:hidden; }
.loading-content:is([data-loading-phase=waiting],[data-loading-phase=skeleton])>.loading-result { visibility:hidden; }
.loading-content:has(>.loading-result)>.loading-placeholder { position:absolute;inset:0; }
-.loading-content[data-loading-phase=revealing]>.loading-placeholder { position:absolute;inset:0;animation:loading-out 120ms ease-out both; }
-.loading-content[data-loading-phase=revealing]>.loading-result { animation:loading-in 120ms ease-out both; }
+.loading-content[data-loading-phase=revealing]>.loading-placeholder { position:absolute;inset:0;animation:loading-out var(--dur-micro) var(--ease-out) both; }
+.loading-content[data-loading-phase=revealing]>.loading-result { animation:loading-in var(--dur-micro) var(--ease-out) both; }
.loading-mask { pointer-events:none;user-select:none; }
.loading-bar { display:inline-block!important;max-width:100%;height:.65em;min-height:7px;border-radius:4px;background:var(--control);vertical-align:middle; }
.loading-mask .meeting-meta .loading-bar { align-self:flex-end; }
@@ -805,12 +769,11 @@ html:not(.widget) button:focus-visible, html:not(.widget) input:focus-visible {
.loading-mask .settings-select { pointer-events:none; }
@keyframes loading-in { from { opacity:0; } to { opacity:1; } }
@keyframes loading-out { from { opacity:1; } to { opacity:0; } }
-@media (prefers-reduced-motion:reduce) { .loading-content>* { animation:none!important; } }
.main-window :is(.settings-scroll,.native-library) { scrollbar-gutter:stable; }
.transcript-loading-content:is([data-loading-phase=waiting],[data-loading-phase=skeleton])>li:not(.loading-placeholder) { visibility:hidden; }
-.transcript-loading-content[data-loading-phase=revealing]>li:not(.loading-placeholder) { animation:loading-in 120ms ease-out both; }
+.transcript-loading-content[data-loading-phase=revealing]>li:not(.loading-placeholder) { animation:loading-in var(--dur-micro) var(--ease-out) both; }
.transcript-loading-content[data-loaded=true]>.loading-placeholder { position:absolute;inset:8px 16px auto; }
.loading-mask .ask-field { position:relative; }
.loading-mask .ask-field::after { content:"";position:absolute;inset:16px auto auto 16px;width:160px;height:12px;border-radius:4px;background:var(--control); }
@@ -822,7 +785,7 @@ html:not(.widget) button:focus-visible, html:not(.widget) input:focus-visible {
.notes-download-status { display:flex;flex:0 1 auto;min-width:50px;max-width:45%; }
.notes-download-trigger { display:flex;align-items:center;min-width:0;height:30px;padding:0 9px;gap:7px;border:1px solid transparent;border-radius:6px;font-size:11px;font-weight:400;color:var(--muted);font-variant-numeric:tabular-nums; }
.notes-download-trigger:is(:hover,[aria-expanded=true]) { color:var(--ink);background:var(--row-hover);border-color:var(--line); }
-.notes-download-trigger>svg { opacity:.65; }
+.notes-download-trigger>svg { opacity:.65;transition:transform var(--dur-base) var(--ease-out); }
.notes-download-trigger[aria-expanded=true]>svg { transform:rotate(180deg); }
.notes-download-dot { width:5px;height:5px;flex:none;border-radius:50%;background:var(--accent); }
.notes-download-dot[data-failed=true] { background:var(--danger); }
@@ -838,10 +801,11 @@ html:not(.widget) button:focus-visible, html:not(.widget) input:focus-visible {
.notes-download-footer { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px;flex-wrap:wrap; }
.notes-download-support { font-size:11px; }
.notes-download-menu[data-failed=true] .notes-download-support { flex-basis:100%; }
+.notes-download-retry,.notes-download-skip { transition:transform var(--dur-micro) var(--ease-out); }
.notes-download-actions { display:flex;align-items:center;gap:12px; }
.notes-download-actions button { flex:none;border-radius:5px;padding:4px 10px;border:1px solid var(--line);background:var(--control);color:var(--ink);font-size:12px;line-height:18px;white-space:nowrap; }
.notes-download-actions button:hover { background:var(--control-hover); }
-.notes-download-actions button:active { transform:scale(.98); }
+.notes-download-actions button:active:not(:disabled) { transform:scale(.97); }
.notes-download-actions button:focus-visible { outline:2px solid var(--focus);outline-offset:3px; }
.notes-download-actions button:disabled { opacity:.5; }
.notes-download-actions .notes-download-skip { border:0;padding:4px 0;background:transparent;color:var(--muted);font-size:11px; }
@@ -851,5 +815,19 @@ html:not(.widget) button:focus-visible, html:not(.widget) input:focus-visible {
.notes-download-menu:not([data-failed=true]) .notes-download-footer { flex-wrap:nowrap; }
.notes-download-menu:not([data-failed=true]) .notes-download-support { flex:1 1 auto;min-width:0; }
.notes-download-menu [role=alert] { margin-top:10px; }
-@media (prefers-reduced-motion:no-preference) { .notes-download-dot[data-failed=false] { animation:notes-download-pulse 2s ease-in-out infinite; } }
-@keyframes notes-download-pulse { 0%,100% { opacity:.45; } 50% { opacity:1; } }
+
+@keyframes motion-fade { from { opacity:0; } to { opacity:1; } }
+@media (prefers-reduced-motion:reduce) {
+ .widget-btn:active,.player-btn:active,.notes-download-actions button:active:not(:disabled) { transform:none; }
+ .player-btn { transition:opacity var(--dur-micro) var(--ease-out); }
+ .scrubber::-webkit-slider-thumb,.scrubber:hover::-webkit-slider-thumb,.scrubber:active::-webkit-slider-thumb { transition:none;transform:none; }
+ .notes-download-trigger>svg { transition:none; }
+ .widget-preview[aria-hidden=true] { transition-delay:var(--dur-micro); }
+}
+
+.search-panel.dialog-motion,.search-panel.dialog-motion[data-ending-style] { transition:opacity var(--dur-micro) var(--ease-out),transform var(--dur-micro) var(--ease-out); }
+.search-panel.dialog-motion[data-starting-style],.search-panel.dialog-motion[data-ending-style] { transform:scale(.99); }
+@media (prefers-reduced-motion:reduce) {
+ .search-panel.dialog-motion,.search-panel.dialog-motion[data-ending-style] { transition:opacity var(--dur-micro) var(--ease-out); }
+ .search-panel.dialog-motion[data-starting-style],.search-panel.dialog-motion[data-ending-style] { transform:none; }
+}
diff --git a/app/src/renderer/src/useAgendaCard.ts b/app/src/renderer/src/useAgendaCard.ts
index 5a68531f..c1d94e8d 100644
--- a/app/src/renderer/src/useAgendaCard.ts
+++ b/app/src/renderer/src/useAgendaCard.ts
@@ -1,7 +1,7 @@
import { arrow, autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'
import { useLayoutEffect, type RefObject } from 'react'
import { agendaCardGap, agendaCardInset, agendaCardSide, agendaCardSpace, type AgendaCardSide } from '../../shared/agendaCard'
-import { surfaceMotion, useReducedMotion } from './motion'
+import { motion, useReducedMotion } from './motion'
/** Only a side change animates. Ordinary scrolling stays attached to the row. */
export function useAgendaCard(panel: RefObject<HTMLDialogElement | null>, opener: HTMLButtonElement | null, onClose: (restoreFocus?: boolean) => void) {
@@ -64,7 +64,7 @@ export function positionAgendaCard(el: HTMLElement, row: HTMLElement, list: HTML
animation?.cancel()
const distance = oldTop - el.getBoundingClientRect().top
if (!reduced) animation = el.animate([{ transform: `translateY(${distance}px)` }, { transform: 'none' }], {
- duration: surfaceMotion.settleMs, easing: surfaceMotion.settleEase,
+ duration: motion.surface, easing: motion.move,
})
}
side = nextSide
diff --git a/app/src/renderer/src/useLoadingState.ts b/app/src/renderer/src/useLoadingState.ts
index 89f71759..76151483 100644
--- a/app/src/renderer/src/useLoadingState.ts
+++ b/app/src/renderer/src/useLoadingState.ts
@@ -1,5 +1,5 @@
import { useLayoutEffect, useRef, useState } from 'react'
-import { useReducedMotion } from './motion'
+import { motion, useReducedMotion } from './motion'
/** Fast local reads stay invisible; a skeleton that has appeared gets time to be read. */
export function useLoadingState(pending: boolean) {
@@ -16,11 +16,10 @@ export function useLoadingState(pending: boolean) {
}
} else if (phase === 'waiting') setPhase('ready')
else if (phase === 'skeleton') {
- if (reduced) setPhase('ready')
+ if (reduced) setPhase('revealing')
else timer = setTimeout(() => setPhase('revealing'), Math.max(0, 200 - (performance.now() - shownAt.current!)))
} else if (phase === 'revealing') {
- if (reduced) setPhase('ready')
- else timer = setTimeout(() => setPhase('ready'), 120)
+ timer = setTimeout(() => setPhase('ready'), motion.micro)
}
return () => clearTimeout(timer)
}, [pending, phase, reduced])
diff --git a/app/src/renderer/src/useNotePopover.ts b/app/src/renderer/src/useNotePopover.ts
index 04405384..ff9ddd44 100644
--- a/app/src/renderer/src/useNotePopover.ts
+++ b/app/src/renderer/src/useNotePopover.ts
@@ -1,10 +1,10 @@
import { useLayoutEffect, type RefObject } from 'react'
/** The two metadata popovers share bounds, outside dismissal and immediate keyboard focus. */
-export function useNotePopover(card: RefObject<HTMLDivElement | null>, chip: RefObject<HTMLButtonElement | null>, onClose: (restore?: boolean) => void) {
+export function useNotePopover(card: RefObject<HTMLDivElement | null>, chip: RefObject<HTMLButtonElement | null>, onClose: (restore?: boolean) => void, active = true) {
useLayoutEffect(() => {
const el = card.current, anchor = chip.current
- if (!el || !anchor) return
+ if (!el || !anchor || !active) return
const note = anchor.closest('[data-testid="note"]')
const measure = () => {
const rect = anchor.parentElement!.getBoundingClientRect(), width = el.getBoundingClientRect().width
@@ -23,5 +23,5 @@ export function useNotePopover(card: RefObject<HTMLDivElement | null>, chip: Ref
window.addEventListener('resize', measure); window.addEventListener('scroll', measure, true)
document.addEventListener('pointerdown', away)
return () => { observer.disconnect(); window.removeEventListener('resize', measure); window.removeEventListener('scroll', measure, true); document.removeEventListener('pointerdown', away) }
- }, [card, chip, onClose])
+ }, [card, chip, onClose, active])
}
diff --git a/app/src/renderer/src/windows/widgetMorph.ts b/app/src/renderer/src/windows/widgetMorph.ts
index 0e27f161..8bbb4868 100644
--- a/app/src/renderer/src/windows/widgetMorph.ts
+++ b/app/src/renderer/src/windows/widgetMorph.ts
@@ -1,4 +1,5 @@
import { useEffect, useLayoutEffect, useRef, useState } from 'react'
+import { motion } from '../motion'
import { WidgetIntent, widgetContains, widgetExpanded, type WidgetLayout } from '../../../shared/widgetMorph'
/** The same surface and details travel between the two shapes. */
@@ -48,18 +49,18 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
freeze()
const opened = intent.open, box = opened ? expanded : layout.pill
const reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches
- const duration = opened ? 350 : 250, easing = opened ? 'cubic-bezier(.34,1.25,.64,1)' : 'cubic-bezier(.22,1,.36,1)'
- const animate = (node: HTMLElement, to: Record<string, string>, ms = duration, ease = easing, delay = 0) => {
+ const duration = opened ? motion.surface : motion.base, easing = opened ? motion.soft : motion.ease
+ const animate = (node: HTMLElement, to: Record<string, string>, ms: number = duration, ease = easing, delay = 0) => {
const computed = getComputedStyle(node), from = Object.fromEntries(Object.keys(to).map(k => [k, computed[k as keyof CSSStyleDeclaration]]))
Object.assign(node.style, to)
- if (!immediate && !reduced) animations.current.push(node.animate([from, to] as Keyframe[], { duration: ms, easing: ease, delay, fill: 'both' }))
+ if (!immediate && (!reduced || 'opacity' in to)) animations.current.push(node.animate([from, to] as Keyframe[], { duration: reduced ? motion.micro : ms, easing: ease, delay: reduced ? 0 : delay, fill: 'both' }))
}
animate(el, { left: `${box.x}px`, top: `${box.y}px`, width: `${box.width}px`, height: `${box.height}px`, borderRadius: opened ? '16px' : '10px' })
const positions = opened ? [[16, 17], [box.width - timerWidth - 55, 18], [box.width - timerWidth - 16, 18.5]] : [[12, 11], [42, 12], [81, 12.5]]
items.forEach((item, i) => animate(item, { transform: `translate(${positions[i][0]}px,${positions[i][1]}px)` }))
body.style.width = `${expanded.width - 2}px`; body.style.height = `${expanded.height - 54}px`
- animate(body, { transform: opened ? 'translateX(0) scale(1)' : 'translateX(40px) scale(.97)', filter: opened ? 'blur(0px)' : 'blur(2px)' }, duration, 'cubic-bezier(.22,1,.36,1)')
- animate(body, { opacity: opened ? '1' : '0' }, opened ? 200 : 120, 'ease-out', opened ? 50 : 0)
+ animate(body, { transform: opened ? 'translateX(0) scale(1)' : 'translateX(40px) scale(.97)', filter: opened ? 'blur(0px)' : 'blur(2px)' }, duration, motion.ease)
+ animate(body, { opacity: opened ? '1' : '0' }, opened ? motion.base : motion.micro, motion.ease, opened ? 40 : 0)
el.style.visibility = 'visible'
}
const before = previous.current
diff --git a/app/src/renderer/src/workspace.css b/app/src/renderer/src/workspace.css
index 0ae75681..0506c573 100644
--- a/app/src/renderer/src/workspace.css
+++ b/app/src/renderer/src/workspace.css
@@ -24,7 +24,7 @@
.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 90ms ease; }
+.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-micro) var(--ease-out); }
.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; }
@@ -33,10 +33,10 @@
.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 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[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 200ms cubic-bezier(.22,1,.36,1),margin 200ms cubic-bezier(.22,1,.36,1),opacity 120ms ease; }
+.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-micro) var(--ease-out); }
.sidebar-collapsed .workspace-folder-label { height:0;margin-block:18px; }
.workspace-brand { gap:0; }
.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; }
@@ -64,10 +64,6 @@
.workspace:not(.sidebar-collapsed) .workspace-folder-item>.workspace-nav { padding-inline-end:36px;touch-action:none; }
.workspace-folder-item[data-moving=true] { z-index:2;background:var(--float);border-radius:6px;box-shadow:0 2px 8px #0000001A; }
.workspace-folder-item[data-moving=true]>.workspace-nav { cursor:grabbing; }
-@keyframes icon-lift { 0%,100% { transform:translateY(0) rotate(0); } 45% { transform:translateY(-1px) rotate(-6deg); } }
-@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
- .workspace-sidebar .workspace-trash:hover>svg { animation:icon-lift 280ms cubic-bezier(.22,1,.36,1); }
-}
.workspace-folder-item[data-moving=true] .workspace-folder-more { visibility:hidden; }
.workspace-folder-item [role=menuitem]:disabled { opacity:.4; }
.workspace-folder-item>.workspace-nav[data-drop=true] { background:var(--accent-soft);color:var(--ink); }
@@ -93,11 +89,10 @@
.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; }
-.workspace-button { height:30px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border:1px solid var(--line);border-radius:6px;background:var(--float);box-shadow:inset 0 1px 0 #FFFFFF0D,0 1px 2px #0000000A;font-size:12px;font-weight:500;color:var(--ink);white-space:nowrap;transition:background-color 120ms ease,color 120ms ease,box-shadow 120ms ease; }
+.workspace-button { height:30px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border:1px solid var(--line);border-radius:6px;background:var(--float);box-shadow:inset 0 1px 0 #FFFFFF0D,0 1px 2px #0000000A;font-size:12px;font-weight:500;color:var(--ink);white-space:nowrap;transition:background-color var(--dur-micro) ease,color var(--dur-micro) ease,box-shadow var(--dur-micro) ease,transform var(--dur-micro) var(--ease-out); }
.workspace-button:hover:not(:disabled) { background:var(--control-hover); }
.workspace-button:active:not(:disabled) { background:var(--control-pressed);box-shadow:inset 0 1px 2px #0000000A; }
.workspace-button:disabled { opacity:.45;cursor:default; }
@@ -120,7 +115,7 @@
.workspace-toolbar[data-recording-return=true] { gap:16px;padding-inline-end:17px; }
.workspace-toolbar[data-recording-return=true][data-note=true] { padding-inline-end:62px; }
.workspace-toolbar[data-recording-return=true] .workspace-breadcrumb { flex:1;overflow:hidden; }
-.workspace-recording-link { position:relative;flex:none;display:flex;align-items:center;justify-content:center;gap:9px;min-width:86px;height:30px;padding:0 12px;border:1px solid #5200BC;border-radius:9px;background:linear-gradient(180deg,#7A1AFF,#6F00FF 65%,#6600EB);color:#FFFFFF;box-shadow:inset 0 1px 0 #FFFFFF33,0 1px 3px #39008026;font-size:12px;font-weight:500;white-space:nowrap;transition:box-shadow 120ms ease; }
+.workspace-recording-link { position:relative;flex:none;display:flex;align-items:center;justify-content:center;gap:9px;min-width:86px;height:30px;padding:0 12px;border:1px solid #5200BC;border-radius:9px;background:linear-gradient(180deg,#7A1AFF,#6F00FF 65%,#6600EB);color:#FFFFFF;box-shadow:inset 0 1px 0 #FFFFFF33,0 1px 3px #39008026;font-size:12px;font-weight:500;white-space:nowrap;transition:box-shadow var(--dur-micro) ease; }
.recording-return-time { font-variant-numeric:tabular-nums;min-width:32px;text-align:center; }
.workspace-recording-link:hover { filter:brightness(1.06);box-shadow:inset 0 1px 0 #FFFFFF40,0 2px 5px #39008033; }
.workspace-recording-link:active { filter:brightness(.96);box-shadow:inset 0 1px 3px #39008033; }
@@ -169,10 +164,10 @@
.meeting-delete:hover { color:var(--danger); }
.meeting-more { width:27px;height:27px; }
/* Opacity only: sliding text a couple of pixels re-rasterizes the glyphs, which reads as a jitter. The time leaves quickly and the button arrives just after, so the two never sit on top of each other. */
-.row-swap-meta { grid-column:2;transition:opacity 90ms ease-out 40ms; }
-.row-swap-actions { grid-area:1 / 2;justify-self:end;z-index:1;opacity:0;pointer-events:none;transition:opacity 90ms ease-out; }
+.row-swap-meta { grid-column:2;transition:opacity var(--dur-micro) var(--ease-out) 40ms; }
+.row-swap-actions { grid-area:1 / 2;justify-self:end;z-index:1;opacity:0;pointer-events:none;transition:opacity var(--dur-micro) var(--ease-out); }
.row-swap:is(:hover,:focus-visible,:has(:focus-visible),[data-menu-open=true],:has(>.row-swap-actions[aria-expanded=true])) .row-swap-meta { opacity:0;pointer-events:none;transition-delay:0ms; }
-.row-swap:is(:hover,:focus-visible,:has(:focus-visible),[data-menu-open=true],:has(>.row-swap-actions[aria-expanded=true])) .row-swap-actions { opacity:1;pointer-events:auto;transition:opacity 120ms ease-out 50ms; }
+.row-swap:is(:hover,:focus-visible,:has(:focus-visible),[data-menu-open=true],:has(>.row-swap-actions[aria-expanded=true])) .row-swap-actions { opacity:1;pointer-events:auto;transition:opacity var(--dur-micro) var(--ease-out) 50ms; }
.row-swap :is(.workspace-icon,.chat-icon) { background:transparent; }
.row-swap :is(.workspace-icon,.chat-icon):hover:not(:disabled) { background:var(--control-hover); }
.row-swap :is(.workspace-icon,.chat-icon):active:not(:disabled) { background:var(--control-pressed); }
@@ -184,7 +179,7 @@
.meeting-row-menu [role="menuitem"] { display:flex;align-items:center;gap:10px;width:100%;text-align:start; }
.meeting-row-menu [role="menuitem"]:disabled { opacity:.5; }
.meeting-row-menu svg { flex-shrink:0; }
-@media (prefers-reduced-motion:reduce) { .row-swap-meta,.row-swap-actions { transition:none!important;transform:none!important; } }
+@media (prefers-reduced-motion:reduce) { .row-swap-meta,.row-swap-actions { transition:opacity var(--dur-micro) var(--ease-out)!important;transform:none!important; } }
/* The same quiet tile, centered in the space remaining below the header. */
.native-library:has(>.library-empty) { display:flex;flex-direction:column; }
.native-library:has(>.library-empty)>:not(.library-empty) { flex-shrink:0; }
@@ -234,6 +229,8 @@
.agenda-people { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.agenda-live { display:inline-flex;align-items:center;white-space:nowrap;color:var(--muted);font-size:10px;font-weight:500;line-height:16px;padding:1px 0; }
.agenda-inspector { position:absolute;inset:0 auto auto 0;visibility:hidden;z-index:5;max-width:none;overflow:visible;margin:0;padding:0;border:1px solid var(--line);border-radius:12px;background:var(--float);color:var(--ink);box-shadow:var(--shadow);font-size:12px;line-height:18px;overflow-wrap:anywhere; }
+.agenda-inspector[data-side=top] { transform-origin:bottom center; }
+.agenda-inspector[data-side=bottom] { transform-origin:top center; }
.agenda-inspector-content { display:flex;flex-direction:column;gap:16px;overflow:hidden;padding:16px;border-radius:inherit; }
.agenda-inspector-scroll { min-width:0;min-height:0;max-height:240px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain; }
.agenda-inspector-time { flex:none; }
@@ -278,8 +275,8 @@
.trash-note { color:var(--muted);font-size:12px;line-height:1.6;margin:0 0 16px; }
.trash-actions { display:flex;gap:4px; }
.trash-actions .workspace-icon { width:27px;height:27px; }
-/* at the top, under the title bar, so it never covers the Ask bar at the bottom */
-.app-toast-viewport { position:fixed;bottom:20px;inset-inline-end:20px;transition:inset-inline-end 260ms cubic-bezier(.22,1,.36,1),bottom 260ms cubic-bezier(.22,1,.36,1);width:340px;max-width:calc(100% - 40px);z-index:90;outline:none;pointer-events:none; }
+/* Move around the composer without relaying out the toast stack. */
+.app-toast-viewport { position:fixed;bottom:20px;inset-inline-end:20px;--toast-x:0px;--toast-y:0px;translate:var(--toast-x) var(--toast-y);transition:translate var(--dur-surface) var(--ease-in-out);width:340px;max-width:calc(100% - 40px);z-index:90;outline:none;pointer-events:none; }
.app-toast { position:absolute;inset-block-end:0;inset-inline:0;width:100%;height:var(--toast-frontmost-height,var(--toast-height));border:1px solid var(--line);border-radius:11px;background:var(--float);color:var(--ink);box-shadow:0 8px 24px #0000001F,0 1px 3px #00000014;pointer-events:auto;outline:none;--gap:10px;z-index:calc(100 - var(--toast-index,0)); }
.app-toast[data-expanded] { height:var(--toast-height); }
.app-toast[data-limited] { opacity:0; }
@@ -367,7 +364,7 @@
/* no calendar on this computer (Windows, Linux): the library takes the whole width */
.native-home.no-agenda { grid-template-columns:minmax(0,1fr);grid-template-rows:none; }
.workspace-assistant-dock { position:absolute;inset-inline:0;bottom:0;height:44px;display:flex;align-items:center;justify-content:flex-end;padding:0 18px;border-top:1px solid var(--line);background:var(--bg); }
-.workspace-assistant-launch { display:inline-flex;align-items:center;gap:7px;height:28px;padding:0 9px;border:1px solid transparent;border-radius:6px;background:transparent;font-size:11px;font-weight:450;color:var(--muted);transition:background-color 120ms ease,color 120ms ease; }
+.workspace-assistant-launch { display:inline-flex;align-items:center;gap:7px;height:28px;padding:0 9px;border:1px solid transparent;border-radius:6px;background:transparent;font-size:11px;font-weight:450;color:var(--muted);transition:background-color var(--dur-micro) ease,color var(--dur-micro) ease; }
.workspace-assistant-launch:hover { color:var(--ink);background:var(--control); }
.workspace-assistant-launch:active { background:var(--control-pressed); }
.workspace-assistant-launch kbd { margin-inline-start:5px;font:10px/15px var(--font-sans);color:var(--muted); }
@@ -398,7 +395,7 @@
.folder-choices { padding:0 20px 22px; }
.folder-choice-label { color:var(--muted);font-size:11px;font-weight:500;margin-bottom:9px; }
.folder-icon-grid { display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;margin-bottom:20px; }
-.folder-icon-grid button { display:grid;place-items:center;height:38px;border:1px solid transparent;border-radius:8px;background:transparent;transition:background 120ms ease,border-color 120ms ease; }
+.folder-icon-grid button { display:grid;place-items:center;height:38px;border:1px solid transparent;border-radius:8px;background:transparent;transition:background var(--dur-micro) ease,border-color var(--dur-micro) ease; }
.folder-icon-grid button:hover { background:var(--control); }
.folder-icon-grid button[aria-checked=true] { border-color:var(--accent);background:var(--accent-soft); }
.folder-color-grid { display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:6px; }
@@ -410,11 +407,13 @@
.folder-choices button:disabled { opacity:.5; }
@media (prefers-reduced-motion:reduce) { .folder-icon-grid button { transition:none; } }
-body:has(.note-footer) .app-toast-viewport { bottom:var(--note-footer-height,76px); }
-body:has(.chat-page) .app-toast-viewport { bottom:88px; }
-body:has(.chat-panel[open]) .app-toast-viewport { inset-inline-end:460px; }
+body:has(.note-footer) .app-toast-viewport { --toast-y:calc(20px - var(--note-footer-height,76px)); }
+body:has(.chat-page) .app-toast-viewport { --toast-y:-68px; }
+body:has(.chat-panel[open]) .app-toast-viewport { --toast-x:-440px; }
+body:has(.chat-panel[open]) .app-toast-viewport:dir(rtl) { --toast-x:440px; }
@media(max-width:999px) {
- body:has(.chat-panel[open]) .app-toast-viewport { inset-inline-end:16px;bottom:16px; }
+ body:has(.chat-panel[open]) .app-toast-viewport { --toast-x:4px;--toast-y:4px; }
+ body:has(.chat-panel[open]) .app-toast-viewport:dir(rtl) { --toast-x:-4px; }
.chat-panel:has(.app-toast) { inset-block-end:84px;height:min(440px,calc(100dvh - 152px)); }
}
@media(prefers-reduced-motion:reduce) { .app-toast-viewport { transition:none; } }
@@ -426,7 +425,7 @@ body:has(.chat-panel[open]) .app-toast-viewport { inset-inline-end:460px; }
.meeting-folders:empty { display:none; }
.meeting-folder-suggestion { display:flex;min-width:0; }
.meeting-folder-pill { display:inline-flex;align-items:center;gap:5px;height:22px;min-width:0;max-width:140px;flex:0 1 auto;padding:0 7px;border:1px solid var(--line);border-radius:11px;background:transparent;color:var(--written);font-size:11px;line-height:20px; }
-.meeting-folder-pill[data-opens=true] { transition:background-color 120ms ease,color 120ms ease,border-color 120ms ease; }
+.meeting-folder-pill[data-opens=true] { transition:background-color var(--dur-micro) ease,color var(--dur-micro) ease,border-color var(--dur-micro) ease; }
.meeting-folder-pill[data-opens=true]:hover { border-color:var(--control-border);background:var(--control);color:var(--ink); }
.meeting-folder-dot { width:7px;height:7px;flex:none;border-radius:50%;background:var(--folder-ink); }
.meeting-folder-name { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
@@ -451,7 +450,7 @@ body:has(.chat-panel[open]) .app-toast-viewport { inset-inline-end:460px; }
.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 200ms cubic-bezier(.22,1,.36,1); }
+ .workspace[data-sidebar-motion=true] .sidebar-toggle-pane { transition:width var(--dur-surface) var(--ease-out); }
}
/* Ask keeps one reading column and one composer in both surfaces. */
@@ -513,7 +512,7 @@ body:has(.chat-panel[open]) .app-toast-viewport { inset-inline-end:460px; }
.ask-box textarea:focus-visible { outline:none; }
.ask-box textarea::placeholder { color:var(--muted); }
.ask-box-actions { display:flex;align-items:center;justify-content:space-between;margin-top:8px; }
-.ask-toolbar-button { display:grid;place-items:center;width:28px;height:28px;flex:none;border:1px solid transparent;border-radius:50%;color:var(--muted);transition:background-color 120ms ease,color 120ms ease; }
+.ask-toolbar-button { display:grid;place-items:center;width:28px;height:28px;flex:none;border:1px solid transparent;border-radius:50%;color:var(--muted);transition:background-color var(--dur-micro) ease,color var(--dur-micro) ease; }
.ask-toolbar-button:hover:not(:disabled) { background:var(--control);color:var(--ink); }
.ask-toolbar-button:active:not(:disabled) { background:var(--control-hover); }
.ask-toolbar-button:disabled { color:var(--muted);opacity:.45; }
@@ -544,13 +543,13 @@ body:has(.chat-panel[open]) .app-toast-viewport { inset-inline-end:460px; }
.ask-context-row:hover>button,.ask-context-row:focus-within>button { opacity:1; }
.ask-starters { display:flex;flex-direction:column;align-items:flex-end;gap:8px;min-width:0; }
.ask-starters button { max-width:80%;border:0;border-radius:12px;padding:8px 12px;font-size:12px;line-height:20px;color:var(--muted);text-align:start;background:color-mix(in srgb,var(--control) 50%,transparent); }
-.ask-home-starters { opacity:1;visibility:visible;transition:opacity 140ms ease,visibility 0s;flex-direction:row;flex-wrap:wrap;justify-content:center;align-items:center;margin-top:12px; }
-.ask-home-starters[aria-hidden=true] { opacity:0;visibility:hidden;pointer-events:none;transition:opacity 140ms ease,visibility 0s 140ms; }
-@media (prefers-reduced-motion:reduce) { .ask-home-starters,.ask-home-starters[aria-hidden=true] { transition:none; } }
+.ask-home-starters { opacity:1;visibility:visible;transition:opacity var(--dur-micro) var(--ease-out),visibility 0s;flex-direction:row;flex-wrap:wrap;justify-content:center;align-items:center;margin-top:12px; }
+.ask-home-starters[aria-hidden=true] { opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--dur-micro) var(--ease-out),visibility 0s var(--dur-micro); }
+@media (prefers-reduced-motion:reduce) { .ask-home-starters { transition:opacity var(--dur-micro) var(--ease-out),visibility 0s; } .ask-home-starters[aria-hidden=true] { transition-delay:0s,var(--dur-micro); } }
.ask-home-starters button { height:28px;max-width:100%;padding:4px 10px;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.ask-starters button:hover:not(:disabled) { background:var(--control);color:var(--ink); }
.ask-starters button:active:not(:disabled) { background:var(--control-pressed); }
-.ask-picker { position:absolute;z-index:80;inset-inline:0;bottom:calc(100% + 8px);max-height:min(260px,40vh);overflow-y:auto;border:1px solid var(--line);border-radius:10px;background:var(--float);box-shadow:var(--shadow-soft);padding:6px;animation:ask-fade 160ms ease-out; }
+.ask-picker { position:absolute;z-index:80;inset-inline:0;bottom:calc(100% + 8px);max-height:min(260px,40vh);overflow-y:auto;border:1px solid var(--line);border-radius:10px;background:var(--float);box-shadow:var(--shadow-soft);padding:6px;animation:ask-fade var(--dur-micro) var(--ease-out); }
.ask-landing .ask-picker { top:calc(100% + 8px);bottom:auto; }
.ask-picker h3 { padding:7px 8px;font-size:11px;font-weight:550;color:var(--muted); }
.ask-picker button { display:flex;align-items:center;gap:8px;width:100%;padding:8px;border-radius:5px;text-align:start;font-size:13px; }
@@ -578,15 +577,13 @@ body:has(.chat-panel[open]) .app-toast-viewport { inset-inline-end:460px; }
.ask-actions-menu { min-width:156px; }
.ask-actions-menu [role=menuitem] { display:flex;align-items:center;gap:8px;cursor:default; }
.ask-actions-menu [data-highlighted] { background:var(--card);outline:none; }
-.ask-actions-menu,.ask-history { transition:opacity 160ms ease-out; }
-.ask-actions-menu[data-starting-style],.ask-actions-menu[data-ending-style],.ask-history[data-starting-style],.ask-history[data-ending-style] { opacity:0; }
.chat-panel .ask-conversation-head { height:44px;padding-inline:16px 12px; }
.chat-panel .ask-thread { padding:16px 12px; }
.chat-panel .ask-composer { padding:0 12px 12px;overflow:visible; }
@container (max-width:520px) { .ask-page { padding-inline:18px; } }
@media (hover:none) { .ask-context-row>button { opacity:1; } }
@keyframes ask-fade { from { opacity:0; } to { opacity:1; } }
-@media (prefers-reduced-motion:reduce) { .ask-picker { animation:none; } .ask-toolbar-button,.ask-actions-menu,.ask-history { transition:none; } }
+@media (prefers-reduced-motion:reduce) { .ask-toolbar-button { transition:none; } }
/* Keep the suggestion mounted while its actions collapse into the filed chip. */
.note-folder-proposal { width:max-content;max-width:min(256px,100%); }
@@ -596,14 +593,14 @@ body:has(.chat-panel[open]) .app-toast-viewport { inset-inline-end:460px; }
.note-folder-name:hover,.note-folder-name[aria-expanded="true"] { color:var(--ink);background:var(--control-hover); }
.note-folder-name:focus-visible { outline:2px solid var(--accent);outline-offset:2px; }
.note-folder-actions { display:flex;align-items:center;flex:none;padding:0 1px;border-inline-start:1px solid var(--line); }
-.note-folder-proposal,.meeting-folder-proposal { transition:opacity 180ms ease-out,padding 180ms ease-out,gap 180ms ease-out; }
-.note-folder-actions { width:59px;overflow:hidden;transition:width 180ms ease-out,opacity 180ms ease-out,padding 180ms ease-out,border-width 180ms ease-out; }
+.note-folder-proposal,.meeting-folder-proposal { transition:opacity var(--dur-base) var(--ease-out),padding var(--dur-base) var(--ease-out),gap var(--dur-base) var(--ease-out); }
+.note-folder-actions { width:59px;overflow:hidden;transition:width var(--dur-base) var(--ease-out),opacity var(--dur-base) var(--ease-out),padding var(--dur-base) var(--ease-out),border-width var(--dur-base) var(--ease-out); }
.meeting-folder-proposal .note-folder-actions { width:40px; }
[data-phase=accepted] .note-folder-actions,[data-phase=settled] .note-folder-actions { width:0;opacity:0;padding:0;border-inline-start-width:0; }
.meeting-folder-proposal:is([data-phase=accepted],[data-phase=settled]) { border-style:solid;padding-inline-end:7px;gap:0; }
.note-folder-proposal[data-phase=dismissed],.meeting-folder-proposal[data-phase=dismissed] { opacity:0;pointer-events:none; }
@container meeting-library (max-width:460px) {
- .meeting-folder-proposal .note-folder-name span:last-child { max-width:120px;transition:max-width 180ms ease-out,opacity 180ms ease-out; }
+ .meeting-folder-proposal .note-folder-name span:last-child { max-width:120px;transition:max-width var(--dur-base) var(--ease-out),opacity var(--dur-base) var(--ease-out); }
.meeting-folder-proposal:is([data-phase=accepted],[data-phase=settled]) { padding:0;gap:0;min-width:22px; }
.meeting-folder-proposal:is([data-phase=accepted],[data-phase=settled]) .note-folder-name { gap:0;justify-content:center;flex:1; }
.meeting-folder-proposal:is([data-phase=accepted],[data-phase=settled]) .note-folder-name span:last-child { max-width:0;opacity:0; }
@@ -669,3 +666,9 @@ body:has(.chat-panel[open]) .app-toast-viewport { inset-inline-end:460px; }
/* This confirmation and its Settings shortcut stay on one line. */
.app-toast[data-kind=recording-deleted-toast] { inset-inline-start:auto;width:max-content;max-width:calc(100vw - 40px); }
.app-toast[data-kind=recording-deleted-toast] :is(.app-toast-title,.app-toast-action) { white-space:nowrap; }
+.workspace-button:active:not(:disabled) { transform:scale(.97); }
+@media (prefers-reduced-motion:reduce) {
+ .workspace-button:active:not(:disabled) { transform:none; }
+ .app-toast { filter:none!important; }
+ .note-folder-proposal,.meeting-folder-proposal,.note-folder-actions,.meeting-folder-proposal .note-folder-name span:last-child { transition:opacity var(--dur-micro) var(--ease-out); }
+}
diff --git a/app/test/agendaMarkers.test.ts b/app/test/agendaMarkers.test.ts
index 299c0fe3..ab93265b 100644
--- a/app/test/agendaMarkers.test.ts
+++ b/app/test/agendaMarkers.test.ts
@@ -4,7 +4,7 @@ import { renderToStaticMarkup } from 'react-dom/server'
import { expect, it, vi } from 'vitest'
import { Event } from '../src/renderer/src/components/Agenda'
import type { AgendaEvent, MeetingCard } from '../src/shared/types'
-import { surfaceMotion } from '../src/renderer/src/motion'
+import { motion } from '../src/renderer/src/motion'
vi.mock('react', async importOriginal => {
const react = await importOriginal<typeof import('react')>()
@@ -143,13 +143,13 @@ it('resizes from the previous height, retargets interrupted growth and snaps wit
expect(animate).not.toHaveBeenCalled()
height = 78
resize()
- expect(surfaceMotion.resizeMs).toBe(180)
- expect(animate).toHaveBeenLastCalledWith([{ height: '33px' }, { height: '78px' }], { duration: 180, easing: surfaceMotion.settleEase })
+ expect(motion.base).toBe(180)
+ expect(animate).toHaveBeenLastCalledWith([{ height: '33px' }, { height: '78px' }], { duration: 180, easing: motion.ease })
measure.mockReturnValueOnce({ height: 50 })
height = 52
resize()
expect(animation.cancel).toHaveBeenCalledOnce()
- expect(animate).toHaveBeenLastCalledWith([{ height: '50px' }, { height: '52px' }], { duration: 180, easing: surfaceMotion.settleEase })
+ expect(animate).toHaveBeenLastCalledWith([{ height: '50px' }, { height: '52px' }], { duration: 180, easing: motion.ease })
reduced = true
height = 33
resize()
diff --git a/app/test/askComposer.test.ts b/app/test/askComposer.test.ts
index 4d7d7967..e9d8639e 100644
--- a/app/test/askComposer.test.ts
+++ b/app/test/askComposer.test.ts
@@ -1,10 +1,16 @@
import { afterEach, expect, it, vi } from 'vitest'
-import { createElement } from 'react'
+import { createElement, useEffect, type ChangeEvent, type ComponentProps } from 'react'
+import { jsxDEV } from 'react/jsx-dev-runtime'
import { renderToStaticMarkup } from 'react-dom/server'
import { AskConversation } from '../src/renderer/src/components/AskConversation'
import type { ConversationTurn, ConversationView } from '../src/shared/types'
-afterEach(() => vi.unstubAllGlobals())
+vi.mock('react', async original => ({ ...await original<typeof import('react')>(), useEffect: vi.fn() }))
+vi.mock('react/jsx-dev-runtime', async original => {
+ const runtime = await original<typeof import('react/jsx-dev-runtime')>()
+ return { ...runtime, jsxDEV: vi.fn(runtime.jsxDEV) }
+})
+afterEach(() => { vi.unstubAllGlobals(); vi.clearAllMocks() })
it('keeps both composers busy through thinking and streaming, then releases on every terminal state', () => {
vi.stubGlobal('window', { matchMedia: () => ({ matches: false }) })
@@ -25,3 +31,39 @@ it('keeps both composers busy through thinking and streaming, then releases on e
}
})
+
+it('renders the panel input editable and autofocusable while its conversation is still loading', () => {
+ vi.stubGlobal('window', { matchMedia: () => ({ matches: false }) })
+ const html = renderToStaticMarkup(createElement(AskConversation, { id: '', pendingDraftKey: 'meeting/cold-open', panel: true, onSelect() {}, onDeleted() {}, onSource() {} }))
+ const input = html.match(/<textarea[^>]*data-testid="chat-input"[^>]*>/)?.[0]
+ expect(input).toBeTruthy()
+ expect(input).toContain('autofocus=""')
+ expect(input).not.toContain('disabled')
+ expect(input).not.toContain('readOnly')
+ expect(html).toMatch(/data-testid="chat-send"[^>]*disabled=""/)
+})
+
+it('retains typing across pending-ID handoff and failed persistence without carrying it into a new conversation', async () => {
+ const draft = vi.fn().mockRejectedValue(new Error('write failed'))
+ vi.stubGlobal('window', { matchMedia: () => ({ matches: false }), yogurt: {
+ conversations: { draft, get: vi.fn().mockResolvedValue({ draft: 'Older saved draft' }), onChange: () => () => {} },
+ meetings: { onChange: () => () => {} }, folders: { onChange: () => () => {} },
+ } })
+ const render = (id: string) => {
+ renderToStaticMarkup(createElement(AskConversation, { id, pendingDraftKey: 'meeting/pending-draft', panel: true, onSelect() {}, onDeleted() {}, onSource() {} }))
+ return vi.mocked(jsxDEV).mock.calls.filter(([type]) => type === 'textarea').at(-1)![1] as ComponentProps<'textarea'>
+ }
+ const pending = render('')
+ pending.onChange!({ target: { value: 'Keep these first keystrokes', selectionStart: 26 } } as ChangeEvent<HTMLTextAreaElement>)
+ expect(draft).not.toHaveBeenCalled()
+ expect(render('').value).toBe('Keep these first keystrokes')
+ expect(render('resolved-draft').value).toBe('Keep these first keystrokes')
+ const load = vi.mocked(useEffect).mock.calls.filter(([, deps]) => deps?.length === 1 && deps[0] === 'resolved-draft').at(-1)![0]
+ const cleanup = load()
+ expect(draft).toHaveBeenCalledWith('resolved-draft', 'Keep these first keystrokes')
+ await Promise.resolve()
+ await Promise.resolve()
+ expect(render('resolved-draft').value).toBe('Keep these first keystrokes')
+ expect(render('new-conversation').value).toBe('')
+ if (typeof cleanup === 'function') cleanup()
+})
diff --git a/app/test/folderChip.test.ts b/app/test/folderChip.test.ts
index a1078aa1..15639519 100644
--- a/app/test/folderChip.test.ts
+++ b/app/test/folderChip.test.ts
@@ -8,7 +8,7 @@ import { FolderChip, FolderPicker } from '../src/renderer/src/components/FolderP
const state = vi.hoisted(() => ({ all: [] as Folder[], mine: [] as Folder[] }))
vi.mock('../src/renderer/src/folders', () => ({ useFolders: (id?: string) => id ? state.mine : state.all, setMeetingsInFolder: vi.fn() }))
vi.mock('../src/renderer/src/i18n', () => ({ useLanguage: () => 'en' }))
-vi.mock('../src/renderer/src/motion', () => ({ useReducedMotion: () => false }))
+vi.mock('../src/renderer/src/motion', async original => ({ ...await original<typeof import('../src/renderer/src/motion')>(), useReducedMotion: () => false }))
vi.mock('../src/renderer/src/components/TrashToast', () => ({ toasts: { add: vi.fn(), close: vi.fn() } }))
const suggested: Folder = { id: 'suggested', name: 'Customer research and planning', icon: 'rocket', color: 'violet', count: 0, createdAt: 1 }
const alpha: Folder = { ...suggested, id: 'alpha', name: 'Alpha' }
diff --git a/app/test/follow-motion.test.ts b/app/test/follow-motion.test.ts
index 7ae27329..8b6c9cef 100644
--- a/app/test/follow-motion.test.ts
+++ b/app/test/follow-motion.test.ts
@@ -1,5 +1,5 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
-import { followGlide, surfaceMotion } from '../src/renderer/src/motion'
+import { followGlide, motion } from '../src/renderer/src/motion'
afterEach(() => vi.unstubAllGlobals())
@@ -29,7 +29,7 @@ describe('playhead scroll frames', () => {
expect(el.scrollTop).toBeGreaterThan(first)
expect(el.scrollTop).toBeLessThan(1000)
expect(clock.pending.size).toBe(1)
- clock.at(116 + surfaceMotion.settleMs)
+ clock.at(116 + motion.surface)
expect(el.scrollTop).toBe(1500)
expect(clock.pending.size).toBe(0)
expect(done).toHaveBeenCalledOnce()
diff --git a/app/test/motion.test.ts b/app/test/motion.test.ts
new file mode 100644
index 00000000..d0e167b6
--- /dev/null
+++ b/app/test/motion.test.ts
@@ -0,0 +1,118 @@
+import { readFileSync } from 'node:fs'
+import { afterEach, expect, it, vi } from 'vitest'
+import { useLayoutEffect, useRef, useState } from 'react'
+import { cubicBezier } from 'motion'
+import { motion, usePopoverPresence } from '../src/renderer/src/motion'
+import { useLoadingState } from '../src/renderer/src/useLoadingState'
+
+vi.mock('react', async original => ({
+ ...await original<typeof import('react')>(), useState: vi.fn(), useLayoutEffect: vi.fn(), useEffect: vi.fn(), useRef: vi.fn(),
+}))
+afterEach(() => { vi.useRealTimers(); vi.clearAllMocks() })
+
+it('keeps CSS and JS timing in sync and bounds the shared rebound below two percent', () => {
+ const css = readFileSync(new URL('../src/renderer/src/styles.css', import.meta.url), 'utf8')
+ for (const token of ['micro', 'base', 'surface'] as const) expect(css).toContain(`--dur-${token}: ${motion[token]}ms`)
+ for (const [token, value] of [['out', motion.ease], ['in-out', motion.move], ['soft', motion.soft]]) {
+ const actual = css.match(new RegExp(`--ease-${token}: ([^;]+);`))![1]
+ expect(actual.replace(/(?<=\D)0\./g, '.')).toBe(value.replace(/(?<=\D)0\./g, '.'))
+ }
+ const ease = cubicBezier(...motion.softCurve)
+ const peak = Math.max(...Array.from({ length: 1001 }, (_, n) => ease(n / 1000)))
+ expect(peak).toBeGreaterThan(1)
+ expect(peak).toBeLessThanOrEqual(1.02)
+ expect(ease(1)).toBe(1)
+})
+
+// Exercise retained presence and effect cleanup without launching a browser.
+function popover() {
+ let last = { value: false, pointer: false }, cleanup: (() => void) | void
+ const set = (next: unknown) => { last = next as typeof last }
+ return (open: boolean, pointer: boolean) => {
+ cleanup?.()
+ vi.mocked(useState).mockReturnValue([last, set])
+ const result = usePopoverPresence(open, pointer)
+ cleanup = vi.mocked(useLayoutEffect).mock.lastCall![0]()
+ return result
+ }
+}
+
+it('makes closing controls inert immediately and cancels their removal on a fast reopen', () => {
+ vi.useFakeTimers()
+ const render = popover()
+ expect(render(true, true).props.inert).toBe(false)
+ const closing = render(false, false)
+ expect(closing.value).toBe(true)
+ expect(closing.props).toMatchObject({ inert: true, 'data-pointer': true, 'data-ending-style': '' })
+ vi.advanceTimersByTime(motion.micro / 2)
+ const reopened = render(true, true)
+ expect(reopened.props['data-ending-style']).toBeUndefined()
+ vi.advanceTimersByTime(motion.micro)
+ expect(render(true, true).value).toBe(true)
+ render(false, false)
+ vi.advanceTimersByTime(motion.micro)
+ expect(render(false, false).value).toBeUndefined()
+})
+
+it('does not retain keyboard popovers for an exit animation', () => {
+ vi.useFakeTimers()
+ const render = popover()
+ expect(render(true, false).props['data-pointer']).toBe(false)
+ expect(render(false, false).value).toBeUndefined()
+})
+
+it.each([false, true])('holds a shown skeleton normally, but always keeps the short reveal (reduced: %s)', reduced => {
+ vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'performance'] })
+ let phase = 'waiting', cleanup: (() => void) | void
+ const shownAt = { current: undefined as number | undefined }
+ const render = (pending: boolean) => {
+ cleanup?.()
+ vi.mocked(useState).mockReturnValueOnce([reduced, vi.fn()])
+ .mockReturnValueOnce([phase, next => { phase = next as string }])
+ vi.mocked(useRef).mockReturnValue(shownAt)
+ const result = useLoadingState(pending)
+ cleanup = vi.mocked(useLayoutEffect).mock.lastCall![0]()
+ return result
+ }
+ render(true)
+ vi.advanceTimersByTime(99)
+ expect(phase).toBe('waiting')
+ vi.advanceTimersByTime(1)
+ expect(render(true)).toBe('skeleton')
+ render(false)
+ if (!reduced) {
+ vi.advanceTimersByTime(199)
+ expect(phase).toBe('skeleton')
+ vi.advanceTimersByTime(1)
+ }
+ expect(render(false)).toBe('revealing')
+ vi.advanceTimersByTime(motion.micro - 1)
+ expect(phase).toBe('revealing')
+ vi.advanceTimersByTime(1)
+ expect(render(false)).toBe('ready')
+})
+
+it('keeps search subtle and mentions and tabs fading on the short token for either input method', () => {
+ const styles = readFileSync(new URL('../src/renderer/src/styles.css', import.meta.url), 'utf8')
+ const workspace = readFileSync(new URL('../src/renderer/src/workspace.css', import.meta.url), 'utf8')
+ const search = styles.match(/\.search-panel\.dialog-motion,\.search-panel\.dialog-motion\[data-ending-style\] \{([^}]+)\}/)![1]
+ expect(search).toContain('transition:opacity var(--dur-micro) var(--ease-out)')
+ expect(search).toContain('transform var(--dur-micro) var(--ease-out)')
+ expect(styles).toContain('.search-panel.dialog-motion[data-starting-style],.search-panel.dialog-motion[data-ending-style] { transform:scale(.99); }')
+ expect(workspace.match(/\.ask-picker \{([^}]+)\}/)![1]).toContain('animation:ask-fade var(--dur-micro) var(--ease-out)')
+ expect(workspace).not.toContain('.ask-picker { animation:none; }')
+ expect(styles).toContain('::view-transition-new(root) { animation:note-panel-in var(--dur-micro) var(--ease-out)')
+})
+
+it('keeps the anchored panel curve monotonic with a shorter close', () => {
+ expect(motion.base).toBe(180)
+ expect(motion.askExit).toBe(150)
+ const ease = cubicBezier(...motion.out)
+ let previous = 0
+ for (let n = 0; n <= 1000; n++) {
+ const progress = ease(n / 1000)
+ expect(progress).toBeGreaterThanOrEqual(previous)
+ expect(progress).toBeLessThanOrEqual(1)
+ previous = progress
+ }
+})