feat(web): Outliner rows draw the desktop library and override markers
- Engine rows carry libraryIcon mirroring ui::icon_from_library (DIRECT, INDIRECT, PACKAGE, PACKAGE_INDIRECT, BROKEN, OVERRIDE, OVERRIDE_NONEDITABLE, ASSET), limited to the element types desktop draws markers for (TSE_ID_BASE rows in Unused Data carry no ID pointer). - The protocol decodes libraryIcon and maps empty markers to null; rows render the badge after the name with an accessible label. - New headed case [outliner-linked-icons-web]; full headed suite 46/46, validator PASS. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -1925,4 +1925,45 @@ test.describe("Outliner headed baseline", () => {
|
||||
expect(collectionSequence).not.toContain("删除 (X)");
|
||||
expect(collectionSequence).not.toContain("选择 (Select)");
|
||||
});
|
||||
|
||||
test("[outliner-linked-icons-web] rows draw the desktop link and override markers", async ({ page }) => {
|
||||
test.setTimeout(300_000);
|
||||
await page.goto("/?ui=web");
|
||||
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 });
|
||||
|
||||
/* The Current File object is a local library override:
|
||||
* ICON_LIBRARY_DATA_OVERRIDE. */
|
||||
const overrideRow = page.locator('li[role="treeitem"]:has(> .tree-row[aria-label="M12 Override Object"])').first();
|
||||
await expect(overrideRow).toBeVisible({ timeout: 30_000 });
|
||||
await expect(overrideRow.locator('[aria-label="库覆盖数据"]')).toHaveCount(1, { timeout: 20_000 });
|
||||
|
||||
/* Blender File mode: the original under its library is a direct link
|
||||
* (ICON_LIBRARY_DATA_DIRECT). */
|
||||
const modeSelect = page.locator('select[aria-label="大纲显示模式"]').first();
|
||||
await modeSelect.selectOption("LIBRARIES");
|
||||
const libraryRow = page.locator('.tree-row[aria-label*="m12_override_source"]').first();
|
||||
await expect(libraryRow).toBeVisible({ timeout: 60_000 });
|
||||
const libraryItem = page.locator('li[role="treeitem"]:has(> .tree-row[aria-label*="m12_override_source"])').first();
|
||||
const libraryToggle = libraryRow.locator(".tree-expand").first();
|
||||
if (await libraryToggle.count() && ((await libraryToggle.getAttribute("aria-label")) ?? "").startsWith("展开")) await libraryToggle.click();
|
||||
const objectsGroup = libraryItem.locator('.tree-row[aria-label="Objects"]').first();
|
||||
await expect(objectsGroup).toHaveCount(1, { timeout: 30_000 });
|
||||
const objectsToggle = objectsGroup.locator(".tree-expand").first();
|
||||
if (await objectsToggle.count() && ((await objectsToggle.getAttribute("aria-label")) ?? "").startsWith("展开")) await objectsToggle.click();
|
||||
const linkedRow = libraryItem.locator('.tree-row[aria-label="M12 Override Object"]').first();
|
||||
await expect(linkedRow).toBeVisible({ timeout: 30_000 });
|
||||
await expect(linkedRow.locator('[aria-label="直接链接数据"]')).toHaveCount(1, { timeout: 20_000 });
|
||||
/* The local override keeps its editable badge; the two markers are distinct. */
|
||||
await expect(linkedRow.locator('[aria-label="库覆盖数据"]')).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user