From ba88cdad78bceff9e6b5e1e7e4fab7f97c7e7c37 Mon Sep 17 00:00:00 2001 From: yiling Date: Sat, 4 Jul 2026 15:29:07 +0800 Subject: [PATCH] fix(webui): sync compare video pane resolution/source on asset change currentResolution state and currentSrcRef were only initialized on mount, so if file.id changed without a remount the video.js init effect (keyed on file.id) would re-create the player with a stale source. Add an effect that resets them when file.id changes, before the init effect runs, making the pane robust even without a per-asset key on the parent. --- packages/webui/components/compare/compare-video-pane.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/webui/components/compare/compare-video-pane.tsx b/packages/webui/components/compare/compare-video-pane.tsx index 0019f43d..1a4d9bfd 100644 --- a/packages/webui/components/compare/compare-video-pane.tsx +++ b/packages/webui/components/compare/compare-video-pane.tsx @@ -153,6 +153,15 @@ export const CompareVideoPane = forwardRef { + setCurrentResolution(initialRes?.resolution ?? 'Original') + currentSrcRef.current = initialRes?.url + }, [file.id]) + // Initialize video.js useEffect(() => { if (!videoContainerRef.current) return