From 4027b8341f943ed0e282faf6cde240ead408eb48 Mon Sep 17 00:00:00 2001 From: Isaac Gallart Date: Wed, 2 Dec 2026 10:41:13 +0100 Subject: [PATCH] fix(run): keep configuration fields aligned when resizing on Linux (#7470) Fixes #7469. On Linux, WebKitGTK shifts the tracks of the scrolling options subgrid as the Run/Debug Configurations dialog resizes, moving fields away from the Name column. There the header and the options now share a fixed 150px label column instead of a subgrid; macOS and Windows keep the subgrid whose label column fits the longest label, and narrow panes keep the stacked layout. Co-authored-by: igallart <13520529+igallart@users.noreply.github.com> --- e2e/runConfigLayout.spec.ts | 47 +++++++++++++++++++++++++++++++++ src/features/run/Run.module.css | 13 +++++++++ 2 files changed, 60 insertions(+) diff --git a/e2e/runConfigLayout.spec.ts b/e2e/runConfigLayout.spec.ts index 709955c3ac..42dcada9e8 100644 --- a/e2e/runConfigLayout.spec.ts +++ b/e2e/runConfigLayout.spec.ts @@ -297,6 +297,53 @@ test("run configuration fields share a control column including the name", async expect(boxes[0]!.width).toBeGreaterThan(80); }); +test("on Linux, Python configuration fields stay aligned with long arguments when resizing", async ({ + workbench: page, +}) => { + const args = '-c "conf/development settings.conf" -d DEMO_DEVELOPMENT -u demo_module --log-level debug'; + await page.evaluate(async (args) => { + // WebKitGTK's subgrid tracks shift with a scrollbar (#7469): Linux has its own fixed label column. + document.documentElement.dataset.os = "linux"; + const store = "/src/features/run/store.ts"; + const types = "/src/features/run/types.ts"; + const { useRun } = await import(/* @vite-ignore */ store); + const { newConfigOfType, typeFor, withParams } = await import(/* @vite-ignore */ types); + const type = typeFor("python")!; + const base = newConfigOfType(type, []); + const config = withParams( + { ...base, name: "Python demo", target: "development", env: { APP_ENV: "development" } }, + { ...base.params, script: "src/main.py", args }, + type, + ); + useRun.setState({ configs: [config], selectedId: config.id, loaded: true, editorOpen: true }); + }, args); + + const dialog = page.getByRole("dialog", { name: "Run/Debug Configurations", exact: true }); + const content = dialog.locator("#run-config-content"); + const argumentField = dialog.getByRole("textbox", { name: "Arguments", exact: true }); + const fields = ["Name", "Arguments", "Working directory", "Environment variables"].map((name) => + dialog.getByRole("textbox", { name, exact: true }), + ); + for (const field of fields) await expect(field).toBeVisible(); + await expect(argumentField).toHaveValue(args); + const initial = (await content.boundingBox())!; + const argumentsBeforeResize = (await argumentField.boundingBox())!; + const offset = argumentsBeforeResize.x - initial.x; + + const grip = (await dialog.getByRole("separator", { name: "Resize", exact: true }).boundingBox())!; + await page.mouse.move(grip.x + grip.width / 2, grip.y + grip.height / 2); + await page.mouse.down(); + await page.mouse.move(grip.x - 160, grip.y - 180, { steps: 5 }); + await page.mouse.up(); + + const resized = (await content.boundingBox())!; + expect(resized.width).toBeLessThan(initial.width); + expect((await argumentField.boundingBox())!.width).toBeLessThan(argumentsBeforeResize.width); + const boxes = await Promise.all(fields.map((field) => field.boundingBox())); + for (const box of boxes) expect(box!.x - resized.x).toBeCloseTo(offset, 0); + await expect(argumentField).toHaveValue(args); +}); + test("resizing the configuration dialog grows its panes and keeps the footer visible", async ({ workbench: page }) => { await openConfigurations(page); const dialog = page.getByRole("dialog", { name: "Run/Debug Configurations", exact: true }); diff --git a/src/features/run/Run.module.css b/src/features/run/Run.module.css index c7fc269593..18dbf4cf7f 100644 --- a/src/features/run/Run.module.css +++ b/src/features/run/Run.module.css @@ -735,6 +735,16 @@ .formHeader > .field { grid-column: 1 / -1; } +/* WebKitGTK shifts the tracks of a scrolling subgrid as the dialog resizes (#7469): on Linux the + header and the options share a fixed label column instead. */ +html[data-os="linux"] .configFields { + --run-config-columns: 150px minmax(0, 1fr); + grid-template-columns: var(--run-config-columns); +} +html[data-os="linux"] .formSettings { + grid-template-columns: var(--run-config-columns); + column-gap: var(--space-3); +} .editFormTomcat { overflow: hidden; } @@ -1174,6 +1184,9 @@ } @container run-config-content (max-width: 360px) { + html[data-os="linux"] .configFields { + --run-config-columns: minmax(0, 1fr); + } .configFields, .editForm > .field { grid-template-columns: minmax(0, 1fr);