diff --git a/e2e/console-ui.spec.ts b/e2e/console-ui.spec.ts index e2bb2e4b8..a7ea3aa80 100644 --- a/e2e/console-ui.spec.ts +++ b/e2e/console-ui.spec.ts @@ -30,7 +30,7 @@ for (const kind of ["run", "debug", "services-run", "services-debug", "stacktrac component = SessionPanel; props = { session: run.useRun.getState().sessions.find((s: { id: string }) => s.id === id), - ...(kind === "services-run" ? { onRerun: null, onDebug: null } : {}), + showLifecycle: kind === "run", }; } else if (kind === "debug" || kind === "services-debug") { const statePath = "/src/features/debugger/state.ts"; diff --git a/e2e/run.spec.ts b/e2e/run.spec.ts index 5369b435a..0d6edf708 100644 --- a/e2e/run.spec.ts +++ b/e2e/run.spec.ts @@ -81,6 +81,39 @@ test("⌘F2 stops a running process", async ({ workbench: page }) => { await expect(run.getByRole("tab", { name: "dev" })).toHaveAttribute("data-tooltip", /exit code 143$/); }); +test("a short Run pane has room for the full toolbar above the output", async ({ workbench: page }) => { + await page.setViewportSize({ width: 400, height: 500 }); + const output = "Watching for changes…"; + await stubRun(page, [{ kind: "stdout", text: `${output}\n` }], null); + await page.keyboard.press("Control+r"); + const run = page.getByRole("region", { name: "Run", exact: true }); + await expect(run.getByText(output)).toBeVisible(); + await page.evaluate(async () => { + const path = "/src/workbench/toolwindows/store.ts"; + const { setToolWindowSize } = await import(/* @vite-ignore */ path); + setToolWindowSize("bottom", 160); + }); + const toolbar = run.getByRole("toolbar", { name: "Run actions" }); + const clipped = await toolbar.evaluate((el) => { + const bar = el.getBoundingClientRect(); + return Array.from(el.querySelectorAll("button")).flatMap((button) => { + const box = button.getBoundingClientRect(); + return box.left < bar.left - 1 || box.right > bar.right + 1 || box.bottom > bar.bottom + 1 + ? [button.getAttribute("aria-label")] + : []; + }); + }); + expect(clipped).toEqual([]); + await expect(toolbar).toHaveAttribute("aria-orientation", "horizontal"); + const toolbarBox = (await toolbar.boundingBox())!; + const consoleBox = (await run.getByRole("log").boundingBox())!; + expect(consoleBox.y).toBeGreaterThanOrEqual(toolbarBox.y + toolbarBox.height - 1); + await toolbar.getByRole("button", { name: "Clear All" }).click(); + await expect(run.getByText(output)).toBeHidden(); + await toolbar.getByRole("button", { name: "Stop" }).click(); + await expect.poll(() => ipcCalls(page, "run_stop")).toEqual([{ id: RUN_ID }]); +}); + test("Go reruns keep each package's exact failures and the original configuration", async ({ workbench: page }) => { await stubDesktop(page); await page.evaluate(async () => { diff --git a/src/features/run/Run.module.css b/src/features/run/Run.module.css index 42d540838..7a25c9a1a 100644 --- a/src/features/run/Run.module.css +++ b/src/features/run/Run.module.css @@ -51,6 +51,10 @@ min-width: 0; } +.topToolbarSession { + flex-direction: column; +} + .toolbar { flex: none; width: 32px; @@ -69,12 +73,36 @@ .toolbar::-webkit-scrollbar { display: none; } -.toolbarSep { +.toolbarGroup { + display: flex; + flex: none; + flex-direction: inherit; + align-items: center; + gap: var(--space-0-5); + max-width: 100%; +} +.toolbarGroup + .toolbarGroup::before { + content: ""; width: 16px; height: 1px; margin: 3px 0; background: var(--border-strong); } +.topToolbarSession .toolbar { + width: auto; + flex-direction: row; + flex-wrap: wrap; + gap: var(--space-0-5) var(--space-2); + padding: var(--space-0-5) var(--space-1); + border-right: none; + border-bottom: 1px solid var(--border); +} +.topToolbarSession .toolbarGroup { + flex-wrap: wrap; +} +.topToolbarSession .toolbarGroup::before { + display: none; +} .sessionBody { flex: 1; diff --git a/src/features/run/RunView.tsx b/src/features/run/RunView.tsx index faade49bd..eb77d7a7a 100644 --- a/src/features/run/RunView.tsx +++ b/src/features/run/RunView.tsx @@ -1,4 +1,5 @@ import { useEffect, useMemo, useRef, useState } from "react"; +import clsx from "clsx"; import type { RunConfig } from "@/platform/ipc"; import type { RunTargetValid } from "@/platform/remoteSettings"; import { useAgentRunSettings, useWorkflowSettings } from "@/platform/workflowSettings"; @@ -181,10 +182,15 @@ export function SessionPanel({ ); return ( -