diff --git a/docs/annotation-workspace-layout.md b/docs/annotation-workspace-layout.md index 305ed2b3..6f0a0d02 100644 --- a/docs/annotation-workspace-layout.md +++ b/docs/annotation-workspace-layout.md @@ -18,7 +18,9 @@ 任务 05 将两类字典放入固定编辑区:搜索、每页 2 项、前后页和返回入口固定,长词条显示两行预览,悬停或辅助技术可读取完整词条,填入后可继续完整阅读。F / D 打开,方向键选择,Enter 填入,Esc 一次返回工作台;选择描述模板不会保存,可继续修改。长描述在同一个文本框内滚动,“展开描述编辑”暂时收起精确边界区域以增加文字空间,保存和取消始终在文本滚动区外;收起、切片导航与布局切换不保存草稿。原布局仍使用原有字典弹层。 -单相机放大和窗口过小时暂停,由后续任务交付。当前双画面尺寸验证使用五档实际浏览器内容区,不代表已覆盖各种操作系统缩放设置。 +任务 06 在专注视图的视频上方提供“放大左相机”“放大右相机”和“恢复双画面”。单路检查期间只改变呈现:两路视频节点和媒体源都保留,隐藏路继续同步;详细切片/描述时间轴临时收成 Capture 进度条,把高度让给所选画面。切片阶段的当前播放头分割入口、播放与逐帧、当前编辑、保存、撤销/重做及阶段提交仍可达。恢复双画面或切回原布局保留播放帧、草稿、选择和历史;原布局继续使用原来的左右相机显示复选框。 + +真实 590×480 双视频在 1280×640 内容区的实测每路有效画面约 410.5×334,单路约 565.4×460;两种模式在五档内容区均随窗口扩大。16:9 与 9:16 的 12 秒、30fps 本地 testsrc2 文件只用于验证左右不同比例时的 `contain` 适配,不代表客户素材或真实工作流覆盖。窗口过小时暂停仍由后续任务交付;当前浏览器尺寸验证不代表已覆盖各种操作系统缩放设置。 ## 源码恢复与业务数据恢复 @@ -37,3 +39,5 @@ 分页边界拖动验收为 `tests/browser/annotation-workspace-boundaries.mjs`,默认检查切片,传入 `NAVIGATION_PHASE=annotate` 检查描述。它使用真实鼠标手势将页尾边界向两侧移动,并检查同一横坐标不会重复改变边界;描述模式通过现有编辑、确认结束点和保存建立相邻区间,再以公共 API 核对共享精确帧。历史验收还覆盖从另一切片重做已保存描述时,关闭编辑器并显示目标页。 字典与长文本验收为 `tests/browser/annotation-workspace-dictionaries.mjs`,使用 pool-01 与 annotate-primary。隔离项目需配置多页字典,以及“布局长名称验收”长名称与“布局长文本模板”长描述。脚本验证两类字典在五档内容区的固定入口、搜索分页、原布局回退、一次 Esc、原生剪切/撤销、草稿展开/收起/跨片保存及 API 撤销/重做回读。组合事件检查是浏览器派发的快捷键归属检查,不代表操作系统输入法验收;完整 OS 缩放与输入法矩阵仍需人工验证。 + +单路检查与比例适配验收为 `tests/browser/annotation-workspace-camera-inspection.mjs`,使用 annotate-primary 与 pool-01 且不执行保存、生成、送检或领取。脚本以真实 590×480 双视频检查五档双路/单路有效画面、左右放大、播放逐帧、进度条指针、草稿与媒体节点、历史、布局回退和公共 API 版本不变;随后在独立无缓存浏览器上下文中仅把两路 `subject-content` 映射到忽略目录的 16:9 / 9:16 合成文件,验证完整等比显示。合成文件不参与真实帧/API 工作流结论。 diff --git a/src/components/CaptureAnnotationWorkbench.tsx b/src/components/CaptureAnnotationWorkbench.tsx index b18f9a49..167a9255 100644 --- a/src/components/CaptureAnnotationWorkbench.tsx +++ b/src/components/CaptureAnnotationWorkbench.tsx @@ -314,6 +314,7 @@ export function CaptureAnnotationWorkbench({ const [playbackRate, setPlaybackRate] = useState(1); const [showLeft, setShowLeft] = useState(initialCameraVisibility?.left ?? true); const [showRight, setShowRight] = useState(initialCameraVisibility?.right ?? Boolean(rightVideoSource)); + const [inspectionCamera, setInspectionCamera] = useState<"left" | "right" | null>(null); const [selectedBoundary, setSelectedBoundary] = useState(null); const [splitPreview, setSplitPreview] = useState(null); const [editingAnnotation, setEditingAnnotation] = useState(null); @@ -341,6 +342,9 @@ export function CaptureAnnotationWorkbench({ const [showDictionary, setShowDictionary] = useState(false); const [expandedDescription, setExpandedDescription] = useState(false); useEffect(() => setExpandedDescription(false), [editingAnnotation?.id]); + useEffect(() => { + if (!focusedLayout) setInspectionCamera(null); + }, [focusedLayout]); useEffect(() => { if (showDictionary && !focusedLayout) ( @@ -363,6 +367,7 @@ export function CaptureAnnotationWorkbench({ setEndSelection(null); setEditingAnnotation(null); setShowDictionary(false); + setInspectionCamera(null); shortcutHelpRef.current?.close(); setSelectedBoundary(null); setSelectedAnnotationBoundary(null); @@ -1431,7 +1436,7 @@ export function CaptureAnnotationWorkbench({ }; const selectedSliceStatus = selectedSlice ? statuses[selectedSlice.id] || "pending" : "pending"; - const videoClass = showLeft && showRight ? "grid-cols-2" : "grid-cols-1"; + const videoClass = (focusedLayout && inspectionCamera) || !(showLeft && showRight) ? "grid-cols-1" : "grid-cols-2"; useEffect(() => { if (editingAnnotation?.id) { descriptionEditorRef.current?.scrollIntoView({ block: "end", behavior: "instant" }); @@ -1504,6 +1509,7 @@ export function CaptureAnnotationWorkbench({ className="capture-workbench min-w-0 max-w-full rounded-md border border-[color:var(--app-border)] bg-[color:var(--app-panel)] text-[color:var(--app-text)] shadow-[0_8px_28px_rgba(15,23,42,0.06)]" data-testid="capture-annotation-workbench" data-stage={phase} + data-camera-inspection={focusedLayout ? inspectionCamera || undefined : undefined} data-adaptive-slice={adaptiveLayout && phase === "slice" && !mediaOnly && !isQualityReview ? true : undefined} tabIndex={0} onPointerDownCapture={(event) => { @@ -1893,36 +1899,81 @@ export function CaptureAnnotationWorkbench({ data-testid="capture-video-panel" >
- - {rightSource ? ( - - ) : null} + {focusedLayout ? ( +
+ + {rightSource ? ( + + ) : null} + + {inspectionCamera && phase === "slice" && !readOnly && !isQualityReview ? ( + + ) : null} +
+ ) : ( +
+ + {rightSource ? ( + + ) : null} +
+ )}