test(web): lock edit-mode island detection for INDIVIDUAL_ORIGINS
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

the INDIVIDUAL_ORIGINS modal and commit rely on selectionIslands splitting the
selected vertices into connected components. cover it with node:test against
the transpiled module: two disconnected cubes produce two islands with their
own centres, a single-cube selection is one island, and a partial selection
keeps only the selected vertices.

driving the transform modal keys in a headed probe did not work (canvas focus
and menu state interference), so the per-island rotation headed case remains
open and is recorded in the inventory.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-12-06 16:20:43 +08:00
parent cd9b1019eb
commit c4be807726
2 changed files with 61 additions and 1 deletions

View File

@@ -15,7 +15,7 @@
| 1 | ~~大工程打开后视口输入未就绪~~(已修复) | `glowing-petting-map.md`(`WBV2-COLLADA-001` 残余 1) | 根因:open 期间/之前的同步命令超时使客户端判定 Main 不确定,帧被拒绝且画布终止;测试的 `exposeWebTools()` 切到 Web 视图进一步造成“需额外输入”的假象。已修:只读命令超时不判定不确定、Main 恢复等待重试、owner 变更帧计入就绪、按 revision 发布场景与几何(响应从 1888 个 transfer 降到小负载)。有头回归用例在原生视图内无输入恢复就绪并通过(约 2.4 分钟) | 已关闭;保留用例防止回归,验收仍 `NOT_CLAIMED` |
| 2 | 渲染课程成片缺失:`rendering-lesson-720p.mp4` 已撤回,未重录 | `binary-dreaming-ladybug.md`;`RENDER_PATHS_20261116` 残余 4 | 旧片 1477.8 s 与 `timeline.json` 13 章只覆盖到 1125 s 不符而撤回;`check-render-tutorial.mjs` 现输出 `AWAITING_RERECORD` | 按现有章节重录并重新混音,跑 `check-render-tutorial.mjs` 到非 `AWAITING_RERECORD`;保持 `NOT_CLAIMED` |
| 3 | 满尺寸场景 undo/redo 超出单例窗口:YT2 `setObjectOrigin` 后 undo/redo 在 185 s 内未完成 | `glowing-petting-map.md`(残余 4) | 两次尝试均被上限终止;小场景同一路径 PASS(`attempt-OFrAEc`) | 评估 13 MB Main + 236 网格的历史重建耗时;先量化再决定预算或增量恢复;单独开批次 |
| 4 | 视口语义残余:`INDIVIDUAL_ORIGINS` 中位点回退;元素点选不同步 BMesh | `mossy-giggling-moonbeam.md`;`VIEWPORT-NAV_20261125` 残余 | **元素点选已修**:点选/框选/全选现在经 `executeEmbeddedPython` 写入编辑模式 BMesh(与 `select_mode`、读回同一路径)。有头验证:进入编辑模式后点击顶点,原生选择 8 顶点→2 顶点。`INDIVIDUAL_ORIGINS` 的多岛变换路径已在 `useViewportTransformModal`/提交路径实现(islands>1 时逐岛矩阵);gizmo 手柄仍显示中位点,且编辑模式原生用例仍未覆盖,保留待验证 | 下一步:按需把选择写入改为专用原生命令以降低每次点击开销;补编辑模式 INDIVIDUAL_ORIGINS 的 gizmo 显示/有头用例;P1 |
| 4 | 视口语义残余:`INDIVIDUAL_ORIGINS` 中位点回退;元素点选不同步 BMesh | `mossy-giggling-moonbeam.md`;`VIEWPORT-NAV_20261125` 残余 | **元素点选已修**:点选/框选/全选现在经 `executeEmbeddedPython` 写入编辑模式 BMesh(与 `select_mode`、读回同一路径)。有头验证:进入编辑模式后点击顶点,原生选择 8 顶点→2 顶点。`INDIVIDUAL_ORIGINS` 的多岛变换路径已在 `useViewportTransformModal`/提交路径实现(islands>1 时逐岛矩阵);gizmo 手柄仍显示中位点,且编辑模式原生用例仍未覆盖,保留待验证 | 岛检测已由单元测试锁定(`web/tests/unit/mesh-element-islands.test.mjs`:双立方体→两岛且各自中心正确、单岛、部分岛)。有头驱动变换模态的按键在探针中未能生效(画布焦点/菜单状态干扰),逐岛旋转的有头用例仍待补;下一步:改用 gizmo 拖拽或操作搜索驱动模态做有头验证;把选择写入改为专用原生命令以降低每次点击开销;P1 |
| 5 | `REVISION_CONFLICT` 的 Worker 采纳未做 | `serialized-cooking-map.md`(Workstream 2) | 计划明示“本批不改 `web-engine.worker.ts`”,采纳需先改 AOV/lightgroup 构造器并协调 `editShaderNode` 契约与既有 e2e | 单独立项;先补构造器契约,再切换 Worker 断言,最后跑既有 e2e |
| 6 | 手册 E2E 与截图内容人工审阅未做 | `serialized-waddling-sutherland.md`;`RENDER_PATHS_20261116` 残余 5 | `generate-manual.mjs` PASS、31 章无缺图;`web/app/public/manuals` 已生成 HTML + 4 个 PDF | 跑手册 E2E/链接检查,人工过一遍截图;不达项回写文档 |
| 7 | 完成度评估器与 IO 门禁基线不一致:`evaluate-wbv2-completion.mjs` 被 `coverage-baseline.mjs:47` 阻断;`check-io-format-ui-gate.mjs` 报 registry 未在能力矩阵声明 | `glowing-petting-map.md`(残余 2、5) | 均与用例执行无关,属仓库既有基线不一致;`git diff` 为空 | 修 `coverage-baseline` 的 historical references 结构;对齐 IO registry 与 `M12-05B` 能力矩阵;再重跑评估 |

