refactor(webui): extract shared Video/Image control bars and reuse in compare

Extract the video player's inline ControlBar into an exported
viewers/video-control-bar.tsx (VideoControlBar + PlayerState +
DisplayTranscode) and the image toolbar from file-viewer into an exported
viewers/image-control-bar.tsx (ImageControlBar). video-player and
file-viewer now consume the shared components with unchanged behavior.

compare-control-bar composes the same two shared bars (video vs image
active) with fan-out handlers, so the compare control bar can no longer
drift from the single-file players (e.g. the time-format dropdown).
This commit is contained in:
yiling
2026-07-04 10:49:00 +08:00
parent 6c3d3ea2b3
commit e2d4944060
6 changed files with 543 additions and 654 deletions
@@ -334,9 +334,8 @@ export function CompareViewer({
<CompareControlBar
activeState={activeState}
activeAsset={activeAsset ?? null}
previewUrl={activePreviewUrl}
metadata={activeAsset?.media?.metadata}
startTimecode={activeAsset?.media?.metadata?.startTimecode}
isFullScreen={isFullScreen}
onTogglePlay={handleTogglePlay}
onToggleLoop={handleToggleLoop}