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.

recorder pill: 12px inside the border at both ends again

christianmat181cb0568cb6
diff --git a/app/e2e/widget.spec.ts b/app/e2e/widget.spec.ts
index 1c767839..2bbe142c 100644
--- a/app/e2e/widget.spec.ts
+++ b/app/e2e/widget.spec.ts
@@ -308,8 +308,8 @@ test('hover stays stationary and pointer-down movement drags immediately without
const w = await record(app, page)
const widget = w.getByTestId('widget')
// the pill hugs its content: the same space at both ends
- const ends = await widget.evaluate(el => { const r = el.getBoundingClientRect(), a = el.querySelector('.widget-details > :first-child')!.getBoundingClientRect(), z = el.querySelector('[data-testid=widget-time]')!.getBoundingClientRect(); return [Math.round(a.left - r.left), Math.round(r.right - z.right)] })
- expect(ends[0]).toBe(ends[1])
+ // measured once it settles: the pill resizes to its timer and animates there; 13 is 12 inside the 1px border
+ await expect.poll(() => widget.evaluate(el => { const r = el.getBoundingClientRect(), a = el.querySelector('.widget-details > :first-child')!.getBoundingClientRect(), z = el.querySelector('[data-testid=widget-time]')!.getBoundingClientRect(); return [Math.round(a.left - r.left), Math.round(r.right - z.right)] })).toEqual([13, 13])
const before = (await snap(app)).bounds!
const box = (await w.getByTestId('widget').boundingBox())!
const presented = (await fake<{ presented: number }>(app, 'main')).presented
diff --git a/app/src/main/widget.ts b/app/src/main/widget.ts
index 8d1c0bd4..e00b0e6a 100644
--- a/app/src/main/widget.ts
+++ b/app/src/main/widget.ts
@@ -245,7 +245,8 @@ export function createWidget(d: { open(meetingId: string): void; stop(meetingId:
})
ipcMain.on('widget:size', (e, w: unknown, h: unknown) => {
if (!win || win.isDestroyed() || e.sender !== win.webContents || typeof w !== 'number' || !Number.isFinite(w) || w < 60 || w > 340 || h !== FIRST_H || pressed) return
- const width = Math.ceil(w)
+ // rounded, not up: the timer is a fractional width, and rounding up left the right end a pixel wider than the left
+ const width = Math.round(w)
if (width === pill.width) return
lastWidth = width
pill = fit({ ...pill, x: pill.x + pill.width - width, width })
diff --git a/app/src/renderer/src/windows/widgetMorph.ts b/app/src/renderer/src/windows/widgetMorph.ts
index 9130e3ba..cac26471 100644
--- a/app/src/renderer/src/windows/widgetMorph.ts
+++ b/app/src/renderer/src/windows/widgetMorph.ts
@@ -78,7 +78,7 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
useLayoutEffect(() => {
if (intent.pressed) return
const timer = card.current?.querySelector<HTMLElement>('[data-testid="widget-time"]')
- if (timer) window.yogurt.widget.size(93 + timer.getBoundingClientRect().width, 42)
+ if (timer) window.yogurt.widget.size(95 + timer.getBoundingClientRect().width, 42)
}, [time, open, layout?.pill.width])
useEffect(() => {
let frame = 0, lastPoint = { x: -1, y: -1 }, lastSurface = ''
@@ -125,7 +125,7 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
wake.current()
window.yogurt.widget.pressed(false)
const timer = card.current?.querySelector<HTMLElement>('[data-testid="widget-time"]')
- if (timer) window.yogurt.widget.size(93 + timer.getBoundingClientRect().width, 42)
+ if (timer) window.yogurt.widget.size(95 + timer.getBoundingClientRect().width, 42)
},
}
}