Merge pull request '💄 标注、质检、验收工作台视觉润色(不改交互)' (#62) from claude/workbench-ui-polish into dev

This commit is contained in:
zhanghongming 2026-10-28 00:16:24 +08:00
commit f7ca3d90dc
11 changed files with 316 additions and 83 deletions

View File

@ -0,0 +1,9 @@
# Polish annotation, review, acceptance and rework workbench UI
Goal: make the annotator / QC / final-acceptance workbenches (normal and focus layouts, rework and re-review states) tidier and smoother without changing any function; interaction changes need the user's approval first
Agent: Claude Code (desktop session, 2026-10-27)
Base: codex/frontend-polish-20261026 @ de96cfc2 (unmerged; it carries the production line review-runtime-trace, whose annotation workbench differs from origin/dev by ~1300 lines). Confirmed by the user on 2026-10-27.
Scope: src/index.css, src/styles/{capture-workspace,review-workspace,review-captions}.css, display-only class names in src/pages/AnnotationOperations.tsx and src/components/* used by the four workbenches
Approved interaction changes (2026-10-27 compare sheet): the task-scoped 当前任务连接诊断 link joins each layout's top row; a read-only quality review shows its own footer and takeover hint instead of the annotator slice bar. Declined: moving the QC opinion panel below the video; adding an action list to review focus.
Out of scope: other interaction changes (entry points, shortcuts, panel positions, confirmations, auto-claim/continuation behaviour), API, data, other pages
Risk: display plus one footer-routing fix; no API, data or shortcut changes

View File

@ -67,7 +67,7 @@ Shift + Delete(Mac:Shift + Backspace)删除列表中选中的本轮问题
刷新、直接打开地址、只读预览不会自动开启;普通与专注布局切换不算重新进入。显式暂停、提交异常、窗口过小或被接管后保持暂停,条件恢复后需要手动继续;自动进入的下一条沿用原连续会话。
同一账号在两个页面打开同一任务时,只能一个页面编辑。另一个页面可查看,并可明确接管;接管后原页面停止写入,已保存草稿保留。这项能力适用于公司普通 HTTP 入口。
同一账号在两个页面打开同一任务时,只能一个页面编辑。另一个页面可查看,并可明确接管;接管后原页面停止写入,已保存草稿保留。只读页面的底栏显示「质检审核模式(只读查看)」和「本页只读,点上方「在本页接管审查」后可审核」,不显示通过/退回按钮,也不显示标注员的切片确认条。这项能力适用于公司普通 HTTP 入口。
## 供应商共享验收池(2026-09-29)

View File

@ -2,6 +2,7 @@ import { ReviewListTrace } from "./ReviewTrace";
import type { HumanItem } from "../types";
import { ReviewHistorySummary } from "./ReviewHistorySummary";
import { cn } from "../lib/utils";
import { CaptureName } from "./CaptureName";
import { acceptanceTaskAction } from "../lib/acceptance-workspace.js";
export function AcceptanceTaskCard({
@ -41,27 +42,27 @@ export function AcceptanceTaskCard({
data-testid="acceptance-task-card"
data-item-id={item.id}
className={cn(
"w-full overflow-hidden rounded-lg border",
"w-full overflow-hidden rounded-lg border transition-colors",
selected
? "border-orange-400 bg-orange-50/50 dark:bg-orange-500/10"
: "border-[color:var(--app-border)] bg-[color:var(--app-panel)]",
: "border-[color:var(--app-border)] bg-[color:var(--app-panel)] hover:border-orange-400/50",
)}
>
<button type="button" onClick={onPreview} className="w-full px-3 py-2.5 text-left" aria-label={`预览 ${name}`}>
<div className="flex items-start justify-between gap-2">
<span title={name} className="min-w-0 truncate text-xs font-semibold">
{name}
<div title={name} className="text-xs font-semibold leading-snug [overflow-wrap:anywhere]">
<CaptureName name={name} />
</div>
<div className="mt-1.5 flex items-center justify-between gap-2">
<span className="min-w-0 truncate text-[11px] tabular-nums text-slate-500">
{seconds > 0 ? `${seconds.toFixed(2)}s` : "Capture 验收任务"}
</span>
<span className="shrink-0 rounded-full border border-blue-300 bg-blue-50 px-2 py-0.5 text-[9px] text-blue-700">
<span className="shrink-0 rounded-full border border-blue-300 bg-blue-50 px-2 py-0.5 text-[11px] font-medium text-blue-700 dark:border-blue-500/40 dark:bg-blue-500/15 dark:text-blue-200">
{completed ? "已完成" : item.status === "rejected" ? "已打回" : reworkReview ? "返工复审" : "待验收"}
</span>
</div>
<div className="mt-1 text-[10px] text-slate-500">
{seconds > 0 ? `${seconds.toFixed(2)}s` : "Capture 验收任务"}
</div>
<ReviewListTrace summary={item.traceSummary} />
{item.reviewHistory && <ReviewHistorySummary history={item.reviewHistory} />}
<div className="mt-2 truncate text-[10px] text-slate-500">
<div className="mt-2 truncate text-[11px] text-slate-500">
{item.status === "rejected"
? "已退回质检"
: completed

View File

@ -201,6 +201,8 @@ type Props = ReviewViewingProps & {
*/
captionsViewable?: boolean;
reviewWriteLocked?: boolean;
/** Footer hint shown while a review is read-only, e.g. why and how to regain the decision buttons. */
reviewReadOnlyNotice?: string;
reviewApprovalBlocked?: boolean;
reviewMode?: "quality" | "acceptance";
reviewCaption?: ReviewCaption;
@ -385,6 +387,7 @@ export function CaptureAnnotationWorkbench({
isQualityReview = false,
captionsViewable = false,
reviewWriteLocked = false,
reviewReadOnlyNotice = "",
reviewApprovalBlocked = false,
reviewMode = "quality",
reviewCaption: providedReviewCaption,
@ -5314,7 +5317,12 @@ export function CaptureAnnotationWorkbench({
)}
{continuousActions && (
<>
<button type="button" onClick={saveProgress} disabled={saving || !onSaveProgress}>
<button
type="button"
onClick={saveProgress}
disabled={saving || !onSaveProgress}
className="rounded border px-3 py-2 text-sm disabled:opacity-50"
>
保存进度
</button>
</>
@ -6446,7 +6454,9 @@ export function CaptureAnnotationWorkbench({
)}
</div>
</>
) : phase === "slice" ? (
) : phase === "slice" && !isQualityReview ? (
// A read-only review falls through to the read-only footer below, never
// the annotator's slice-confirmation bar.
<>
<span className="mr-auto text-xs text-amber-700">
{claimLocked
@ -6500,7 +6510,16 @@ export function CaptureAnnotationWorkbench({
{operationNotice}
</p>
)}
<span className="mr-auto text-xs text-slate-500">{segments.length} 个描述已确认</span>
<span className="mr-auto text-xs text-slate-500">
{isQualityReview
? `${slices.length} 个切片 · ${segments.length} 个动作`
: `${segments.length} 个描述已确认`}
</span>
{isQualityReview && reviewReadOnlyNotice ? (
<span role="status" className="text-xs text-amber-700 dark:text-amber-300">
{reviewReadOnlyNotice}
</span>
) : null}
<span className="rounded bg-slate-200/80 px-3 py-1.5 text-xs font-medium text-slate-700 dark:bg-slate-800 dark:text-slate-300">
{isQualityReview ? "质检审核模式(只读查看)" : `${readOnlyStatusLabel}(只读查看)`}
</span>

View File

@ -0,0 +1,6 @@
// Capture names are long underscore-joined tokens. Offer a line break after each
// underscore instead of mid-word; <wbr> adds no characters to copied text.
export function CaptureName({ name }: { name: string }) {
const parts = name.split("_");
return <>{parts.flatMap((part, index) => (index < parts.length - 1 ? [`${part}_`, <wbr key={index} />] : [part]))}</>;
}

View File

@ -83,6 +83,24 @@ html:not(.dark) .annotation-operations-page {
color: #0f172a;
}
/* Tailwind v4 draws a bare `border` in currentColor, which is near-black on the
workbenches. Give colourless borders the panel tone (controls one step darker);
any border-* utility still wins because utilities sit in a later layer. */
html {
--app-control-border: #cbd5e1;
}
html.dark {
--app-control-border: #3f4249;
}
@layer base {
.annotation-operations-page :where(*, ::before, ::after) {
border-color: var(--app-border);
}
.annotation-operations-page :where(button, select, input, textarea, a, summary) {
border-color: var(--app-control-border);
}
}
.capture-media-controls {
position: relative;
z-index: 10;

View File

@ -72,6 +72,7 @@ import { checkSliceEditResolution, planSliceEditDragRelease } from "../lib/slice
import { annotationTaskAction } from "../lib/annotation-task-action.js";
import { FinalAcceptanceWorkspace } from "../components/FinalAcceptanceWorkspace";
import { AcceptanceTaskCard } from "../components/AcceptanceTaskCard";
import { CaptureName } from "../components/CaptureName";
import { loadMoviPlayer } from "../lib/movi-player";
import { Link, useBlocker, useLocation, useNavigate, useParams, useSearchParams } from "react-router-dom";
import {
@ -483,7 +484,9 @@ function PoseEvidencePreview({
{frameCount} 帧 · {String(artifact?.name || artifactId)}
</div>
</div>
<span className="rounded-full border border-blue-500/30 px-2 py-1 text-[10px] text-blue-200">人工质检证据</span>
<span className="rounded-full border border-blue-500/30 px-2 py-1 text-[11px] text-blue-700 dark:text-blue-200">
人工质检证据
</span>
</div>
<LazyVideoPreview
src={buildBrowserPlayableVideoURL(evidenceURL)}
@ -6061,6 +6064,17 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
);
const showViewportPrompt = viewportPaused && pendingTaskId === null && leaveBlocker.state !== "blocked";
// Rendered once, at the end of whichever top row the current layout shows.
const taskDiagnosticsLink = (
<a
className="annotation-task-diagnostics shrink-0 text-xs text-slate-500 hover:text-blue-600 dark:text-gray-400 dark:hover:text-blue-300"
target="_blank"
rel="noopener noreferrer"
href={`/diagnostics?${new URLSearchParams({ itemId: reviewSessionItem?.id || detail?.humanItem?.id || selectedHumanItem?.id || "", taskId: detail?.task?.id || selectedTaskId || "" })}`}
>
当前任务连接诊断
</a>
);
const workspaceContent = (
<div
@ -6074,16 +6088,6 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
data-workspace-stage={combinedEditorPhase}
data-workspace-compact={focusedStageLayout || undefined}
>
<div className="flex justify-end text-xs">
<a
className="text-slate-500 hover:text-blue-600"
target="_blank"
rel="noopener noreferrer"
href={`/diagnostics?${new URLSearchParams({ itemId: reviewSessionItem?.id || detail?.humanItem?.id || selectedHumanItem?.id || "", taskId: detail?.task?.id || selectedTaskId || "" })}`}
>
当前任务连接诊断
</a>
</div>
{reviewFocused && (
<div className="review-focus-heading">
<h1>{workspaceMode === "acceptance" ? "最终验收" : "质检审查"}</h1>
@ -6135,6 +6139,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
>
返回任务池
</button>
{taskDiagnosticsLink}
</div>
)}
{draftGuardNotice && (
@ -6209,10 +6214,10 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
cancelLeave();
}
}}
className="w-full max-w-md rounded-2xl border border-[#303137] bg-[#151619] p-5 shadow-2xl"
className="w-full max-w-md rounded-2xl border border-[color:var(--app-border)] bg-[color:var(--app-panel)] p-5 shadow-2xl"
>
<div className="text-base font-semibold text-white">当前任务有未确认修改</div>
<div className="mt-2 text-sm leading-6 text-gray-400">
<div className="text-base font-semibold text-[color:var(--app-text)]">当前任务有未确认修改</div>
<div className="mt-2 text-sm leading-6 text-slate-500 dark:text-gray-400">
离开将清空本次未确认的切片调整和各片未保存的描述草稿。
</div>
<div className="mt-5 flex justify-end gap-2">
@ -6220,14 +6225,14 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
type="button"
onClick={cancelLeave}
autoFocus
className="rounded-lg border border-[#34363b] px-4 py-2 text-sm text-gray-200"
className="rounded-lg border border-[color:var(--app-control-border)] px-4 py-2 text-sm text-slate-700 transition-colors hover:bg-slate-50 dark:text-gray-200 dark:hover:bg-white/5"
>
继续编辑
</button>
<button
type="button"
onClick={discardChangesAndSelectTask}
className="rounded-lg border border-red-500/40 bg-red-500/10 px-4 py-2 text-sm text-red-200"
className="rounded-lg border border-red-500/40 bg-red-500/10 px-4 py-2 text-sm text-red-700 transition-colors hover:bg-red-500/15 dark:text-red-200"
>
清空并切换
</button>
@ -6355,7 +6360,8 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
工作模式由个人任务池旁的开关控制
</p>
</div>
<div className="flex items-center gap-2">
<div className="flex items-center gap-3">
{!reviewFocused && taskDiagnosticsLink}
<Link
onClick={() => workSession.pauseContinuous("已返回任务池,连续工作暂停。")}
to={workPoolPath}
@ -6368,11 +6374,30 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
) : (
<>
<h1 className="sr-only">{workspaceTitle}</h1>
<PageSubnav compact items={annotationStageTabs} label="标注中心阶段导航" />
<div className="flex items-end">
<div className="min-w-0 flex-1">
<PageSubnav compact items={annotationStageTabs} label="标注中心阶段导航" />
</div>
{!reviewFocused && (
<div className="flex min-h-8 shrink-0 items-start border-b border-slate-200 pl-3 dark:border-[#2a2b2f]">
{taskDiagnosticsLink}
</div>
)}
</div>
</>
)}
{!workPage || !selectedTaskId ? (
<div className="annotation-workspace-filters grid items-end gap-2 md:grid-cols-2 xl:grid-cols-[minmax(170px,0.7fr)_auto_minmax(0,1fr)_minmax(0,1fr)_minmax(0,1.25fr)_auto]">
<div
className={cn(
"annotation-workspace-filters grid items-end gap-2",
// One track per rendered control, so the refresh icon never inherits a 1fr track.
isManager
? "md:grid-cols-2 xl:grid-cols-[minmax(170px,0.7fr)_auto_minmax(0,1fr)_minmax(0,1fr)_minmax(0,1.25fr)_auto]"
: blindAnnotator
? "md:grid-cols-[minmax(0,1fr)_auto_auto]"
: "md:grid-cols-2 xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1.25fr)_auto]",
)}
>
{isManager ? (
<select
className={inputClass}
@ -6389,12 +6414,12 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
{isManager ? (
<Link
to={`/sampling${projectId ? `?projectId=${encodeURIComponent(projectId)}` : ""}`}
className="rounded-lg border border-[#2a2b2f] px-3 py-2 text-sm text-gray-300 hover:border-blue-500/50 hover:text-white"
className="rounded-lg border px-3 py-2 text-sm text-slate-600 transition-colors hover:border-blue-500/60 hover:text-blue-600 dark:text-gray-300 dark:hover:text-white"
>
主动抽检
</Link>
) : null}
<label className="min-w-0 space-y-1 text-[10px] text-gray-500">
<label className="min-w-0 space-y-1 text-[11px] text-gray-500">
<span>1. 项目</span>
<select
className={inputClass}
@ -6413,7 +6438,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
</select>
</label>
{!blindAnnotator && (
<label className="min-w-0 space-y-1 text-[10px] text-gray-500">
<label className="min-w-0 space-y-1 text-[11px] text-gray-500">
<span>2. 工作流</span>
<select
className={inputClass}
@ -6433,7 +6458,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
</label>
)}
{!blindAnnotator && (
<label className="min-w-0 space-y-1 text-[10px] text-gray-500">
<label className="min-w-0 space-y-1 text-[11px] text-gray-500">
<span>3. Capture 子目录</span>
<select
className={inputClass}
@ -6481,7 +6506,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
<button
type="button"
onClick={() => setProjectLoadRetryVersion((v) => v + 1)}
className="rounded-lg border border-[#2a2b2f] p-2 text-gray-300 hover:border-blue-500/50 hover:text-white"
className="inline-flex h-[38px] w-[38px] items-center justify-center justify-self-start rounded-lg border bg-[color:var(--app-panel)] text-slate-500 transition-colors hover:border-blue-500/60 hover:text-blue-600 dark:text-gray-300 dark:hover:text-white"
title="刷新"
>
{loading ? <Loader2 className="h-4 w-4 animate-spin" /> : <RefreshCw className="h-4 w-4" />}
@ -7028,7 +7053,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
key={task.id}
data-task-id={task.id}
data-capture-directory={captureLabel}
className={`w-full rounded-lg border ${selectedTaskId === task.id ? "border-orange-400 bg-orange-50/50 dark:bg-orange-500/10" : "border-[color:var(--app-border)] bg-[color:var(--app-panel)] hover:border-orange-400/50"}`}
className={`w-full rounded-lg border transition-colors ${selectedTaskId === task.id ? "border-orange-400 bg-orange-50/50 dark:bg-orange-500/10" : "border-[color:var(--app-border)] bg-[color:var(--app-panel)] hover:border-orange-400/50"}`}
>
<button
type="button"
@ -7036,92 +7061,91 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
data-testid="annotation-task-card"
className="w-full px-3 py-2.5 text-left"
>
<div className="flex items-start justify-between gap-2">
<div className="min-w-0 flex-1">
<div
className="break-all text-xs font-semibold text-[color:var(--app-text)]"
title={captureLabel}
>
片段名:{captureLabel}
</div>
<div className="mt-1 truncate text-[10px] text-slate-500 dark:text-gray-500">
{formatAnnotationTime(task.clipStart)}–{formatAnnotationTime(task.clipEnd)}
</div>
<div
className="text-xs font-semibold leading-snug text-[color:var(--app-text)] [overflow-wrap:anywhere]"
title={captureLabel}
>
片段名:
<CaptureName name={captureLabel} />
</div>
<div className="mt-1.5 flex items-center justify-between gap-2">
<div className="min-w-0 truncate text-[11px] tabular-nums text-slate-500 dark:text-gray-500">
{formatAnnotationTime(task.clipStart)}–{formatAnnotationTime(task.clipEnd)}
</div>
{(() => {
switch (detailedStatus) {
case "submitting":
return (
<span className="shrink-0 rounded-full border border-amber-500/50 bg-amber-50 px-2 py-0.5 text-[9px] font-semibold text-amber-700 dark:bg-amber-500/20 dark:text-amber-300">
<span className="shrink-0 rounded-full border border-amber-500/50 bg-amber-50 px-2 py-0.5 text-[11px] font-semibold text-amber-700 dark:bg-amber-500/20 dark:text-amber-300">
送检处理中
</span>
);
case "submission_conflicted":
return (
<span className="shrink-0 rounded-full border border-rose-500/50 bg-rose-50 px-2 py-0.5 text-[9px] font-semibold text-rose-700 dark:bg-rose-500/20 dark:text-rose-300">
<span className="shrink-0 rounded-full border border-rose-500/50 bg-rose-50 px-2 py-0.5 text-[11px] font-semibold text-rose-700 dark:bg-rose-500/20 dark:text-rose-300">
送检待核对
</span>
);
case "rework":
return (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-rose-500/50 bg-rose-50 px-2 py-0.5 text-[9px] font-semibold text-rose-700 dark:border-rose-500/40 dark:bg-rose-500/20 dark:text-rose-300">
<AlertCircle className="h-2.5 w-2.5" />
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-rose-500/50 bg-rose-50 px-2 py-0.5 text-[11px] font-semibold text-rose-700 dark:border-rose-500/40 dark:bg-rose-500/20 dark:text-rose-300">
<AlertCircle className="h-3 w-3" />
打回
</span>
);
case "rework_review":
return (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-amber-500/60 bg-amber-50 px-2 py-0.5 text-[9px] font-semibold text-amber-700 dark:border-amber-500/40 dark:bg-amber-500/20 dark:text-amber-300">
<AlertCircle className="h-2.5 w-2.5" />
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-amber-500/60 bg-amber-50 px-2 py-0.5 text-[11px] font-semibold text-amber-700 dark:border-amber-500/40 dark:bg-amber-500/20 dark:text-amber-300">
<AlertCircle className="h-3 w-3" />
返工复查
</span>
);
case "slicing":
return (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-amber-500/50 bg-amber-50 px-2 py-0.5 text-[9px] font-semibold text-amber-700 dark:border-amber-500/40 dark:bg-amber-500/20 dark:text-amber-300">
<Loader2 className="h-2.5 w-2.5 animate-spin text-amber-600" />
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-amber-500/50 bg-amber-50 px-2 py-0.5 text-[11px] font-semibold text-amber-700 dark:border-amber-500/40 dark:bg-amber-500/20 dark:text-amber-300">
<Loader2 className="h-3 w-3 animate-spin text-amber-600" />
正在切片
</span>
);
case "pending_annotation":
return (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-orange-500/50 bg-orange-50 px-2 py-0.5 text-[9px] font-semibold text-orange-700 dark:border-orange-500/40 dark:bg-orange-500/20 dark:text-orange-300">
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-orange-500/50 bg-orange-50 px-2 py-0.5 text-[11px] font-semibold text-orange-700 dark:border-orange-500/40 dark:bg-orange-500/20 dark:text-orange-300">
<span className="h-1.5 w-1.5 rounded-full bg-orange-500 animate-pulse" />
待标注
</span>
);
case "pending_slice":
return (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-sky-500/40 bg-sky-50 px-2 py-0.5 text-[9px] font-semibold text-sky-700 dark:border-sky-500/40 dark:bg-sky-500/20 dark:text-sky-300">
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-sky-500/40 bg-sky-50 px-2 py-0.5 text-[11px] font-semibold text-sky-700 dark:border-sky-500/40 dark:bg-sky-500/20 dark:text-sky-300">
<span className="h-1.5 w-1.5 rounded-full bg-sky-500" />
待切片
</span>
);
case "pending_quality":
return (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-blue-500/40 bg-blue-50 px-2 py-0.5 text-[9px] font-medium text-blue-700 dark:bg-blue-500/20 dark:text-blue-300">
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-blue-500/40 bg-blue-50 px-2 py-0.5 text-[11px] font-medium text-blue-700 dark:bg-blue-500/20 dark:text-blue-300">
已送检
</span>
);
case "pending_acceptance":
return (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-cyan-500/40 bg-cyan-50 px-2 py-0.5 text-[9px] font-medium text-cyan-700 dark:bg-cyan-500/20 dark:text-cyan-300">
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-cyan-500/40 bg-cyan-50 px-2 py-0.5 text-[11px] font-medium text-cyan-700 dark:bg-cyan-500/20 dark:text-cyan-300">
待验收
</span>
);
case "accepted":
return (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-emerald-500/40 bg-emerald-50 px-2 py-0.5 text-[9px] font-medium text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300">
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-emerald-500/40 bg-emerald-50 px-2 py-0.5 text-[11px] font-medium text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300">
已通过
</span>
);
default:
return humanItem?.assignedUserId ? (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-purple-500/40 bg-purple-50 px-2 py-0.5 text-[9px] font-semibold text-purple-700 dark:border-purple-500/40 dark:bg-purple-500/20 dark:text-purple-300">
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-purple-500/40 bg-purple-50 px-2 py-0.5 text-[11px] font-semibold text-purple-700 dark:border-purple-500/40 dark:bg-purple-500/20 dark:text-purple-300">
处理中({assignee?.name || "他人"})
</span>
) : (
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-slate-300 bg-slate-50 px-2 py-0.5 text-[9px] font-semibold text-slate-600 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300">
<span className="shrink-0 inline-flex items-center gap-1 rounded-full border border-slate-300 bg-slate-50 px-2 py-0.5 text-[11px] font-semibold text-slate-600 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300">
待领取
</span>
);
@ -7135,7 +7159,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
currentRevision={humanItem?.currentRevision || task.currentRevision}
/>
)}
<div className="mt-1.5 text-[10px] text-gray-500">
<div className="mt-1.5 text-[11px] leading-snug text-gray-500">
{detailedStatus === "rework_review" &&
(humanItem?.assignedUserId === currentUser?.id
? "当前:返工待复审 · 您已领取。"
@ -7384,17 +7408,18 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
<div
className={cn(
"text-sm font-semibold text-[color:var(--app-text)]",
focusedStageLayout ? "truncate" : "break-all",
focusedStageLayout ? "truncate" : "[overflow-wrap:anywhere]",
)}
title={captureTaskDisplayName(selectedHumanItem, detail.task)}
>
片段名:{captureTaskDisplayName(selectedHumanItem, detail.task)}
片段名:
<CaptureName name={captureTaskDisplayName(selectedHumanItem, detail.task)} />
</div>
<div className="mt-1 flex flex-wrap items-center gap-2 text-[10px] text-gray-500">
<span>{statusLabels[detail.task.status]}</span>
{detail.task.runId && isOrganizationAdminRole(role) ? (
<Link
className="font-mono text-blue-300 hover:text-blue-200"
className="font-mono text-blue-600 hover:text-blue-700 dark:text-blue-300 dark:hover:text-blue-200"
to={`/monitoring?runId=${encodeURIComponent(detail.task.runId)}`}
>
Run {detail.task.runId}
@ -7430,7 +7455,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
</button>
</div>
) : null}
<div className="rounded border border-blue-500/30 bg-blue-500/10 px-2 py-1 text-[10px] text-blue-200">
<div className="rounded border border-blue-500/30 bg-blue-500/10 px-2 py-1 text-[11px] font-medium text-blue-700 dark:text-blue-200">
{annotationStage === "split_annotation" || annotationStage === "cut_adjustment"
? "人工剪切调整"
: annotationStage === "split_quality_review" || annotationStage === "cut_review"
@ -7468,21 +7493,21 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
);
case "rework":
return (
<div className="inline-flex items-center gap-1.5 rounded-full border border-rose-500/40 bg-rose-500/15 px-2.5 py-1 text-xs font-semibold text-rose-300">
<div className="inline-flex items-center gap-1.5 rounded-full border border-rose-500/40 bg-rose-500/15 px-2.5 py-1 text-xs font-semibold text-rose-700 dark:text-rose-300">
<AlertCircle className="h-3.5 w-3.5" />
<span>打回(需返工)</span>
</div>
);
case "rework_review":
return (
<div className="inline-flex items-center gap-1.5 rounded-full border border-amber-500/40 bg-amber-500/15 px-2.5 py-1 text-xs font-semibold text-amber-300">
<div className="inline-flex items-center gap-1.5 rounded-full border border-amber-500/40 bg-amber-500/15 px-2.5 py-1 text-xs font-semibold text-amber-700 dark:text-amber-300">
<AlertCircle className="h-3.5 w-3.5" />
<span>返工复查(核对修正与原退回意见)</span>
</div>
);
case "slicing":
return (
<div className="inline-flex items-center gap-1.5 rounded-full border border-amber-500/40 bg-amber-500/15 px-2.5 py-1 text-xs font-semibold text-amber-300">
<div className="inline-flex items-center gap-1.5 rounded-full border border-amber-500/40 bg-amber-500/15 px-2.5 py-1 text-xs font-semibold text-amber-700 dark:text-amber-300">
<Loader2 className="h-3.5 w-3.5 animate-spin text-amber-400" />
<span>正在切片数据包…</span>
</div>
@ -7503,7 +7528,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
);
case "pending_quality":
return (
<div className="inline-flex items-center gap-1.5 rounded-full border border-blue-500/40 bg-blue-500/15 px-2.5 py-1 text-xs font-semibold text-blue-300">
<div className="inline-flex items-center gap-1.5 rounded-full border border-blue-500/40 bg-blue-500/15 px-2.5 py-1 text-xs font-semibold text-blue-700 dark:text-blue-300">
<span>已送检(待质检)</span>
</div>
);
@ -7525,7 +7550,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
<span>处理中(领取人:{selectedHumanItem.assignedUserId})</span>
</div>
) : (
<div className="inline-flex items-center gap-1.5 rounded-full border border-blue-500/40 bg-blue-500/15 px-2.5 py-1 text-xs font-semibold text-blue-300">
<div className="inline-flex items-center gap-1.5 rounded-full border border-blue-500/40 bg-blue-500/15 px-2.5 py-1 text-xs font-semibold text-blue-700 dark:text-blue-300">
<span>待领取</span>
</div>
);
@ -7759,6 +7784,11 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
))
}
reviewWriteLocked={reviewWriteLocked || Boolean(reviewDecision.pending)}
reviewReadOnlyNotice={
reviewSessionEnabled && !reviewSession.writable
? "本页只读,点上方「在本页接管审查」后可审核"
: ""
}
reviewProblemPanel={reviewProblemPanel}
reviewTracePanel={reviewTracePanel}
onReviewNavigate={reviewDraft.onNavigate}
@ -8018,17 +8048,17 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
aria-modal="true"
aria-label="重新切片警告"
>
<div className="w-full max-w-lg rounded-2xl border border-red-500/35 bg-[#151619] p-6 shadow-2xl">
<div className="flex items-center gap-3 text-red-200">
<div className="w-full max-w-lg rounded-2xl border border-red-500/35 bg-[color:var(--app-panel)] p-6 shadow-2xl">
<div className="flex items-center gap-3 text-red-600 dark:text-red-200">
<XCircle className="h-6 w-6" />
<h2 className="text-lg font-semibold">重新切片会丢失全部标注</h2>
</div>
<p className="mt-4 text-sm leading-6 text-gray-300">
<p className="mt-4 text-sm leading-6 text-slate-600 dark:text-gray-300">
两种方式都会清空片内动作划分、描述和无效判断,返回切片编辑。此操作成功后不能通过撤销恢复。
</p>
<fieldset
disabled={saving || pendingReslice?.taskId === detail?.task.id}
className="mt-4 space-y-3 text-sm text-gray-200"
className="mt-4 space-y-3 text-sm text-[color:var(--app-text)]"
>
<label className="flex items-start gap-2">
<input
@ -8041,7 +8071,9 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
/>
<span>
全部重置
<span className="block text-xs text-gray-400">清空切片划分、名称和舍弃判断,恢复为一整段。</span>
<span className="block text-xs text-slate-500 dark:text-gray-400">
清空切片划分、名称和舍弃判断,恢复为一整段。
</span>
</span>
</label>
<label className="flex items-start gap-2">
@ -8054,12 +8086,14 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
/>
<span>
保留外层切片
<span className="block text-xs text-gray-400">保留切片边界、名称和舍弃原因,清空片内动作。</span>
<span className="block text-xs text-slate-500 dark:text-gray-400">
保留切片边界、名称和舍弃原因,清空片内动作。
</span>
</span>
</label>
</fieldset>
{resliceError && (
<p role="alert" className="mt-3 text-sm text-red-300">
<p role="alert" className="mt-3 text-sm text-red-600 dark:text-red-300">
{userErrorMessage(resliceError)}
</p>
)}
@ -8067,7 +8101,7 @@ export default function AnnotationOperations({ workPage = false }: { workPage?:
<button
type="button"
onClick={() => setShowResliceWarning(false)}
className="rounded-lg border border-[#34363b] px-4 py-2 text-sm text-gray-300"
className="rounded-lg border border-[color:var(--app-control-border)] px-4 py-2 text-sm text-slate-700 transition-colors hover:bg-slate-50 dark:text-gray-300 dark:hover:bg-white/5"
>
取消
</button>

View File

@ -1751,6 +1751,63 @@
font-size: 11px;
white-space: nowrap;
}
/* 工作台根节点拿到焦点(快捷键生效)时,用柔和的品牌色描边代替浏览器默认的
黑色粗焦点框;仍保留可见的焦点提示。 */
.capture-workbench:focus-visible,
[data-testid="final-acceptance-workspace"]:focus-visible {
outline: 2px solid rgb(249 115 22 / 45%);
outline-offset: -2px;
}
/* 画面工具条:同一套描边、按下态与悬停反馈(只换外观,尺寸不变以守住 615px 底线)。 */
.capture-caption-toggle,
.capture-slice-zoom,
.capture-camera-inspection-controls button {
background: var(--app-panel);
border-color: var(--app-control-border);
transition:
border-color 0.15s,
color 0.15s,
background-color 0.15s;
}
.capture-caption-toggle:hover:not(:disabled),
.capture-slice-zoom:hover:not(:disabled),
.capture-camera-inspection-controls button:hover:not(:disabled) {
border-color: rgb(249 115 22 / 60%);
}
.capture-slice-zoom[aria-pressed="true"] {
border-color: #f97316;
color: #c2410c;
}
html.dark .capture-slice-zoom[aria-pressed="true"],
html.dark .capture-camera-inspection-controls button[aria-pressed="true"] {
color: #fdba74;
}
/* 任务池顶栏(普通与专注):工作模式、容量、领取、任务切换和返回按钮统一为 28px 高的同一套控件。 */
.annotation-operations-page .annotation-work-buffer :is(button, select),
.annotation-operations-page[data-workspace-compact]
.annotation-work-page-navigation
a:not(.annotation-task-diagnostics) {
min-height: 28px;
border-radius: 6px;
background-color: var(--app-panel);
transition:
border-color 0.15s,
color 0.15s,
background-color 0.15s;
}
.annotation-operations-page[data-workspace-compact]
.annotation-work-page-navigation
a:not(.annotation-task-diagnostics) {
padding: 3px 12px;
font-size: 13px;
line-height: 20px;
}
.annotation-operations-page .annotation-work-buffer :is(button, select):hover:not(:disabled),
.annotation-operations-page[data-workspace-compact]
.annotation-work-page-navigation
a:not(.annotation-task-diagnostics):hover {
border-color: rgb(59 130 246 / 60%);
}
.capture-caption-strip {
flex-shrink: 0;
min-height: 0;

View File

@ -62,6 +62,17 @@
grid-column: 2;
grid-row: 1 / 4;
}
/* 普通审查布局:侧栏常比左列高。多余高度交给末尾弹性行,相机行、画面和播放
控制条保持自身高度,不再被拉伸成大块空白。专注布局里本容器是
display: contents,这里的行定义不生效。 */
@media (min-width: 1001px) {
.capture-workbench .capture-review-video-panel {
grid-template-rows: repeat(4, auto) minmax(0, 1fr);
}
.capture-workbench .capture-review-video-panel > .review-qa-side-panel {
grid-row: 1 / -1;
}
}
@media (max-width: 1000px) {
.capture-review-video-panel {
grid-template-columns: minmax(0, 1fr);

View File

@ -31,6 +31,28 @@
font-weight: 600;
line-height: 1.5;
}
.review-focus-heading > button {
border-radius: 8px;
padding: 4px 12px;
font-size: 13px;
line-height: 20px;
background: var(--app-panel);
transition:
border-color 0.15s,
color 0.15s,
background-color 0.15s;
}
.review-focus-heading > button:hover:not(:disabled) {
border-color: rgb(59 130 246 / 60%);
color: #2563eb;
}
html.dark .review-focus-heading > button:hover:not(:disabled) {
color: #93c5fd;
}
.review-focus-heading > button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.annotation-operations-page[data-review-focused] > .annotation-workspace-heading,
.annotation-operations-page[data-review-focused] .annotation-task-pool {
display: none;
@ -390,6 +412,15 @@
[data-testid="final-acceptance-workspace"][data-review-focused] aside > .review-caption-details {
flex: 0 1 135px;
}
/* 上面的 aside 规则(flex 列 + 子项 min-height:0)也会命中内层的「当前画面标注」
面板,把标题和正文压成几像素高、互相重叠;内层面板恢复普通块排版并自行滚动。 */
[data-testid="final-acceptance-workspace"][data-review-focused] aside.review-caption-details {
display: block;
overflow: auto;
}
[data-testid="final-acceptance-workspace"][data-review-focused] aside.review-caption-details > * {
margin-block: 0 6px;
}
[data-testid="final-acceptance-workspace"][data-review-focused] aside > .review-problem-panel {
flex: 1;
min-height: 0;
@ -471,6 +502,20 @@
grid-template-columns: 150px minmax(0, 1fr) minmax(460px, 34vw);
}
}
/* 审查视图不渲染动作列表时,收起为它预留的 150px 左栏,画面不再空出一条白边;
动作列表一旦出现,原三栏几何自动恢复。 */
.annotation-operations-page[data-review-focused]
.capture-workbench-host
> .capture-workbench:not(:has(.capture-action-list)) {
grid-template-columns: 0 minmax(0, 1fr) 310px;
}
@media (min-width: 1001px) {
.annotation-operations-page[data-review-focused]
.capture-workbench-host
> .capture-workbench:has(.qc-review-dual-board):not(:has(.capture-action-list)) {
grid-template-columns: 0 minmax(0, 1fr) minmax(460px, 34vw);
}
}
@media (max-width: 1000px) {
.qc-review-dual-board {
grid-template-columns: minmax(0, 1fr);

View File

@ -484,3 +484,36 @@ test("local mock preview is guarded by Vite development mode", () => {
assert.match(preview, /href=\{href\}/);
assert.match(preview, /onReturnToPool=\{\(\) => setView\("pool"\)\}/);
});
test("a read-only quality review keeps its own footer instead of the annotator slice bar", () => {
const footer = workbench.slice(workbench.indexOf("<footer"), workbench.indexOf("</footer>"));
// Slice phase only routes to the annotator's confirmation bar outside quality review.
assert.match(footer, /\) : phase === "slice" && !isQualityReview \? \(/);
const readOnlyFooter = footer.slice(footer.indexOf(") : readOnly ? ("));
assert.match(readOnlyFooter, /isQualityReview && reviewReadOnlyNotice \?/);
assert.match(readOnlyFooter, /质检审核模式(只读查看)/);
// The hint appears exactly when the page offers the takeover button.
assert.match(
annotationOperations,
/reviewReadOnlyNotice=\{\s*reviewSessionEnabled && !reviewSession\.writable\s*\? "本页只读,点上方「在本页接管审查」后可审核"/,
);
assert.match(
annotationOperations,
/reviewSessionEnabled && !reviewSession\.writable && \(\s*<button[\s\S]{0,200}在本页接管审查/,
);
});
test("task connection diagnostics joins each layout's top row instead of taking its own line", () => {
assert.equal(annotationOperations.match(/当前任务连接诊断/g)?.length, 1);
assert.doesNotMatch(annotationOperations, /<div className="flex justify-end text-xs">\s*<a/);
const focusHeading = annotationOperations.slice(
annotationOperations.indexOf('<div className="review-focus-heading">'),
annotationOperations.indexOf('<div className="annotation-workspace-heading'),
);
assert.match(focusHeading, /返回任务池\s*<\/button>\s*\{taskDiagnosticsLink\}/);
assert.match(annotationOperations, /\{!reviewFocused && taskDiagnosticsLink\}\s*<Link/);
assert.match(
annotationOperations,
/<PageSubnav compact items=\{annotationStageTabs\}[^>]*\/>\s*<\/div>\s*\{!reviewFocused && \(\s*<div[^>]*>\s*\{taskDiagnosticsLink\}/,
);
});