diff --git a/src/components/player/atoms/ProgressBar.tsx b/src/components/player/atoms/ProgressBar.tsx index 685ef603..90b91dcc 100644 --- a/src/components/player/atoms/ProgressBar.tsx +++ b/src/components/player/atoms/ProgressBar.tsx @@ -37,6 +37,14 @@ function ThumbnailDisplay(props: { at: number; show: boolean }) { }); }, [props.at]); + // Keep time label width consistent and avoid recomputing + const formattedTime = useMemo( + () => formatSeconds(Math.max(props.at, 0), durationExceedsHour(props.at)), + [props.at], + ); + const transformX = + offsets.offscreenLeft > 0 ? offsets.offscreenLeft : -offsets.offscreenRight; + if (!props.show) return null; return ( @@ -45,11 +53,7 @@ function ThumbnailDisplay(props: { at: number; show: boolean }) {
- {formatSeconds( - Math.max(props.at, 0), - durationExceedsHour(props.at), - )} +
+ {formattedTime}