feat(web): Outliner deletes objects from the keymap and the Data menu
The desktop Outliner binds outliner.delete to X and Del and also carries it in the context/Data menu; the web data menu only offered rename and Remap Users. Both entries now run the existing deleteObject edit for the object row under the cursor or keyboard focus, so the deletion travels through the same native Main transaction as the viewport delete. The headed case [outliner-delete-web] deletes one object with X and one through the Data menu entry, checking the native row set shrinks and the labels disappear; receipt OUTLINER-HEADED-20261130-082221 (NOT_CLAIMED, 9/9). Collection rows still lack Delete Hierarchy, which stays queued. The armature panel regression keeps failing identically at HEAD and is tracked as pre-existing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -321,6 +321,32 @@ test.describe("Outliner headed baseline", () => {
|
||||
await expect.poll(selectedObjects, { timeout: 15_000 }).toBe(0);
|
||||
});
|
||||
|
||||
test("[outliner-delete-web] X and the Data menu delete objects through the native Main", async ({ page }) => {
|
||||
test.setTimeout(150_000);
|
||||
await openWorkbench(page);
|
||||
const objectRows = page.locator('.outliner-tree .tree-row[data-node-id]:not([data-node-id=""])');
|
||||
await expect.poll(() => objectRows.count(), { timeout: 20_000 }).toBeGreaterThan(0);
|
||||
const before = await objectRows.count();
|
||||
|
||||
/* Desktop keymap binds outliner.delete to X (and Del); the focused row is
|
||||
* the deletion target. */
|
||||
const lastRow = objectRows.last();
|
||||
const label = (await lastRow.getAttribute("aria-label"))!;
|
||||
await lastRow.locator('.tree-node-name').click();
|
||||
await expect.poll(async () => page.locator('.outliner-tree [role="treeitem"]:focus').count(), { timeout: 15_000 }).toBe(1);
|
||||
await page.keyboard.press("x");
|
||||
await expect.poll(() => objectRows.count(), { timeout: 15_000 }).toBe(before - 1);
|
||||
await expect(page.locator(`.outliner-tree [role="treeitem"][aria-label="${label}"]`)).toHaveCount(0);
|
||||
|
||||
/* The Data menu carries the same OUTLINER_OT_delete entry. */
|
||||
const nextRow = objectRows.first();
|
||||
const menuLabel = (await nextRow.getAttribute("aria-label"))!;
|
||||
await nextRow.locator('.tree-node-name').click({ button: "right" });
|
||||
await page.getByRole("menuitem", { name: "删除 (X)", exact: true }).click();
|
||||
await expect.poll(() => objectRows.count(), { timeout: 15_000 }).toBe(before - 2);
|
||||
await expect(page.locator(`.outliner-tree [role="treeitem"][aria-label="${menuLabel}"]`)).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("[outliner-mirror-baseline-web] the desktop mirror hands the Outliner to the DOM workspace", async ({ page }) => {
|
||||
test.setTimeout(120_000);
|
||||
await page.goto("/");
|
||||
|
||||
Reference in New Issue
Block a user