Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: use ResizeObserver for URL overlay positioning in timeline

Louis Beaumontc6288606946a
diff --git a/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
index 6637badfe..620106dec 100644
--- a/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
@@ -373,8 +373,11 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
}
};
updateDimensions();
- window.addEventListener("resize", updateDimensions);
- return () => window.removeEventListener("resize", updateDimensions);
+ const el = containerRef.current;
+ if (!el) return;
+ const observer = new ResizeObserver(updateDimensions);
+ observer.observe(el);
+ return () => observer.disconnect();
}, [naturalDimensions]);
// Auto-skip on error