+
- {versions.mismatch ? "版本不一致" : versionMetadataComplete ? "版本一致" : "元数据不完整"}
+ />
+
+ {componentStatusLabel}
-
-
- {componentRows.map((component) => (
-
-
-
{component.label}
-
- {component.readiness}
-
-
-
- {[
- ["commit", component.commit],
- ["image", component.image],
- ["built", component.buildTime],
- ].map(([label, value]) => (
-
-
- {label}
- -
- {value}
-
-
- ))}
-
-
- ))}
-
-
-
+
+
+
+
+
组件版本与就绪状态
+
+ 点击页头状态,随时核对本次发布的三组件组合。
+
+
+
+ {versions.mismatch ? "版本不一致" : versionMetadataComplete ? "版本一致" : "元数据不完整"}
+
+
+
+ {componentRows.map((component) => (
+
+
+
{component.label}
+
+ {component.readiness}
+
+
+
+ {[
+ ["commit", component.commit],
+ ["image", component.image],
+ ["built", component.buildTime],
+ ].map(([label, value]) => (
+
+
- {label}
+ -
+ {value}
+
+
+ ))}
+
+
+ ))}
+
+
+
* {
margin-bottom: 8px;
}
-/* Transient track errors use a bounded floating notice, never an extra grid row. */
-.annotation-operations-page[data-workspace-compact] .capture-timeline-editor > [role="alert"] {
- position: absolute;
- left: 8px;
- bottom: 128px;
- z-index: 20;
- max-width: calc(100% - 380px);
+/* Slice errors stay inside the fixed editor, clear of transport controls at every height. */
+.annotation-operations-page[data-workspace-compact] .capture-slice-error {
max-height: 56px;
overflow: auto;
- background: var(--app-panel);
- padding: 4px 8px;
}
.annotation-operations-page[data-workspace-compact] [data-testid="frame-timeline-status"] {
position: absolute;
@@ -882,11 +875,13 @@
.annotation-operations-page[data-workspace-compact] .capture-description-actions {
flex: none;
padding-top: 4px;
- gap: 4px;
+ flex-wrap: nowrap;
+ gap: 3px;
}
.annotation-operations-page[data-workspace-compact] .capture-description-actions button {
- padding: 4px 6px;
- font-size: 11px;
+ padding: 4px 3px;
+ font-size: 10px;
+ white-space: nowrap;
}
.annotation-operations-page[data-workspace-compact][data-workspace-stage="annotate"]
[data-testid="slice-disposition-panel"] {
@@ -967,15 +962,6 @@
.annotation-operations-page[data-workspace-compact] .annotation-task-heading .text-white {
color: var(--app-text);
}
-.annotation-operations-page[data-workspace-compact] .capture-description-actions {
- flex-wrap: nowrap;
- gap: 3px;
-}
-.annotation-operations-page[data-workspace-compact] .capture-description-actions button {
- padding: 4px 3px;
- font-size: 10px;
- white-space: nowrap;
-}
/* Paging/search shares existing timeline headers, preserving the video budget. */
.timeline-page-navigation {
diff --git a/tests/browser/annotation-workspace-dictionaries.mjs b/tests/browser/annotation-workspace-dictionaries.mjs
index 671aac71..db310bbc 100644
--- a/tests/browser/annotation-workspace-dictionaries.mjs
+++ b/tests/browser/annotation-workspace-dictionaries.mjs
@@ -242,6 +242,7 @@ try {
assert.equal((await read(task)).version, old.version);
continue;
}
+ if (process.env.ANNOTATION_DICTIONARY_READ_ONLY === "1") continue;
const input = page.getByRole("textbox", { name: "动作描述", exact: true });
const original = old.subject.payload.annotationWorkspace.segments[0].description;
const text = `Task05 长描述 ${Date.now()}\n` + "中文动作描述内容与完整阅读。".repeat(160);
diff --git a/tests/browser/annotation-workspace-errors-and-legacy.mjs b/tests/browser/annotation-workspace-errors-and-legacy.mjs
new file mode 100644
index 00000000..54e1b538
--- /dev/null
+++ b/tests/browser/annotation-workspace-errors-and-legacy.mjs
@@ -0,0 +1,181 @@
+// Visible error controls and original portal ownership replace the obsolete source-text assertion.
+import assert from "node:assert/strict";
+import { chromium } from "playwright";
+const browser = await chromium.launch({
+ executablePath: "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
+ headless: true,
+ args: ["--no-proxy-server"],
+});
+const context = await browser.newContext({
+ storageState: "local-data/verification/annotation-workspace-layout/auth.json",
+ viewport: { width: 1280, height: 640 },
+});
+const page = await context.newPage();
+const button = (name) => page.getByRole("button", { name, exact: true });
+const task = "annotation-task-workspace-layout-acceptance-pool-01";
+const base = "http://127.0.0.1:5173";
+const read = async () => {
+ const r = await context.request.get(`${base}/api/human-items/${task.replace("annotation-task-", "human-item-")}`);
+ assert.ok(r.ok());
+ return (await r.json()).item;
+};
+const reachable = async (locator) =>
+ assert.ok(
+ await locator.evaluate((e) => {
+ const r = e.getBoundingClientRect();
+ return (
+ r.width > 0 &&
+ r.height > 0 &&
+ r.x >= 0 &&
+ r.y >= 0 &&
+ r.right <= innerWidth &&
+ r.bottom <= innerHeight &&
+ e.contains(document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2))
+ );
+ }),
+ `control remains hit-test reachable: ${await locator.innerText()}`,
+ );
+const writes = [];
+page.on("request", (r) => {
+ if (r.method() !== "GET" && /random-claims|\/tasks\//.test(r.url())) writes.push(r.url());
+});
+try {
+ const before = await read();
+ await page.goto(
+ `${base}/plugins/annotation-qa/workflows/all/work?projectId=project-workspace-layout-acceptance&taskId=${task}`,
+ );
+ await page.getByRole("button").filter({ hasText: task }).click();
+ await button("继续工作").click();
+ const bench = page.getByTestId("capture-annotation-workbench");
+ await bench.waitFor();
+ await page.waitForFunction(
+ () =>
+ document.querySelectorAll("video").length === 2 &&
+ [...document.querySelectorAll("video")].every((v) => v.readyState >= 2),
+ );
+ await bench.focus();
+ await page.keyboard.press("c");
+ await bench.getByRole("alert").waitFor();
+ for (const [width, height] of [
+ [1280, 640],
+ [1366, 680],
+ [1440, 800],
+ [1920, 980],
+ [2560, 1320],
+ ]) {
+ await page.setViewportSize({ width, height });
+ await page.waitForTimeout(200);
+ for (const name of [
+ "播放",
+ "上一帧",
+ "下一帧",
+ "在播放头分割切片",
+ "从切片字典选择",
+ "确认全部切片",
+ "撤销",
+ "重做",
+ "切回原布局",
+ "开始连续工作",
+ ])
+ await reachable(button(name));
+ assert.ok(
+ await page.evaluate(
+ () =>
+ document.documentElement.scrollWidth <= innerWidth && document.documentElement.scrollHeight <= innerHeight,
+ ),
+ );
+ await reachable(bench.getByRole("alert"));
+ if (width === 1920)
+ await page.screenshot({ path: "local-data/verification/annotation-workspace-layout/task08-error-fixed.png" });
+ console.log("PASS actual error-state controls", width, height);
+ }
+ await page.setViewportSize({ width: 1280, height: 640 });
+ await button("切回原布局").click();
+ await button("从切片字典选择").click();
+ const dialog = page.getByRole("dialog", { name: "选择切片名称", exact: true });
+ await dialog.waitFor();
+ const search = dialog.getByRole("textbox", { name: "搜索切片字典", exact: true });
+ await reachable(search);
+ await search.fill("布局验收切片 003");
+ const option = dialog.getByRole("button", { name: "布局验收切片 003", exact: true });
+ await reachable(option);
+ await option.click();
+ assert.equal(await page.getByLabel("切片名称:").inputValue(), "布局验收切片 003");
+ await bench.focus();
+ await page.keyboard.press("f");
+ await search.fill("布局验收切片 002");
+ await search.press("ArrowDown");
+ await page.keyboard.press("Enter");
+ assert.equal(await page.getByLabel("切片名称:").inputValue(), "布局验收切片 002");
+ await bench.focus();
+ await page.keyboard.press("d");
+ await dialog.waitFor();
+ await page.keyboard.press("Escape");
+ await dialog.waitFor({ state: "detached" });
+ assert.ok(await bench.evaluate((e) => e === document.activeElement));
+ await page.keyboard.press("Space");
+ await page.waitForFunction(() => !document.querySelector("video").paused);
+ await page.keyboard.press("Space");
+ assert.equal((await read()).version, before.version);
+ assert.equal(writes.length, 0);
+ console.log(
+ "PASS original dictionary visible portal, pointer/search/keyboard selection, one-Esc and Space ownership; no writes",
+ );
+ await button("进入专注视图").click();
+ await bench.focus();
+ for (let i = 0; i < 3; i++) await page.keyboard.press("Control+ArrowLeft");
+ do {
+ await button("从切片字典选择").click();
+ const picker = page.getByRole("dialog", { name: "选择切片名称", exact: true });
+ await picker.getByRole("textbox").fill("布局验收切片 001");
+ await picker.getByRole("button", { name: "布局验收切片 001", exact: true }).click();
+ if (await button("下一片").isDisabled()) break;
+ await button("下一片").click();
+ } while (true);
+ for (const stage of ["slice", "annotate"]) {
+ if (stage === "annotate") {
+ const id = "annotation-task-workspace-layout-acceptance-annotate-primary";
+ await page.goto(
+ `${base}/plugins/annotation-qa/workflows/all/work?projectId=project-workspace-layout-acceptance&taskId=${id}`,
+ );
+ await page.getByRole("button").filter({ hasText: id }).click();
+ await button("继续工作").click();
+ await button("完成任务并提交质检").waitFor();
+ }
+ await button(stage === "slice" ? "确认全部切片" : "完成任务并提交质检").click();
+ const confirm = page.getByRole("dialog", {
+ name: stage === "slice" ? "确认生成切片" : "确认提交质检",
+ exact: true,
+ });
+ await confirm.waitFor();
+ for (const [width, height] of [
+ [1280, 640],
+ [1366, 680],
+ [1440, 800],
+ [1920, 980],
+ [2560, 1320],
+ ]) {
+ await page.setViewportSize({ width, height });
+ await page.waitForTimeout(100);
+ await reachable(confirm.getByRole("button", { name: stage === "slice" ? "确认生成" : "确认送检", exact: true }));
+ await reachable(confirm.getByRole("button", { name: "返回编辑", exact: true }));
+ assert.ok(
+ await page.evaluate(
+ () =>
+ document.documentElement.scrollWidth <= innerWidth && document.documentElement.scrollHeight <= innerHeight,
+ ),
+ );
+ }
+ await confirm.getByRole("button", { name: "返回编辑", exact: true }).click();
+ console.log("PASS five-size stage confirmation actions without submission", stage);
+ }
+ assert.equal(writes.length, 0);
+} catch (e) {
+ await page.screenshot({
+ path: "local-data/verification/annotation-workspace-layout/task08-error-legacy-failure.png",
+ });
+ throw e;
+} finally {
+ await context.close();
+ await browser.close();
+}
diff --git a/tests/browser/annotation-workspace-full-workflow.mjs b/tests/browser/annotation-workspace-full-workflow.mjs
new file mode 100644
index 00000000..ef19ea0a
--- /dev/null
+++ b/tests/browser/annotation-workspace-full-workflow.mjs
@@ -0,0 +1,229 @@
+// One-shot local fixtures: never reset completed tasks to rerun this acceptance.
+import assert from "node:assert/strict";
+import { chromium } from "playwright";
+const base = "http://127.0.0.1:5173";
+const prefix = process.env.WORKFLOW_PREFIX || "workspace-full-workflow";
+assert.match(prefix, /^workspace-full-workflow[0-9]*(?:-[a-z0-9]+)?$/);
+const browser = await chromium.launch({
+ executablePath: "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
+ headless: true,
+ args: ["--no-proxy-server"],
+});
+const context = await browser.newContext({
+ storageState: "local-data/verification/annotation-workspace-layout/auth.json",
+ viewport: { width: 1280, height: 640 },
+});
+const page = await context.newPage();
+page.setDefaultTimeout(20000);
+const button = (name) => page.getByRole("button", { name, exact: true });
+const writes = [];
+page.on("request", (r) => {
+ if (r.method() === "POST") writes.push({ url: r.url(), body: r.postDataJSON() });
+});
+const startIndex = Number(process.env.WORKFLOW_START_INDEX || 0);
+assert.ok(startIndex === 0 || startIndex === 1);
+const claims = () => writes.filter((r) => r.url.endsWith("/random-claims"));
+const read = async (task) => {
+ const r = await context.request.get(`${base}/api/human-items/${task.replace("annotation-task-", "human-item-")}`);
+ assert.ok(r.ok());
+ return (await r.json()).item;
+};
+const media = () =>
+ page.waitForFunction(
+ () =>
+ document.querySelectorAll("video").length === 2 &&
+ [...document.querySelectorAll("video")].every((v) => v.readyState >= 2),
+ null,
+ { timeout: 60000 },
+ );
+const post = (suffix) =>
+ page.waitForResponse((r) => r.url().endsWith(suffix) && r.request().method() === "POST", { timeout: 60000 });
+const noScroll = async () =>
+ assert.ok(
+ await page.evaluate(
+ () => document.documentElement.scrollWidth <= innerWidth && document.documentElement.scrollHeight <= innerHeight,
+ ),
+ );
+try {
+ const primary = `annotation-task-${prefix}-${startIndex ? process.env.WORKFLOW_OWNED_TASK : "slice-primary"}`;
+ assert.match(primary, new RegExp(`^annotation-task-${prefix}-(slice-primary|pool-0[12])$`));
+ const initial = await read(primary);
+ assert.equal(initial.version, startIndex ? 2 : 1, "requires untouched owned task; never reset consumed evidence");
+ if (startIndex) {
+ await page.goto(`${base}/plugins/annotation-qa/workflows/all/work?projectId=project-${prefix}&taskId=${primary}`);
+ await page.getByRole("button").filter({ hasText: primary }).click();
+ await button("继续工作").click();
+ await button("开始连续工作").click();
+ } else {
+ await page.goto(
+ `${base}/plugins/annotation-qa/workflows/all/annotate?projectId=project-${prefix}&taskId=${primary}`,
+ );
+ await page.getByTestId("capture-annotation-workbench").waitFor();
+ assert.ok(await page.locator('header[aria-label="平台状态与主题"]').isVisible());
+ await button("开始工作").click();
+ await page.waitForURL(/\/work\?/);
+ }
+ await page.getByTestId("capture-annotation-workbench").waitFor();
+ assert.equal(new URL(page.url()).searchParams.get("taskId"), primary);
+ assert.equal(context.pages().length, 1);
+ assert.equal(claims().length, 0);
+ console.log("PASS Start/explicit recovery same-tab owned-first without random claim");
+ for (let index = startIndex; index < 3; index++) {
+ await button("确认全部切片").waitFor();
+ await button("删除切片").first().waitFor();
+ await media();
+ const task = new URL(page.url()).searchParams.get("taskId");
+ assert.match(task, new RegExp(`^annotation-task-${prefix}-(slice-primary|pool-0[12])$`));
+ const before = await read(task);
+ assert.equal(before.subject.payload.sliceWorkflow.phase, "annotate");
+ assert.ok(
+ before.subject.payload.annotationWorkspace.segments.some((s) => s.description === "整体验收已保存动作 1"),
+ );
+ }
+ let generated = before,
+ saved = before;
+ if (!resuming) {
+ assert.equal(before.subject.payload.sliceWorkflow.phase, "slice");
+ const bench = page.getByTestId("capture-annotation-workbench");
+ await bench.focus();
+ const cuts = await button("删除切片").count();
+ for (let n = 0; n < 6; n++) {
+ await page.keyboard.press("ArrowRight");
+ await page.waitForTimeout(100);
+ }
+ await page.waitForFunction(
+ () => document.querySelector("video").currentTime > 0 && !document.querySelector("video").seeking,
+ );
+ await page.keyboard.press("c");
+ assert.equal(await button("删除切片").count(), cuts + 1, "split must visibly exist before generation");
+ // Rename every actual slice using the real project dictionary before generation.
+ await bench.focus();
+ for (let n = 0; n < 4; n++) await page.keyboard.press("Control+ArrowLeft");
+ do {
+ await button("从切片字典选择").click();
+ const dictionary = page.getByRole("dialog", { name: "选择切片名称", exact: true });
+ await dictionary.getByRole("textbox").fill(process.env.WORKFLOW_LABEL || "整体验收切片 001");
+ await dictionary
+ .getByRole("button", { name: process.env.WORKFLOW_LABEL || "整体验收切片 001", exact: true })
+ .click();
+ if (await button("下一片").isDisabled()) break;
+ await button("下一片").click();
+ } while (true);
+ await noScroll();
+ await button("确认全部切片").click();
+ let response = post("/slice-confirmations");
+ await button("确认生成").click();
+ const accepted = await response;
+ assert.ok(accepted.ok());
+ assert.equal((await accepted.json()).sliceWorkflow.status, "processing");
+ await button("新增动作描述").waitFor({ timeout: 180000 });
+ const generated = await read(task);
+ const sw = generated.subject.payload.sliceWorkflow;
+ assert.equal(sw.status, "completed");
+ assert.equal(sw.phase, "annotate");
+ assert.equal(sw.materialization.status, "completed");
+ assert.equal(sw.materialization.coverage.gapMicroseconds, 0);
+ assert.equal(sw.materialization.coverage.overlapMicroseconds, 0);
+ assert.equal(generated.subject.payload.annotationWorkspace.sliceSegments.length, 4);
+ await media();
+ await button("新增动作描述").click();
+ await bench.focus();
+ for (let n = 0; n < 6; n++) {
+ await page.keyboard.press("ArrowRight");
+ await page.waitForTimeout(100);
+ }
+ await button("确认结束点").click();
+ const input = page.getByRole("textbox", { name: "动作描述", exact: true });
+ const text = `整体验收已保存动作 ${index + 1}`;
+ await input.fill(text);
+ await button("切回原布局").click();
+ assert.equal(await input.inputValue(), text);
+ await button("进入专注视图").click();
+ assert.equal(await input.inputValue(), text);
+ response = post("/annotation-confirmations");
+ await button("确认保存描述").click();
+ assert.ok((await response).ok());
+ const saved = await read(task);
+ assert.equal(saved.version, generated.version + 1);
+ assert.ok(saved.subject.payload.annotationWorkspace.segments.some((s) => s.description === text));
+ console.log(
+ "PASS real generation and saved API readback",
+ JSON.stringify({ task, before: before.version, generated: generated.version, saved: saved.version }),
+ );
+ if (index === 1) {
+ await button("完成当前任务后停止").click();
+ await button("切回原布局").click();
+ await button("进入专注视图").click();
+ }
+ const count = claims().length;
+ await button("完成任务并提交质检").click();
+ await page.getByRole("dialog", { name: "确认提交质检", exact: true }).waitFor();
+ response = post("/combined-submissions");
+ await button("确认送检").click();
+ assert.ok((await response).ok());
+ let completed;
+ for (let i = 0; i < 180; i++) {
+ completed = await read(task);
+ if (completed.currentStageId === "quality_review") break;
+ await page.waitForTimeout(1000);
+ }
+ assert.equal(completed.currentStageId, "quality_review");
+ assert.ok(!completed.pendingCombinedSubmissionId);
+ assert.ok(completed.currentRevision > 0);
+ console.log(
+ "PASS real slice/generate/describe/save/sendQA",
+ JSON.stringify({
+ task,
+ before: before.version,
+ generated: generated.version,
+ saved: saved.version,
+ completed: completed.version,
+ stage: completed.currentStageId,
+ }),
+ );
+ if (index === 1) {
+ await page.waitForTimeout(3500);
+ assert.equal(claims().length, count, "stop after current suppresses next claim");
+ assert.equal(new URL(page.url()).searchParams.get("taskId"), task);
+ await button("恢复连续工作").click();
+ console.log("PASS stop after current and explicit resume");
+ }
+ if (index < 2) {
+ await page.waitForURL((u) => u.searchParams.get("taskId") !== task, { timeout: 60000 });
+ await page.getByTestId("capture-annotation-workbench").waitFor();
+ assert.equal(claims().length, count + 1);
+ } else {
+ await page
+ .getByText(/本项目暂无您可领取的标注任务/)
+ .first()
+ .waitFor({ timeout: 60000 });
+ assert.equal(claims().length, count + 1);
+ await page.waitForTimeout(2500);
+ assert.equal(claims().length, count + 1, "empty pool does not loop");
+ console.log("PASS authoritative empty pool stops automatic continuation");
+ }
+ }
+ assert.equal(writes.filter((w) => w.url.endsWith("/slice-confirmations")).length, 3 - startIndex);
+ assert.equal(writes.filter((w) => w.url.endsWith("/annotation-confirmations")).length, 3 - startIndex);
+ assert.equal(writes.filter((w) => w.url.endsWith("/combined-submissions")).length, 3 - startIndex);
+ assert.equal(claims().length, 3 - startIndex);
+ assert.equal(new Set(claims().map((w) => w.body.requestId)).size, 3 - startIndex);
+ console.log(
+ "PASS exact request totals",
+ JSON.stringify({
+ generation: writes.filter((w) => w.url.endsWith("/slice-confirmations")).length,
+ save: writes.filter((w) => w.url.endsWith("/annotation-confirmations")).length,
+ handoff: 3 - startIndex,
+ successfulClaims: 2 - startIndex,
+ emptyClaims: 1,
+ }),
+ );
+ await page.screenshot({ path: "local-data/verification/annotation-workspace-layout/task08-full-workflow.png" });
+} catch (e) {
+ await page.screenshot({ path: "local-data/verification/annotation-workspace-layout/task08-workflow-error.png" });
+ console.log(await page.locator("body").innerText());
+ throw e;
+} finally {
+ await context.close();
+ await browser.close();
+}
diff --git a/tests/browser/annotation-workspace-review-isolation.mjs b/tests/browser/annotation-workspace-review-isolation.mjs
new file mode 100644
index 00000000..a52dd111
--- /dev/null
+++ b/tests/browser/annotation-workspace-review-isolation.mjs
@@ -0,0 +1,94 @@
+// Read-only real reviewer workbenches; no claims, decisions or payload mutations.
+import assert from "node:assert/strict";
+import { chromium } from "playwright";
+const base = "http://127.0.0.1:5173";
+const browser = await chromium.launch({
+ executablePath: "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
+ headless: true,
+ args: ["--no-proxy-server"],
+});
+try {
+ for (const role of ["qc", "acceptance"]) {
+ const context = await browser.newContext({
+ storageState: `local-data/verification/annotation-workspace-layout/${role}-reviewer-auth.json`,
+ viewport: { width: 1280, height: 640 },
+ });
+ const page = await context.newPage();
+ const writes = [];
+ page.on("request", (r) => {
+ if (r.method() !== "GET" && /\/tasks\/|\/human-items\/|random-claims/.test(r.url())) writes.push(r.url());
+ });
+ const item = `human-item-workspace-layout-review-${role}`;
+ const read = async () => {
+ const r = await context.request.get(`${base}/api/human-items/${item}`);
+ assert.ok(r.ok());
+ return (await r.json()).item;
+ };
+ const before = await read();
+ const project = role === "qc" ? "project-workspace-layout-acceptance" : "project-d84a938560a792c16c2d72e8468e7563";
+ await page.goto(
+ `${base}/plugins/annotation-qa/workflows/all/${role === "qc" ? "quality" : "acceptance"}?projectId=${project}${role === "qc" ? "&taskId=annotation-task-workspace-layout-review-qc" : ""}`,
+ );
+ await page.getByRole("button", { name: /我的任务 1/ }).click();
+ if (role === "acceptance") await page.getByRole("button", { name: "继续处理", exact: true }).click();
+ const workspace = page.getByTestId(role === "qc" ? "capture-annotation-workbench" : "final-acceptance-workspace");
+ await workspace.waitFor();
+ let mediaAvailable = true;
+ if (role === "acceptance") {
+ const artifact = before.subject.payload.items[0].materialization.artifactId;
+ const response = await context.request.get(
+ `${base}/api/human-items/${item}/evidence/${artifact}/members?limit=200`,
+ );
+ assert.ok(response.ok());
+ const members = await response.json();
+ mediaAvailable = members.total > 0;
+ if (!mediaAvailable)
+ console.log(
+ "COVERAGE LIMIT acceptance media unavailable in existing local FILESYSTEM snapshot",
+ JSON.stringify({
+ artifact,
+ total: members.total,
+ contentAvailableCount: members.summary.contentAvailableCount,
+ }),
+ );
+ }
+ if (mediaAvailable)
+ await page.waitForFunction(
+ () =>
+ document.querySelectorAll("video").length >= 2 &&
+ [...document.querySelectorAll("video")].every((v) => v.readyState >= 2),
+ null,
+ { timeout: 60000 },
+ );
+ for (const [width, height] of [
+ [1280, 640],
+ [1920, 980],
+ ]) {
+ await page.setViewportSize({ width, height });
+ assert.ok(await page.locator('header[aria-label="平台状态与主题"]').isVisible());
+ assert.equal(await page.getByRole("button", { name: "切回原布局", exact: true }).count(), 0);
+ assert.equal(await page.getByRole("button", { name: "放大左相机", exact: true }).count(), 0);
+ assert.equal(await page.getByRole("dialog", { name: "工作区已暂停", exact: true }).count(), 0);
+ assert.equal(await page.locator(".annotation-operations-page[data-workspace-compact]").count(), 0);
+ assert.ok(await workspace.isVisible());
+ }
+ if (role === "qc") {
+ assert.ok(await page.getByText("质检审核模式", { exact: true }).isVisible());
+ await page.getByRole("button", { name: "审核通过", exact: true }).scrollIntoViewIfNeeded();
+ assert.ok(await page.getByRole("button", { name: "审核通过", exact: true }).isVisible());
+ } else {
+ await page.getByRole("textbox", { name: "最终验收意见", exact: true }).scrollIntoViewIfNeeded();
+ assert.ok(await page.getByRole("textbox", { name: "最终验收意见", exact: true }).isVisible());
+ }
+ assert.equal((await read()).version, before.version);
+ assert.equal(writes.length, 0);
+ await page.screenshot({ path: `local-data/verification/annotation-workspace-layout/task08-${role}-isolation.png` });
+ console.log(
+ "PASS actual reviewer workspace retains platform/original controls, scroll access and no focused layout",
+ JSON.stringify({ role, mediaAvailable, version: before.version, writes: writes.length }),
+ );
+ await context.close();
+ }
+} finally {
+ await browser.close();
+}
diff --git a/tests/browser/annotation-workspace-zoom-matrix.mjs b/tests/browser/annotation-workspace-zoom-matrix.mjs
new file mode 100644
index 00000000..43c34152
--- /dev/null
+++ b/tests/browser/annotation-workspace-zoom-matrix.mjs
@@ -0,0 +1,115 @@
+// Actual Edge zoom, isolated persistent profiles. Window sizes are not physical monitor/OS-scale tests.
+import assert from "node:assert/strict";
+import { readFileSync, mkdtempSync, writeFileSync } from "node:fs";
+import { chromium } from "playwright";
+const root = "local-data/verification/annotation-workspace-layout";
+const results = [];
+for (const [width, height] of [
+ [1366, 768],
+ [1440, 900],
+ [1920, 1080],
+ [2560, 1440],
+]) {
+ const context = await chromium.launchPersistentContext(mkdtempSync(`${root}/task08-zoom-`), {
+ executablePath: "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
+ headless: true,
+ viewport: null,
+ args: ["--no-proxy-server", `--window-size=${width},${height}`],
+ });
+ await context.addCookies(JSON.parse(readFileSync(`${root}/auth.json`)).cookies);
+ const settings = await context.newPage();
+ await settings.goto("edge://settings/appearance");
+ const zoom = (f) =>
+ settings.evaluate(
+ (f) =>
+ new Promise((resolve, reject) =>
+ chrome.settingsPrivate.setDefaultZoom(f, () =>
+ chrome.runtime.lastError ? reject(new Error(chrome.runtime.lastError.message)) : resolve(),
+ ),
+ ),
+ f,
+ );
+ const page = await context.newPage();
+ const button = (name) => page.getByRole("button", { name, exact: true });
+ const writes = [];
+ page.on("request", (r) => {
+ if (r.method() !== "GET" && /random-claims|\/tasks\//.test(r.url())) writes.push(r.url());
+ });
+ try {
+ await zoom(1);
+ const task = "annotation-task-workspace-layout-acceptance-annotate-primary";
+ await page.goto(
+ `http://127.0.0.1:5173/plugins/annotation-qa/workflows/all/work?projectId=project-workspace-layout-acceptance&taskId=${task}`,
+ );
+ await page.getByRole("button").filter({ hasText: task }).click();
+ await button("继续工作").click();
+ await page.getByTestId("capture-annotation-workbench").waitFor();
+ await page.getByTestId("annotation-description-block").first().click();
+ const input = page.getByRole("textbox", { name: "动作描述", exact: true });
+ await input.fill("缩放验收未保存草稿");
+ for (const factor of [1, 1.25, 1.5]) {
+ await zoom(factor);
+ await page.waitForTimeout(400);
+ const actual = await page.evaluate(() => ({
+ innerWidth,
+ innerHeight,
+ outerWidth,
+ outerHeight,
+ dpr: devicePixelRatio,
+ }));
+ const configured = await settings.evaluate(
+ () => new Promise((resolve) => chrome.settingsPrivate.getDefaultZoom(resolve)),
+ );
+ assert.equal(configured, factor);
+ const supported = actual.innerWidth >= 1280 && actual.innerHeight >= 640;
+ const prompt = page.getByRole("dialog", { name: "工作区已暂停", exact: true });
+ if (supported) {
+ assert.equal(await prompt.count(), 0);
+ for (const name of ["确认保存描述", "取消编辑", "完成任务并提交质检", "切回原布局"])
+ assert.ok(
+ await button(name).evaluate((e) => {
+ const r = e.getBoundingClientRect();
+ return (
+ r.x >= 0 &&
+ r.y >= 0 &&
+ r.right <= innerWidth &&
+ r.bottom <= innerHeight &&
+ e.contains(document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2))
+ );
+ }),
+ );
+ assert.ok(
+ await page.evaluate(
+ () =>
+ document.documentElement.scrollHeight <= innerHeight &&
+ document.documentElement.scrollWidth <= innerWidth,
+ ),
+ );
+ } else {
+ await prompt.waitFor();
+ assert.ok(await page.locator("video").evaluateAll((vs) => vs.every((v) => v.paused)));
+ assert.ok(await button("继续当前工作").isDisabled());
+ }
+ results.push({
+ requestedWindow: [width, height],
+ zoom: factor,
+ ...actual,
+ behavior: supported ? "normal" : "paused",
+ });
+ console.log("PASS", JSON.stringify(results.at(-1)));
+ }
+ const wasSmall = results.at(-1).behavior === "paused";
+ await zoom(1);
+ await page.waitForTimeout(300);
+ if (wasSmall) {
+ assert.ok(await page.getByRole("dialog", { name: "工作区已暂停" }).isVisible());
+ await button("继续当前工作").click();
+ }
+ assert.equal(await input.inputValue(), "缩放验收未保存草稿");
+ assert.equal(writes.length, 0);
+ } finally {
+ await zoom(1);
+ await context.close();
+ }
+}
+writeFileSync(`${root}/task08-zoom-matrix.json`, JSON.stringify(results, null, 2));
diff --git a/tests/frontend/capture-responsive-layout.test.mjs b/tests/frontend/capture-responsive-layout.test.mjs
index 1e4df1c5..1224303d 100644
--- a/tests/frontend/capture-responsive-layout.test.mjs
+++ b/tests/frontend/capture-responsive-layout.test.mjs
@@ -6,7 +6,6 @@ const read = (path) => fs.readFileSync(new URL(`../../${path}`, import.meta.url)
const page = read("src/pages/AnnotationOperations.tsx");
const workbench = read("src/components/CaptureAnnotationWorkbench.tsx");
const css = read("src/styles/capture-workspace.css");
-const dictionary = read("src/components/SliceNameDictionaryPicker.tsx");
test("adaptive layout is opt-in for annotation slicing, not a global role redesign", () => {
assert.match(page, /workspaceMode === "annotate" && tab === "queue" && combinedEditorPhase === "slice"/);
@@ -35,14 +34,3 @@ test("responsive changes do not remount media or alter timeline calculations", (
assert.match(workbench, /stepFrameBoundary\(frameBoundaries, currentTime, direction\)/);
assert.match(workbench, /onSliceBoundaryChange\?\.\(current.id, "end", next\)/);
});
-
-test("dictionary escapes the scroller without losing pointer or keyboard ownership", () => {
- assert.match(workbench, /portal=\{adaptiveLayout && phase === "slice"\}/);
- assert.match(dictionary, /createPortal\(popup, document.body\)/);
- assert.match(dictionary, /!root.current\?\.contains[^\n]*!popupRef.current\?\.contains/);
- assert.match(dictionary, /dictionaryKeyDown\(event, close\)/);
- assert.match(dictionary, /data-dictionary-open=\{\(open && !disabled\) \|\| undefined\}/);
- assert.match(workbench, /\[data-dictionary-open='true'\]/);
- assert.match(dictionary, /window.removeEventListener\("resize", place\)/);
- assert.match(dictionary, /window.removeEventListener\("scroll", place, true\)/);
-});