feat(webui): compare fullscreen control bar follows app theme

Add a themedChrome prop to VideoControlBar that keeps the normal
theme-aware chrome (bg-card / foreground text) while fullscreen instead
of the dark video overlay. Compare mode passes it so its fullscreen bar
matches the app light/dark theme for both video- and image-active panes
(ImageControlBar is already themed). The single-file player is unchanged
(themedChrome defaults to false -> dark overlay). The fullscreen toggle
icon still reflects the actual fullscreen state.
This commit is contained in:
yiling
2026-07-04 12:28:08 +08:00
parent cf005797be
commit aeaff3bc88
2 changed files with 16 additions and 4 deletions
@@ -76,6 +76,7 @@ export function CompareControlBar({
state={state}
zoom={activeState.zoom}
isControlsVisible
themedChrome
buffered={v.buffered}
data={data}
resolutions={v.resolutions as DisplayTranscode[]}
@@ -67,6 +67,12 @@ export interface ControlBarProps {
totalFrames: number
currentFrame: number
seekToFrame: (frame: number) => Promise<void> | void
/**
* When true, keep the normal theme-aware chrome (bg-card / foreground text)
* even while fullscreen, instead of the dark video overlay style. Used by
* compare mode so its fullscreen bar follows the app light/dark theme.
*/
themedChrome?: boolean
}
export const VideoControlBar: React.FC<ControlBarProps> = ({
@@ -90,6 +96,7 @@ export const VideoControlBar: React.FC<ControlBarProps> = ({
totalFrames,
currentFrame,
seekToFrame,
themedChrome = false,
}) => {
const { videoTimeDisplayMode, setVideoTimeDisplayMode } = useUiStore()
@@ -97,6 +104,10 @@ export const VideoControlBar: React.FC<ControlBarProps> = ({
return null
}
// Whether to render the dark video overlay chrome. Compare mode opts out
// (themedChrome) so its fullscreen bar follows the app light/dark theme.
const overlay = state.isFullScreen && !themedChrome
const previewResolutions = resolutions.filter((r) => !r.isRaw)
const startTimecode = data.media?.metadata?.startTimecode
@@ -112,7 +123,7 @@ export const VideoControlBar: React.FC<ControlBarProps> = ({
<div
className={cn(
'transition-all duration-300 ease-in-out z-20',
state.isFullScreen
overlay
? 'absolute bottom-0 left-0 right-0 px-4 py-4 bg-black/60 backdrop-blur-md text-white'
: 'relative w-full bg-card border-t border-border px-4 py-3 z-10 transition-colors duration-200',
isControlsVisible
@@ -140,7 +151,7 @@ export const VideoControlBar: React.FC<ControlBarProps> = ({
<div
className={cn(
'flex items-center justify-between',
state.isFullScreen ? 'text-white/90' : 'text-foreground',
overlay ? 'text-white/90' : 'text-foreground',
)}
>
{/* Left Side: Play, Vol, Time */}
@@ -244,7 +255,7 @@ export const VideoControlBar: React.FC<ControlBarProps> = ({
<div
className={cn(
'flex items-center gap-1 rounded-md p-0.5',
state.isFullScreen ? 'bg-white/15' : 'bg-muted',
overlay ? 'bg-white/15' : 'bg-muted',
)}
>
<button
@@ -267,7 +278,7 @@ export const VideoControlBar: React.FC<ControlBarProps> = ({
onClick={onZoomReset}
className={cn(
'text-xs font-medium px-2 py-1 rounded hover:text-primary transition-colors',
state.isFullScreen ? 'bg-white/15' : 'bg-muted',
overlay ? 'bg-white/15' : 'bg-muted',
)}
>
Fit