Align web editor with Blender 5.2 interface
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

This commit is contained in:
mes123456
2026-09-07 18:11:57 +08:00
parent 70721187c0
commit 98cebd381a
6 changed files with 154 additions and 83 deletions

View File

@@ -47,4 +47,41 @@ test.describe("M7-14 responsive layout", () => {
expect(report.rootScrollWidth, JSON.stringify(report)).toBeLessThanOrEqual(report.viewportWidth);
});
}
test("desktop mirrors Blender 5.2 Layout workspace regions", async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 });
await page.goto("/");
await expect(page.getByTestId("engine-status")).toContainText("ready, open a .blend file", { timeout: 20_000 });
await expect(page.locator(".workspace-tab")).toHaveText([
"Layout", "Modeling", "Sculpting", "UV Editing", "Texture Paint", "Shading",
"Animation", "Rendering", "Compositing", "Geometry Nodes", "Scripting",
]);
const geometry = await page.evaluate(() => {
const rect = (selector: string) => {
const bounds = document.querySelector<HTMLElement>(selector)?.getBoundingClientRect();
if (!bounds) throw new Error(`Missing ${selector}`);
return { x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height, bottom: bounds.bottom };
};
const propertyTabs = document.querySelector<HTMLElement>(".property-tabs");
return {
viewport: rect(".viewport-area"),
outliner: rect(".outliner-area"),
properties: rect(".properties-area"),
timeline: rect(".timeline-area"),
status: rect(".status-bar"),
propertyTabsDirection: propertyTabs ? getComputedStyle(propertyTabs).flexDirection : "missing",
};
});
expect(geometry.viewport.width / 1440).toBeGreaterThan(0.75);
expect(geometry.outliner.x).toBeCloseTo(geometry.viewport.width + 1, 0);
expect(geometry.outliner.height).toBeLessThan(geometry.properties.height);
expect(geometry.properties.bottom).toBeCloseTo(geometry.status.y, 0);
expect(geometry.timeline.x).toBe(0);
expect(geometry.timeline.width).toBeCloseTo(geometry.viewport.width, 0);
expect(geometry.timeline.height).toBeGreaterThanOrEqual(96);
expect(geometry.timeline.height).toBeLessThanOrEqual(120);
expect(geometry.propertyTabsDirection).toBe("column");
});
});