chore: checkpoint web Blender migration source, tools and docs
Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
42
tools/web/.probe56.mjs
Normal file
42
tools/web/.probe56.mjs
Normal file
@@ -0,0 +1,42 @@
|
||||
import { createRequire } from "node:module";
|
||||
import path from "node:path";
|
||||
const { chromium } = createRequire(import.meta.url)(path.resolve("web/node_modules/playwright"));
|
||||
const browser = await chromium.launch({ headless: true, executablePath: "/usr/bin/google-chrome-stable",
|
||||
args: ["--no-sandbox","--use-gl=swiftshader","--enable-unsafe-swiftshader","--enable-unsafe-webgpu","--enable-dawn-features=allow_unsafe_apis","--use-webgpu-adapter=swiftshader"] });
|
||||
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
||||
const page = await ctx.newPage();
|
||||
await page.goto("http://127.0.0.1:5412/?ui=web", { waitUntil: "domcontentloaded" });
|
||||
await page.waitForFunction(() => document.body.innerText.includes("WASM ABI: ready"), undefined, { timeout: 120000 });
|
||||
await page.getByTestId("blend-file-input").setInputFiles(path.resolve("tests/files/web/hierarchy_simplify_combined.blend"));
|
||||
await page.waitForFunction(() => /SceneIR r\d+/.test(document.querySelector('[data-testid="engine-status"]')?.textContent ?? ""), undefined, { timeout: 120000 });
|
||||
await page.waitForTimeout(3000);
|
||||
for (const name of ['Parts','Mount','RootRig']) {
|
||||
const btn = page.getByRole('button', { name: `展开 ${name}`, exact: true }).first();
|
||||
if (await btn.count()) { await btn.click(); await page.waitForTimeout(2200); }
|
||||
}
|
||||
// select Mount and KeyLight, then drag both onto NewParent
|
||||
await page.evaluate(() => {
|
||||
const find = (n) => [...document.querySelectorAll('[role="treeitem"]')].find(x => (x.getAttribute('aria-label')||'').trim() === n);
|
||||
find('Mount')?.querySelector('.tree-node-name')?.dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
||||
});
|
||||
await page.waitForTimeout(2000);
|
||||
await page.evaluate(() => {
|
||||
const find = (n) => [...document.querySelectorAll('[role="treeitem"]')].find(x => (x.getAttribute('aria-label')||'').trim() === n);
|
||||
find('KeyLight')?.querySelector('.tree-node-name')?.dispatchEvent(new MouseEvent('click', { bubbles: true, ctrlKey: true }));
|
||||
});
|
||||
await page.waitForTimeout(2000);
|
||||
console.log("SELECTED", await page.evaluate(() => document.querySelector('main')?.getAttribute('data-selected-object-ids')));
|
||||
const drag = await page.evaluate(() => {
|
||||
const find = (n) => [...document.querySelectorAll('[role="treeitem"]')].find(x => (x.getAttribute('aria-label')||'').trim() === n);
|
||||
const src = [...document.querySelectorAll('[role="treeitem"]')].find(x => (x.getAttribute('aria-label')||'').trim() === 'Mount');
|
||||
const dst = find('NewParent'); const dt = new DataTransfer();
|
||||
src.dispatchEvent(new DragEvent('dragstart', { bubbles: true, cancelable: true, dataTransfer: dt }));
|
||||
dst.dispatchEvent(new DragEvent('dragover', { bubbles: true, cancelable: true, dataTransfer: dt }));
|
||||
dst.dispatchEvent(new DragEvent('drop', { bubbles: true, cancelable: true, dataTransfer: dt }));
|
||||
return dt.getData('application/x-web-blender-objects');
|
||||
});
|
||||
console.log("PAYLOAD", drag);
|
||||
await page.waitForTimeout(9000);
|
||||
console.log("TREE", await page.evaluate(() => [...document.querySelectorAll('[role="treeitem"]')].map(n => `${n.getAttribute('aria-level')}:${(n.getAttribute('aria-label')||'').trim()}`).filter(x => !x.endsWith(':')).join(" | ")));
|
||||
console.log("ENGINE", await page.evaluate(() => document.querySelector('[data-testid="engine-status"]')?.textContent));
|
||||
await browser.close();
|
||||
Reference in New Issue
Block a user