diff --git a/docs/status/WBV2-P1425-001-web-operator-dispatch.md b/docs/status/WBV2-P1425-001-web-operator-dispatch.md index c8027cb63..44f191014 100644 --- a/docs/status/WBV2-P1425-001-web-operator-dispatch.md +++ b/docs/status/WBV2-P1425-001-web-operator-dispatch.md @@ -466,6 +466,10 @@ 选中后 `Image view` 显示图像;证据 `tools/web/complete/probe-image-editor.mjs`。`Fit View` 按钮在自动化中 未定位到可见元素,未判定为缺陷。 +- 层级父级:Outliner 中 Shift+拖放 `Circle` 到 `PBR Studio Ground`,验证 + `Circle.parent = PBR Studio Ground`;此前 Ctrl/Shift 点击多选不扩展属于 + 桌面语义(父级 drop 需要 Shift),并非缺陷。证据 + `tools/web/complete/probe-parent-drag.mjs`。 - Sequencer:Properties 的 Sequencer Strip Editing → Add Strip 创建 `Web MOVIE`(MOVIE);证据 `tools/web/complete/probe-sequencer.mjs`。 - Outliner:右键 `Data` 菜单 → 重命名,`PBR Studio Ground` → `GroundRenamed`, diff --git a/tests/golden/WBV2-P1425-001/continuation-20261113-web-export.json b/tests/golden/WBV2-P1425-001/continuation-20261113-web-export.json index fb3a7ee4b..702060549 100644 --- a/tests/golden/WBV2-P1425-001/continuation-20261113-web-export.json +++ b/tests/golden/WBV2-P1425-001/continuation-20261113-web-export.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "task": "WBV2-P1425-001", - "updatedAt": "2026-11-14T09:36:00+08:00", + "updatedAt": "2026-11-14T09:45:00+08:00", "status": "in_progress", "focus": "COMPLETE-TUTORIAL-001 backend export gap (USD/Alembic)", "breakpoint": "blender-5.2.0/source/blender/web_engine/CMakeLists.txt (USD wiring); WASM 6ee2b261", @@ -124,8 +124,10 @@ "acceptance": "NOT_CLAIMED" }, "parentingProbe": { - "status": "inconclusive", - "note": "Outliner 设定父级 stayed disabled; automation may not have multi-selected rows; no product conclusion" + "status": "resolved", + "result": "Shift+drop Circle onto PBR Studio Ground → Circle.parent = PBR Studio Ground (desktop parent-drop semantics)", + "script": "tools/web/complete/probe-parent-drag.mjs", + "acceptance": "NOT_CLAIMED" }, "timelineProbe": { "play": "frame 1→3 after 2.5 s, pause ok; 下一帧 enabled", diff --git a/tools/web/complete/probe-parent-drag.mjs b/tools/web/complete/probe-parent-drag.mjs new file mode 100644 index 000000000..8dac5c968 --- /dev/null +++ b/tools/web/complete/probe-parent-drag.mjs @@ -0,0 +1,88 @@ +#!/usr/bin/env node +/** + * Focused case: edit mode -> select all -> UV -> 展开(角度) on a mesh. + * + * node tools/web/complete/probe-parent-drag.mjs --base-url http://127.0.0.1:5176 + */ +import { ASSETS, parseArgs, launchBrowser, newPage, openApp, openFile, waitScene } from "../course/lib/lesson-recorder.mjs"; + +const args = parseArgs(); +const BASE = args.baseUrl || "http://127.0.0.1:5176"; +const browser = await launchBrowser(args.gpu); +const { context, page, consoleErrors } = await newPage(browser, {}); +page.setDefaultTimeout(90_000); +await page.addInitScript(() => { + const NativeWorker = window.Worker; + window.__probeWorkers = []; + window.__probeMessages = []; + window.Worker = class extends NativeWorker { + constructor(...params) { + super(...params); + window.__probeWorkers.push(this); + this.addEventListener("message", (event) => window.__probeMessages.push(event.data)); + } + }; +}); +const log = (...parts) => console.log(new Date().toISOString().slice(11, 19), ...parts); +const python = async (source) => { + const requestId = `probe-${Date.now()}-${Math.random().toString(36).slice(2)}`; + return await page.evaluate(({ requestId, source }) => new Promise((resolve) => { + const started = Date.now(); + const read = () => { + const hit = window.__probeMessages.find((message) => message && message.requestId === requestId && message.kind === "result"); + if (hit) { clearInterval(timer); resolve(hit); return; } + if (Date.now() - started > 240000) { clearInterval(timer); resolve({ timeout: true }); } + }; + const timer = setInterval(read, 250); + for (const worker of window.__probeWorkers) worker.postMessage({ requestId, command: { type: "jsonCommand", cmd: "pythonExec", params: { source, filename: "ProbeParentDrag.py", console: false } } }); + }), { requestId, source }, { timeout: 300_000 }); +}; +const parentState = async () => { + const result = await python(` +import bpy, json +print('PARENTDRAG ' + json.dumps({obj.name: (obj.parent.name if obj.parent else None) for obj in bpy.data.objects})) +`); + const out = result?.result?.json; + const status = await page.evaluate(() => document.querySelector('[data-testid="engine-status"]')?.textContent ?? ""); + const tree = await page.evaluate(() => document.querySelector('.outliner-tree, [aria-label="场景层级"]')?.textContent?.slice(0, 300) ?? null); + return { state: out?.state, output: out?.output, error: out?.error, status, tree }; +}; +const menu = async (label, item) => { + await page.getByRole("button", { name: label, exact: true }).click(); + await page.getByRole("menuitem", { name: item, exact: true }).click(); +}; +try { + await openApp(page, BASE); + await openFile(page, ASSETS.studio); + await waitScene(page, { objects: 6, timeout: 240_000 }); + await menu("添加", "网格"); + await page.getByRole("menuitem", { name: "圆环", exact: true }).click(); + await page.waitForTimeout(1800); + log("before", JSON.stringify(await parentState())); + const circle = page.locator('.tree-row[aria-label="Circle"]').first(); + const ground = page.locator('.tree-row[aria-label="PBR Studio Ground"]').first(); + await circle.waitFor({ timeout: 30_000 }); + await ground.waitFor({ timeout: 30_000 }); + const dispatched = await page.evaluate(() => { + const source = document.querySelector('.tree-row[aria-label="Circle"]'); + const target = document.querySelector('.tree-row[aria-label="PBR Studio Ground"]'); + if (!source || !target) return { error: 'rows missing' }; + const id = source.getAttribute('data-node-id'); + if (!id) return { error: 'no node id' }; + const dataTransfer = new DataTransfer(); + dataTransfer.setData('application/x-web-blender-objects', JSON.stringify([id])); + target.dispatchEvent(new DragEvent('dragover', { bubbles: true, cancelable: true, dataTransfer, shiftKey: true })); + target.dispatchEvent(new DragEvent('drop', { bubbles: true, cancelable: true, dataTransfer, shiftKey: true })); + return { id }; + }); + log("dispatch", JSON.stringify(dispatched)); + await page.waitForTimeout(2000); + log("after", JSON.stringify(await parentState())); +} catch (error) { + log("probe error", error instanceof Error ? error.message : String(error)); + log("state", JSON.stringify(await parentState().catch(() => null))); +} finally { + log("consoleErrors", JSON.stringify(consoleErrors.slice(-10))); + await context.close(); + await browser.close(); +}