From fb34bf2ef9fa060824fbeb84187d3d4ba352c548 Mon Sep 17 00:00:00 2001
From: webadderall <131426131+webadderall@users.noreply.github.com>
Date: Mon, 27 Apr 2026 16:04:04 +1000
Subject: [PATCH] Address CodeRabbit review feedback
---
src/components/launch/LaunchWindow.tsx | 9 ++++++++-
src/components/video-editor/SettingsPanel.tsx | 1 +
src/components/video-editor/VideoPlayback.tsx | 10 ++++++----
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsx
index 3863751e..4344b7c5 100644
--- a/src/components/launch/LaunchWindow.tsx
+++ b/src/components/launch/LaunchWindow.tsx
@@ -1477,8 +1477,15 @@ export function LaunchWindow() {
}
onClick={() => {
- void window.electronAPI.previewUpdateToast();
setActiveDropdown("none");
+ void window.electronAPI
+ .previewUpdateToast()
+ .catch((error) => {
+ console.warn(
+ "Failed to preview update toast:",
+ error,
+ );
+ });
}}
>
{t("recording.previewUpdateUi", "Preview Update UI")}
diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index e7fe287d..51b1a0c7 100644
--- a/src/components/video-editor/SettingsPanel.tsx
+++ b/src/components/video-editor/SettingsPanel.tsx
@@ -157,6 +157,7 @@ function WallpaperVideoPreview({ src }: { src: string }) {
useEffect(() => {
let cancelled = false;
+ setResolvedSrc(src);
void (async () => {
try {
diff --git a/src/components/video-editor/VideoPlayback.tsx b/src/components/video-editor/VideoPlayback.tsx
index 6bcb7549..c6c50f0b 100644
--- a/src/components/video-editor/VideoPlayback.tsx
+++ b/src/components/video-editor/VideoPlayback.tsx
@@ -1012,11 +1012,12 @@ const VideoPlayback = forwardRef(
const bgVideo = bgVideoRef.current;
if (!bgVideo) return;
+ const clipTimelineTime = currentTime;
const videoDuration =
Number.isFinite(bgVideo.duration) && bgVideo.duration > 0 ? bgVideo.duration : null;
const targetTime = videoDuration
- ? currentTime % videoDuration
- : clampMediaTimeToDuration(currentTime, videoDuration);
+ ? clipTimelineTime % videoDuration
+ : clampMediaTimeToDuration(clipTimelineTime, videoDuration);
const activeSpeedRegion = speedRegionsRef.current.find(
(region) => currentTime * 1000 >= region.startMs && currentTime * 1000 < region.endMs,
@@ -1036,7 +1037,8 @@ const VideoPlayback = forwardRef(
const previousTimelineTime = lastBackgroundSyncTimeRef.current;
const timelineJumped =
- previousTimelineTime === null || Math.abs(targetTime - previousTimelineTime) > 0.25;
+ previousTimelineTime === null ||
+ Math.abs(clipTimelineTime - previousTimelineTime) > 0.25;
const driftThreshold = isPlaying ? 0.35 : 0.01;
if (timelineJumped || Math.abs(bgVideo.currentTime - targetTime) > driftThreshold) {
try {
@@ -1055,7 +1057,7 @@ const VideoPlayback = forwardRef(
bgVideo.pause();
}
- lastBackgroundSyncTimeRef.current = targetTime;
+ lastBackgroundSyncTimeRef.current = clipTimelineTime;
}, [currentTime, isPlaying]);
useEffect(() => {