дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 17:21:13 +02:00
Main toolbar items get a 10px pitch and the dropdowns 10/6px insets with a 16px chevron; stripe buttons get 5px padding on both sides; the status bar is 34px with 4px widget hover insets, its breadcrumbs lifted 5px, and the islands keep a 3px inset above it. Language Services moves after the caret position in the status bar. Compact mode keeps its previous metrics. Fixed-viewport e2e layouts (commit checks, project tree second click, main toolbar label compression next to the New Agent Task button) get room for the wider gaps and the taller status bar. Co-authored-by: wildcatDownstairs <[email protected]>
49 рядки
2.1 KiB
TypeScript
49 рядки
2.1 KiB
TypeScript
import { expect, test } from "./fixtures";
|
|
|
|
/** Heights IDEA's Islands theme uses in compact mode (`*.compact` keys), against the defaults. */
|
|
const SIZES = {
|
|
normal: { titleBar: 40, treeRow: 24, stripeIcon: 20, statusBar: 34, runButton: 30 },
|
|
compact: { titleBar: 32, treeRow: 22, stripeIcon: 16, statusBar: 24, runButton: 26 },
|
|
};
|
|
|
|
async function measure(page: import("@playwright/test").Page) {
|
|
return page.evaluate(() => {
|
|
const height = (selector: string) => document.querySelector(selector)?.getBoundingClientRect().height ?? null;
|
|
return {
|
|
titleBar: height("header"),
|
|
treeRow: height('[role="tree"][aria-label="Project"] [role="treeitem"]'),
|
|
stripeIcon: height("[data-stripe-button] svg"),
|
|
statusBar: height('footer[aria-label="Status bar"]'),
|
|
runButton: height("[data-run-chooser] + * button"),
|
|
};
|
|
});
|
|
}
|
|
|
|
test("Compact Mode shrinks rows, toolbars, stripes and the status bar like IDEA", async ({ workbench: page }, info) => {
|
|
// Plain-browser mode has no settings backend: set what the toggle action would store.
|
|
const setCompact = (compactMode: boolean) =>
|
|
page.evaluate(async (compactMode) => {
|
|
const projectPath = "/src/platform/project.ts";
|
|
const { useProject } = await import(/* @vite-ignore */ projectPath);
|
|
const settings = useProject.getState().settings;
|
|
useProject.setState({
|
|
settings: {
|
|
...settings,
|
|
appearance: { ...settings?.appearance, theme: "dark", syncWithOs: false, compactMode },
|
|
},
|
|
});
|
|
}, compactMode);
|
|
|
|
await setCompact(false);
|
|
await expect.poll(() => measure(page)).toEqual(SIZES.normal);
|
|
await info.attach("normal", { body: await page.screenshot({ animations: "disabled" }), contentType: "image/png" });
|
|
|
|
await setCompact(true);
|
|
await expect(page.locator("html")).toHaveAttribute("data-compact", "");
|
|
await expect.poll(() => measure(page)).toEqual(SIZES.compact);
|
|
await info.attach("compact", { body: await page.screenshot({ animations: "disabled" }), contentType: "image/png" });
|
|
|
|
await setCompact(false);
|
|
await expect.poll(() => measure(page)).toEqual(SIZES.normal);
|
|
});
|