From dc7c4b9beeaa1027013b229c3b1485e24879d239 Mon Sep 17 00:00:00 2001 From: d-robotics Date: Wed, 18 Nov 2026 16:58:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20Align=20final=20acceptance?= =?UTF-8?q?=20timeline=20rows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CaptureAnnotationWorkbench.tsx | 77 ++++++++------- src/components/FinalAcceptanceWorkspace.tsx | 98 ++++++++++++------- src/lib/acceptance-workspace.js | 21 ++-- src/styles/capture-workspace.css | 24 +++-- src/styles/review-workspace.css | 19 ++-- tests/browser/acceptance-playback-rate.mjs | 24 +++++ 6 files changed, 164 insertions(+), 99 deletions(-) diff --git a/src/components/CaptureAnnotationWorkbench.tsx b/src/components/CaptureAnnotationWorkbench.tsx index 9572972f..43d39c41 100644 --- a/src/components/CaptureAnnotationWorkbench.tsx +++ b/src/components/CaptureAnnotationWorkbench.tsx @@ -1,4 +1,5 @@ import type { ReactNode } from "react"; +import { createPortal } from "react-dom"; import { ReviewActionList } from "./ReviewActionList"; import { ReviewSliceNavigator } from "./ReviewSliceNavigator"; import type { AnnotationTimelineFailure } from "../lib/annotation-source-validation"; @@ -194,6 +195,7 @@ type Props = ReviewViewingProps & { * offset + currentTime over duration — and seeks through the host's slice * navigation instead of only the current clip. */ + mediaTimelineHost?: HTMLDivElement | null; totalProgress?: { offset: number; duration: number; onSeekTotal?: (time: number) => void }; frameBoundaries?: number[]; frameTimelineStatus?: "loading" | "ready" | "error"; @@ -394,6 +396,7 @@ export function CaptureAnnotationWorkbench({ adaptiveLayout = false, focusedLayout = false, viewportSuspended = false, + mediaTimelineHost, totalProgress, frameBoundaries = [], frameTimelineStatus = "ready", @@ -3206,7 +3209,7 @@ export function CaptureAnnotationWorkbench({ setOpinionMarkerOpen(opinionMarkerOpen === cluster.key ? null : cluster.key); else reviewController.seekTime(cluster.opinions[0].atSeconds); }} - className="-translate-x-1/2 rounded-full border border-orange-500 bg-orange-400 px-1 text-[9px] font-bold leading-3 text-white shadow" + className="block -translate-x-1/2 rounded-full border border-orange-500 bg-orange-400 px-1 text-[9px] font-bold leading-3 text-white shadow" > {cluster.opinions.length > 1 ? cluster.opinions.length : "•"} @@ -3234,6 +3237,43 @@ export function CaptureAnnotationWorkbench({ ); + const playbackTimeline = ( + <> + {mediaOnly && isReviewViewing && !!reviewTimestampOpinions?.length && ( +
event.stopPropagation()}> + {renderTimestampOpinionMarkers( + totalProgress ? 0 : clipStart, + totalProgress?.duration ?? clipEnd, + totalProgress?.offset ?? 0, + )} +
+ )} + ) => + totalProgress.onSeekTotal?.(Number(event.currentTarget.value)), + } + : {})} + style={ + { + "--played": totalProgress + ? timelinePosition(totalProgress.offset + currentTime, 0, totalProgress.duration) + : timelinePosition(currentTime, clipStart, clipEnd), + } as CSSProperties + } + className={cn("annotation-time-range w-full accent-orange-500", !mediaOnly && "mb-2")} + /> + + ); + return (
+ {mediaTimelineHost && createPortal(playbackTimeline, mediaTimelineHost)}