feat(web): Outliner Data menu exposes the library override Troubleshoot operations

Desktop OUTLINER_MT_liboverride draws Make/Reset/Clear, a separator, then a
Troubleshoot enum menu (space_outliner.py) that runs
OUTLINER_OT_liboverride_troubleshoot_operation with selection_set=SELECTED:
Resync / Resync Enforce | Delete. Override rows now get the same submenu; the
web entry dispatches OUTLINER_LIBOVERRIDE_TROUBLESHOOT to the engine, which
sets the desktop type enum and executes the native operator in the outliner
context, reporting 已重同步库覆盖 / 已强制重同步库覆盖 / 已删除库覆盖层级.

Verified: headed [outliner-liboverride-troubleshoot-web] plus the full
Outliner headed suite 41/41, check-outliner-headed PASS, and the
outliner-treeview-production regression. armature-editor-coverage-ui still
fails only on the pre-existing PoseConstraintArmatureObject row timeout.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-12-01 14:13:57 +08:00
parent 0ec223e2a1
commit 32d9f000f2
12 changed files with 176 additions and 14 deletions

View File

@@ -1571,4 +1571,56 @@ test.describe("Outliner headed baseline", () => {
if (await objectsToggle.count() && ((await objectsToggle.getAttribute("aria-label")) ?? "").startsWith("展开")) await objectsToggle.click();
await expect(groupItem.locator('.tree-row[aria-label="M12 Link Object"]')).toHaveCount(1, { timeout: 30_000 });
});
test("[outliner-liboverride-troubleshoot-web] the Data menu runs the library override Troubleshoot operations", async ({ page }) => {
test.setTimeout(300_000);
await page.goto("/?ui=web");
const status = page.locator('[data-testid="engine-status"]');
await page.locator('[data-testid="blend-file-input"]').setInputFiles(LIBRARY_TARGET);
const libraryPath = page.locator('input[aria-label="原始库路径 1"]');
await expect(libraryPath).toBeVisible({ timeout: 60_000 });
if (!(await libraryPath.inputValue()).trim()) await libraryPath.fill(LIBRARY_SOURCE_PATH);
await page.locator('input[aria-label="恢复库文件 1"]').setInputFiles(LIBRARY_SOURCE);
await page.getByRole("button", { name: "读取候选 / 重试打开" }).click();
await expect(libraryPath).toHaveCount(0, { timeout: 120_000 });
await expect(page.getByText(/Engine: SceneIR/).first()).toBeVisible({ timeout: 60_000 });
const webTools = page.locator('[data-testid="native-web-tools-toggle"]');
if (await webTools.count()) await webTools.click();
await expect(page.locator(".outliner-tree").first()).toBeVisible({ timeout: 20_000 });
const modeSelect = page.locator('select[aria-label="大纲显示模式"]').first();
await expect(modeSelect).toBeVisible({ timeout: 20_000 });
await modeSelect.selectOption("LIBRARIES");
const openGroup = async (label: string) => {
const group = page.locator(`.tree-row[aria-label="${label}"]`).first();
await expect(group).toBeVisible({ timeout: 30_000 });
const toggle = group.locator(".tree-expand").first();
if (await toggle.count() && ((await toggle.getAttribute("aria-label")) ?? "").startsWith("展开")) await toggle.click();
};
await openGroup("Current File");
await openGroup("Objects");
const overrideRow = page.locator('li[role="treeitem"]:has(> .tree-row[aria-label="Current File"]) .tree-row[aria-label="M12 Override Object"]').first();
await expect(overrideRow).toBeVisible({ timeout: 30_000 });
/* Desktop OUTLINER_MT_liboverride ends with Troubleshoot:
* Resync | Resync Enforce | separator | Delete. */
await overrideRow.locator(".tree-node-name").first().click({ button: "right" });
const troubleshoot = page.getByRole("menuitem", { name: "库覆盖排查 (Troubleshoot)", exact: true });
await expect(troubleshoot).toHaveCount(1, { timeout: 15_000 });
await troubleshoot.click();
for (const label of ["重同步 (Resync)", "重同步(强制)(Resync Enforce)", "删除 (Delete)"]) {
await expect(page.getByRole("menuitem", { name: label, exact: true })).toHaveCount(1, { timeout: 15_000 });
}
await page.getByRole("menuitem", { name: "重同步 (Resync)", exact: true }).click();
await expect(status).toContainText("已重同步库覆盖", { timeout: 30_000 });
await expect(overrideRow).toBeVisible({ timeout: 30_000 });
/* Delete removes the override hierarchy and relinks the usage to the
* linked data-block, so the Current File object row disappears. */
await overrideRow.locator(".tree-node-name").first().click({ button: "right" });
await page.getByRole("menuitem", { name: "库覆盖排查 (Troubleshoot)", exact: true }).click();
await page.getByRole("menuitem", { name: "删除 (Delete)", exact: true }).click();
await expect(status).toContainText("已删除库覆盖层级", { timeout: 30_000 });
await expect(overrideRow).toHaveCount(0, { timeout: 30_000 });
});
});