From a8fcb3559231d413a48bb98b38fe7f9bf84cf8ce Mon Sep 17 00:00:00 2001 From: Serhii Vecherenko Date: Mon, 27 Jul 2026 23:17:44 -0700 Subject: [PATCH] fix(renderer): bind analytics timers and preserve select padding --- src/renderer/analytics/posthog.ts | 6 ++++-- src/renderer/analytics/useProductViewTracking.ts | 12 ++++++++---- src/renderer/components/common/Select.tsx | 7 ++++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/renderer/analytics/posthog.ts b/src/renderer/analytics/posthog.ts index e8b71f5ba..4b684d0a7 100644 --- a/src/renderer/analytics/posthog.ts +++ b/src/renderer/analytics/posthog.ts @@ -100,9 +100,11 @@ function installStoreSubscriptions(): () => void { const disposers: Array<() => void> = []; const appViewTracker = createProductViewTracker({ capture: captureProductEvent, - clearTimeout, + // Wrap window's timer methods — called detached from `window` they throw + // "Illegal invocation" in the browser (Node's timers don't, so tests miss it). + clearTimeout: (timer) => clearTimeout(timer), now: Date.now, - setTimeout, + setTimeout: (callback, delayMs) => setTimeout(callback, delayMs), }); const syncAppView = () => { appViewTracker.setView(appViewDefinition(useAppStore.getState().view)); diff --git a/src/renderer/analytics/useProductViewTracking.ts b/src/renderer/analytics/useProductViewTracking.ts index acde0f662..a5f9da6f3 100644 --- a/src/renderer/analytics/useProductViewTracking.ts +++ b/src/renderer/analytics/useProductViewTracking.ts @@ -94,9 +94,11 @@ export function useProductViewTracking( if (!trackerRef.current) { trackerRef.current = createProductViewTracker({ capture: captureProductEvent, - clearTimeout, + // Wrap window's timer methods — called detached from `window` they throw + // "Illegal invocation" in the browser (Node's timers don't, so tests miss it). + clearTimeout: (timer) => clearTimeout(timer), now: Date.now, - setTimeout, + setTimeout: (callback, delayMs) => setTimeout(callback, delayMs), }); } @@ -132,9 +134,11 @@ export function useStandaloneWindowViewTracking(surface: string, active = true): if (!trackerRef.current) { trackerRef.current = createProductViewTracker({ capture: captureProductEvent, - clearTimeout, + // Wrap window's timer methods — called detached from `window` they throw + // "Illegal invocation" in the browser (Node's timers don't, so tests miss it). + clearTimeout: (timer) => clearTimeout(timer), now: Date.now, - setTimeout, + setTimeout: (callback, delayMs) => setTimeout(callback, delayMs), }); } diff --git a/src/renderer/components/common/Select.tsx b/src/renderer/components/common/Select.tsx index 83403a6c2..08f3e828a 100644 --- a/src/renderer/components/common/Select.tsx +++ b/src/renderer/components/common/Select.tsx @@ -98,7 +98,12 @@ export function Select(props: SelectProps) { const listBox = ( {options.map((option) => ( - + // HeroUI's select popover sets `px-2.5` on items with the same + // specificity as the base `:has(.list-box-item__indicator) { pe-7 }` + // rule but later in import order, collapsing the end padding that + // reserves room for the checkmark so it overlaps long labels. The + // `pe-7` utility (utilities layer) restores it. + {option.label}