From 233c58547d4d12ba2f00dccf2a9b8a5ff88f96ac Mon Sep 17 00:00:00 2001 From: "exe.dev user" Date: Sat, 10 Oct 2026 22:00:52 +0000 Subject: [PATCH 1/3] Fix stable run table column widths --- packages/app/src/features/runs/history.tsx | 6 +++--- packages/app/src/features/runs/list.tsx | 2 +- packages/app/src/shared/ui.tsx | 2 +- packages/app/test/jobs.browser.test.mjs | 2 ++ packages/app/test/runs.browser.test.mjs | 18 ++++++++++++++++++ 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/packages/app/src/features/runs/history.tsx b/packages/app/src/features/runs/history.tsx index 278f7cef..121210b5 100644 --- a/packages/app/src/features/runs/history.tsx +++ b/packages/app/src/features/runs/history.tsx @@ -18,12 +18,12 @@ export function RunHistory({ jobId }: { jobId: string }) { const sortLabel = (column: HistorySort) => search.sort === column ? (search.direction === "desc" ? "sorted descending" : "sorted ascending") : "not sorted"; return
{runs.isPending &&

Loading run history…

}{runs.error &&

{runs.error.message}

} - {runs.data && <> + {runs.data && <>
Job runs{search.sort ? "" : ", newest first"}
{columns.map(([column, label]) => sortColumn(column)} />)}{runs.data.items.map(run => - + - + )}{runs.data.items.length === 0 && }
Job runs{search.sort ? "" : ", newest first"}
{run.run_name || run.issue_title || "Run"}{run.run_name || run.issue_title || "Run"} {run.agent_kind}{run.agent_kind}
No runs found.
} ; return
{runs.isPending &&

Loading runs…

}{runs.error &&

{runs.error.message}

} - {runs.data && <>{runs.data.items.length === 0 && jobId ?
No runs found.
: runs.data.items.length === 0 ?

No runs yet

: {sortableHeader("status", "Status")}{sortableHeader("job", "Job name")}{sortableHeader("run", "Run")}{sortableHeader("created", "Created")}{runs.data.items.map(run => )}
Runs{search.sort ? "" : ", newest first"}
{run.job_name}{run.run_name || "Run"}
}} + {runs.data && <>{runs.data.items.length === 0 && jobId ?
No runs found.
: runs.data.items.length === 0 ?

No runs yet

: {sortableHeader("status", "Status")}{sortableHeader("job", "Job name")}{sortableHeader("run", "Run")}{sortableHeader("created", "Created")}{runs.data.items.map(run => )}
Runs{search.sort ? "" : ", newest first"}
{run.job_name}{run.run_name || "Run"}
}} {pagination}
; } diff --git a/packages/app/src/shared/ui.tsx b/packages/app/src/shared/ui.tsx index 0c1ebff2..57359316 100644 --- a/packages/app/src/shared/ui.tsx +++ b/packages/app/src/shared/ui.tsx @@ -10,7 +10,7 @@ export const tableHeadClasses = "bg-stone-100 text-xs font-semibold text-slate-6 export const tableRowClasses = "group relative border-t border-stone-200 transition-colors hover:bg-factorize-50 focus-within:bg-factorize-50 focus-within:shadow-[inset_3px_0_0_var(--color-factorize-500)] dark:border-slate-800 dark:hover:bg-factorize-500/10 dark:focus-within:bg-factorize-500/10"; export const tableCellClasses = "px-2 py-2 sm:px-3"; export function Table({ className = "", children, shellProps, ...props }: ComponentProps<"table"> & { shellProps?: ComponentProps<"div"> }) { - return
{children}
; + return
{children}
; } export function SortableHeader({ label, active = false, direction = "asc", onSort, className = "", ariaLabel = label }: { label: string; active?: boolean; direction?: "asc" | "desc"; onSort: () => void; className?: string; ariaLabel?: string }) { const order = active ? (direction === "desc" ? "descending" : "ascending") : "none"; diff --git a/packages/app/test/jobs.browser.test.mjs b/packages/app/test/jobs.browser.test.mjs index 8036ef77..99c34424 100644 --- a/packages/app/test/jobs.browser.test.mjs +++ b/packages/app/test/jobs.browser.test.mjs @@ -303,8 +303,10 @@ test("run table headers sort every column accessibly and persist in the URL", as await table.getByRole("columnheader").nth(0).getByRole("button").waitFor(); for (const index of [0, 1, 2, 3]) assert.equal(await table.getByRole("columnheader").nth(index).getByRole("button").count(), 1); const runHeader = table.getByRole("button", { name: /Run, not sorted/ }); + const widths = await table.locator("thead th").evaluateAll(cells => cells.map(cell => Math.round(cell.getBoundingClientRect().width))); await runHeader.focus(); await page.keyboard.press("Enter"); await page.waitForURL(`**/jobs/${jobId}?sort=run&direction=asc`); assert.equal(await table.getByRole("columnheader", { name: /Run/ }).getAttribute("aria-sort"), "ascending"); + assert.deepEqual(await table.locator("thead th").evaluateAll(cells => cells.map(cell => Math.round(cell.getBoundingClientRect().width))), widths); await table.getByRole("button", { name: /Run, sorted ascending/ }).click(); await page.waitForURL(`**/jobs/${jobId}?sort=run&direction=desc`); assert.equal(requests.at(-1).searchParams.get("direction"), "desc"); await context.close(); diff --git a/packages/app/test/runs.browser.test.mjs b/packages/app/test/runs.browser.test.mjs index 5d3307ed..ecf13f22 100644 --- a/packages/app/test/runs.browser.test.mjs +++ b/packages/app/test/runs.browser.test.mjs @@ -32,6 +32,24 @@ test("all-runs table sorts its data columns with accessible headers", async () = assert.equal(await table.getByRole("columnheader", { name: /Created/ }).getAttribute("aria-sort"), "descending"); await context.close(); }); +test("all-runs columns keep their widths when sorting changes content", async () => { + const { context, page } = await setup(); + const shortRuns = [{ id: runId, run_name: "Run", state: "succeeded", created_at: time, updated_at: time, started_at: null, agent_kind: "codex" }]; + const longRuns = [{ id: runId, run_name: "A very long run name that should stay inside its assigned column", state: "succeeded", created_at: time, updated_at: time, started_at: null, agent_kind: "codex" }]; + await page.route("**/api/v1/runs?**", route => { + const url = new URL(route.request().url()); + return route.fulfill({ json: { items: url.searchParams.get("sort") === "run" ? longRuns : shortRuns, nextCursor: null } }); + }); + for (const viewport of [{ width: 1280, height: 800 }, { width: 390, height: 844 }]) { + await page.setViewportSize(viewport); await page.goto(origin + "/job-runs"); + const table = page.getByRole("table"); + const widths = await table.locator("thead th").evaluateAll(cells => cells.map(cell => Math.round(cell.getBoundingClientRect().width))); + await table.getByRole("button", { name: /Run, not sorted/ }).click(); await page.waitForURL("**/job-runs?sort=run&direction=asc"); + const sortedWidths = await table.locator("thead th").evaluateAll(cells => cells.map(cell => Math.round(cell.getBoundingClientRect().width))); + assert.deepEqual(sortedWidths, widths); assert.equal(await table.locator("a").first().evaluate(link => getComputedStyle(link).textOverflow), "ellipsis"); + } + await context.close(); +}); test("shared run status dots show running transitions in both tables", async () => { const { context, page } = await setup(); let state = "running"; await page.route(`**/api/v1/jobs/${jobId}`, route => route.fulfill({ json: { id: jobId, name: "Job", enabled: true, model: "", agentKind: "codex", concurrencyLimit: 1, runningCount: state === "running" ? 1 : 0, promptTemplate: "Prompt", triggers: [] } })); From 5c2f102a2ce86e076ffeeac108efc14f9049ff06 Mon Sep 17 00:00:00 2001 From: "exe.dev user" Date: Sat, 10 Oct 2026 22:07:46 +0000 Subject: [PATCH 2/3] test(app): wait for runs table before measuring widths --- packages/app/test/runs.browser.test.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/app/test/runs.browser.test.mjs b/packages/app/test/runs.browser.test.mjs index ecf13f22..ccd9b234 100644 --- a/packages/app/test/runs.browser.test.mjs +++ b/packages/app/test/runs.browser.test.mjs @@ -43,6 +43,7 @@ test("all-runs columns keep their widths when sorting changes content", async () for (const viewport of [{ width: 1280, height: 800 }, { width: 390, height: 844 }]) { await page.setViewportSize(viewport); await page.goto(origin + "/job-runs"); const table = page.getByRole("table"); + await table.getByRole("columnheader", { name: /Run/ }).waitFor(); const widths = await table.locator("thead th").evaluateAll(cells => cells.map(cell => Math.round(cell.getBoundingClientRect().width))); await table.getByRole("button", { name: /Run, not sorted/ }).click(); await page.waitForURL("**/job-runs?sort=run&direction=asc"); const sortedWidths = await table.locator("thead th").evaluateAll(cells => cells.map(cell => Math.round(cell.getBoundingClientRect().width))); From 91434eef510237a3887a352285e6b05a67a28fca Mon Sep 17 00:00:00 2001 From: "exe.dev user" Date: Sat, 10 Oct 2026 22:13:16 +0000 Subject: [PATCH 3/3] test(app): update run history column expectations --- packages/app/test/jobs.browser.test.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/app/test/jobs.browser.test.mjs b/packages/app/test/jobs.browser.test.mjs index 5a201fde..90f16623 100644 --- a/packages/app/test/jobs.browser.test.mjs +++ b/packages/app/test/jobs.browser.test.mjs @@ -301,9 +301,9 @@ test("run table headers sort every column accessibly and persist in the URL", as await page.goto(origin + `/jobs/${jobId}`); const table = page.getByRole("table"); await table.getByRole("columnheader").nth(0).getByRole("button").waitFor(); - assert.deepEqual(await table.locator("thead th").allTextContents(), ["Status", "Run", "Created"]); - assert.equal(await table.getByRole("columnheader", { name: /Agent/ }).count(), 0); - for (const index of [0, 1, 2]) assert.equal(await table.getByRole("columnheader").nth(index).getByRole("button").count(), 1); + assert.deepEqual(await table.locator("thead th").allTextContents(), ["Run", "Status", "Created", "Agent"]); + assert.equal(await table.getByRole("columnheader", { name: /Agent/ }).count(), 1); + for (const index of [0, 1, 2, 3]) assert.equal(await table.getByRole("columnheader").nth(index).getByRole("button").count(), 1); const runButton = page.getByRole("button", { name: "Run job", exact: true }), optionsButton = page.getByRole("button", { name: "More run options", exact: true }); const runBox = await runButton.boundingBox(), optionsBox = await optionsButton.boundingBox(); assert.equal(runBox.x + runBox.width, optionsBox.x);