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.

Ask: the opening flare plays the same whether you click Ask or press ⌘J; a pointer on the box only skips the idle flares

Eric Brownroutb639cf84586c
diff --git a/app/src/shared/askTracer.ts b/app/src/shared/askTracer.ts
index d3aee2a6..a6c647dd 100644
--- a/app/src/shared/askTracer.ts
+++ b/app/src/shared/askTracer.ts
@@ -9,7 +9,8 @@ export type TracerState = { focused: boolean; hovered: boolean; hasText: boolean
export function createTracerSchedule(initial: TracerState, play: () => void, stop: () => void) {
let state = initial, opening = true, disposed = false
let timer: ReturnType<typeof setTimeout> | undefined
- const allowed = () => !state.hovered && !state.hasText && !state.reduced && !state.hidden && (opening || !state.focused)
+ // The opening lap plays the same however the panel opened: a pointer on the box (as after clicking Ask) only skips idle laps.
+ const allowed = () => !state.hasText && !state.reduced && !state.hidden && (opening || !state.focused && !state.hovered)
const cancel = () => { clearTimeout(timer); timer = undefined; stop() }
const schedule = (delay: number) => {
timer = setTimeout(() => {
diff --git a/app/test/askTracer.test.ts b/app/test/askTracer.test.ts
index 0cb7e64a..9143d6e3 100644
--- a/app/test/askTracer.test.ts
+++ b/app/test/askTracer.test.ts
@@ -26,7 +26,7 @@ it('plays one lap after opening even with autofocus, then stays quiet while focu
s.dispose()
})
-it.each(['hasText', 'hovered', 'reduced', 'hidden'] as const)('suppresses opening with %s, without replaying an opening when it clears', flag => {
+it.each(['hasText', 'reduced', 'hidden'] as const)('suppresses opening with %s, without replaying an opening when it clears', flag => {
const s = setup({ ...idle, focused: true, [flag]: true })
vi.advanceTimersByTime(TRACER_DELAY_MS)
s.update({ ...idle, focused: true })
@@ -40,7 +40,7 @@ it.each(['hasText', 'hovered', 'reduced', 'hidden'] as const)('suppresses openin
s.dispose()
})
-it.each(['hasText', 'hovered', 'reduced', 'hidden'] as const)('cancels a running opening on %s and waits a full idle interval', flag => {
+it.each(['hasText', 'reduced', 'hidden'] as const)('cancels a running opening on %s and waits a full idle interval', flag => {
const s = setup()
vi.advanceTimersByTime(TRACER_DELAY_MS)
expect(s.play).toHaveBeenCalledTimes(1)
@@ -77,8 +77,25 @@ it('repeats at eight-second start-to-start intervals only while empty, unfocused
s.dispose()
})
-it('cancels the pending opening on input or hover, including input cleared before the delay ends', () => {
- for (const flag of ['hasText', 'hovered'] as const) {
+it('plays the opening lap with a pointer on the box, as after a click, but skips idle laps while it stays there', () => {
+ const s = setup({ ...idle, focused: true, hovered: true })
+ vi.advanceTimersByTime(TRACER_DELAY_MS)
+ expect(s.play).toHaveBeenCalledTimes(1)
+ s.update({ ...idle, focused: true, hovered: true })
+ expect(s.stop).not.toHaveBeenCalled()
+ vi.advanceTimersByTime(TRACER_LAP_MS)
+ expect(s.stop).toHaveBeenCalledTimes(1)
+ s.update({ ...idle, hovered: true })
+ vi.advanceTimersByTime(24000)
+ expect(s.play).toHaveBeenCalledTimes(1)
+ s.update(idle)
+ vi.advanceTimersByTime(8000)
+ expect(s.play).toHaveBeenCalledTimes(2)
+ s.dispose()
+})
+
+it('cancels the pending opening on input, including input cleared before the delay ends', () => {
+ for (const flag of ['hasText'] as const) {
const s = setup({ ...idle, focused: true })
vi.advanceTimersByTime(TRACER_DELAY_MS / 2)
s.update({ ...idle, focused: true, [flag]: true })
diff --git a/app/test/askTracerDom.test.ts b/app/test/askTracerDom.test.ts
index 342856fc..01acb540 100644
--- a/app/test/askTracerDom.test.ts
+++ b/app/test/askTracerDom.test.ts
@@ -55,7 +55,7 @@ it('animates explicit dash offsets, follows the composer size, and cancels on na
expect(vi.getTimerCount()).toBe(0)
})
-it('plays the opening under a resting pointer, but movement inside the box cancels it', () => {
+it('plays the opening under a resting or a moving pointer, as after a click', () => {
vi.useFakeTimers()
const nodes: { animate: ReturnType<typeof vi.fn> }[] = []
const field = { value: '' }
@@ -73,9 +73,10 @@ it('plays the opening under a resting pointer, but movement inside the box cance
vi.advanceTimersByTime(TRACER_DELAY_MS)
expect(nodes[0].animate).toHaveBeenCalledOnce()
resting.tracer.dispose()
+ // clicking Ask leaves the pointer moving over the box; the opening lap still plays, like ⌘J
const moving = open()
moving.box.dispatchEvent(new Event('pointermove'))
vi.advanceTimersByTime(TRACER_DELAY_MS)
- expect(nodes[0].animate).not.toHaveBeenCalled()
+ expect(nodes[0].animate).toHaveBeenCalledOnce()
moving.tracer.dispose()
})