View File

@@ -0,0 +1,60 @@
import assert from "node:assert/strict";
import fs from "node:fs";
import path from "node:path";
import test from "node:test";
import ts from "typescript";
const repoRoot = path.resolve(import.meta.dirname, "../../..");
const sourcePath = path.join(repoRoot, "web/app/src/three-adapter/mesh-element-transform.ts");
const transpiled = ts.transpileModule(fs.readFileSync(sourcePath, "utf8"), {
compilerOptions: { module: ts.ModuleKind.ES2022, target: ts.ScriptTarget.ES2022 },
fileName: sourcePath,
reportDiagnostics: true,
});
assert.deepEqual(transpiled.diagnostics, []);
const moduleUrl = "data:text/javascript;base64," + Buffer.from(transpiled.outputText).toString("base64");
const { selectionIslands } = await import(moduleUrl);
/* Two disconnected unit cubes centred at (-2,0,0) and (+2,0,0). */
function twoCubeGeometry() {
const positions = [];
for (const cx of [-2, 2]) {
for (let index = 0; index < 8; index += 1) {
positions.push(cx + ((index & 1) ? 0.5 : -0.5), (index & 2) ? 0.5 : -0.5, (index & 4) ? 0.5 : -0.5);
}
}
const edges = [];
for (const offset of [0, 8]) {
for (let index = 0; index < 8; index += 1) {
for (const bit of [1, 2, 4]) {
if ((index & bit) === 0) edges.push(offset + index, offset + (index | bit));
}
}
}
return { positions, edgeVertexIndices: edges };
}
test("two disconnected cubes split into two islands with their own centres", () => {
const geometry = twoCubeGeometry();
const islands = selectionIslands([...Array(16).keys()], geometry);
assert.equal(islands.length, 2);
assert.deepEqual(islands.map((island) => island.vertexIndices.length).sort(), [8, 8]);
const centres = islands.map((island) => island.center[0]).sort((a, b) => a - b);
assert.ok(Math.abs(centres[0] + 2) < 1e-6, `first centre ${centres[0]}`);
assert.ok(Math.abs(centres[1] - 2) < 1e-6, `second centre ${centres[1]}`);
});
test("a single-cube selection is one island centred on that cube", () => {
const geometry = twoCubeGeometry();
const islands = selectionIslands([...Array(8).keys()], geometry);
assert.equal(islands.length, 1);
assert.equal(islands[0].vertexIndices.length, 8);
assert.ok(Math.abs(islands[0].center[0] + 2) < 1e-6, `centre ${islands[0].center[0]}`);
});
test("a partial island keeps only the selected vertices", () => {
const geometry = twoCubeGeometry();
const islands = selectionIslands([0, 1, 2], geometry);
assert.equal(islands.length, 1);
assert.deepEqual(islands[0].vertexIndices, [0, 1, 2]);
});