fix(web): fold description into opts to keep seedTask under param limit

`seedTask` had 6 parameters, violating the repo's 5-parameter cap and
failing CI lint. Fold `description` into the existing `opts` object and
update all callsites.
This commit is contained in:
José Almeida
2026-04-24 11:41:53 +01:00
parent 6a7d7391c1
commit 7152b93659
6 changed files with 71 additions and 158 deletions
@@ -12,13 +12,9 @@ test.describe("@search panel-focus routing", () => {
seedData,
}) => {
test.setTimeout(120_000);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"focus-routing-session",
seedMessagesDescription(["alpha"]),
);
const { session } = await seedTask(testPage, apiClient, seedData, "focus-routing-session", {
description: seedMessagesDescription(["alpha"]),
});
await expect(session.chat.getByText("alpha", { exact: false }).first()).toBeVisible({
timeout: 30_000,
});
@@ -37,13 +33,9 @@ test.describe("@search panel-focus routing", () => {
seedData,
}) => {
test.setTimeout(120_000);
await seedTask(
testPage,
apiClient,
seedData,
"focus-routing-terminal",
seedMessagesDescription(["alpha"]),
);
await seedTask(testPage, apiClient, seedData, "focus-routing-terminal", {
description: seedMessagesDescription(["alpha"]),
});
// Ensure terminal panel is mounted
await expect(testPage.getByTestId("terminal-panel")).toBeVisible({ timeout: 15_000 });
@@ -63,13 +55,9 @@ test.describe("@search panel-focus routing", () => {
seedData,
}) => {
test.setTimeout(120_000);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"focus-routing-plan",
planScript("## Plan\nsome content here"),
);
const { session } = await seedTask(testPage, apiClient, seedData, "focus-routing-plan", {
description: planScript("## Plan\nsome content here"),
});
await session.togglePlanMode();
await expect(session.planPanel.locator(".ProseMirror")).toBeVisible({ timeout: 15_000 });
@@ -32,13 +32,9 @@ test.describe("@search panel search bar — shared contract", () => {
kind === "plan"
? planScript("## Scratch\nnothing special here")
: seedMessagesDescription(["hello world alpha", "hello world beta"]);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
`shared-${kind}-S1`,
description,
);
const { session } = await seedTask(testPage, apiClient, seedData, `shared-${kind}-S1`, {
description: description,
});
await preparePanel(session, kind, testPage);
await openPanelSearch(testPage, kind);
@@ -53,13 +49,9 @@ test.describe("@search panel search bar — shared contract", () => {
test.setTimeout(90_000);
const description =
kind === "plan" ? planScript("## Scratch\nnothing") : seedMessagesDescription(["hello"]);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
`shared-${kind}-S3`,
description,
);
const { session } = await seedTask(testPage, apiClient, seedData, `shared-${kind}-S3`, {
description: description,
});
await preparePanel(session, kind, testPage);
await openPanelSearch(testPage, kind);
@@ -71,13 +63,9 @@ test.describe("@search panel search bar — shared contract", () => {
test.setTimeout(90_000);
const description =
kind === "plan" ? planScript("## Scratch\ntext") : seedMessagesDescription(["foo"]);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
`shared-${kind}-S4`,
description,
);
const { session } = await seedTask(testPage, apiClient, seedData, `shared-${kind}-S4`, {
description: description,
});
await preparePanel(session, kind, testPage);
await openPanelSearch(testPage, kind);
@@ -93,13 +81,9 @@ test.describe("@search panel search bar — shared contract", () => {
kind === "plan"
? planScript("## Sample\nAlphaBetaGamma")
: seedMessagesDescription(["AlphaBetaGamma"]);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
`shared-${kind}-S5`,
description,
);
const { session } = await seedTask(testPage, apiClient, seedData, `shared-${kind}-S5`, {
description: description,
});
await preparePanel(session, kind, testPage);
await openPanelSearch(testPage, kind);
+12 -28
View File
@@ -45,13 +45,9 @@ test.describe("@search plan panel search", () => {
prCapture,
}) => {
test.setTimeout(120_000);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"plan-search-basic",
planScript(PLAN_CONTENT),
);
const { session } = await seedTask(testPage, apiClient, seedData, "plan-search-basic", {
description: planScript(PLAN_CONTENT),
});
await openPlanPanel(testPage, session);
await openPanelSearch(testPage, "plan");
@@ -80,13 +76,9 @@ test.describe("@search plan panel search", () => {
seedData,
}) => {
test.setTimeout(120_000);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"plan-search-nav",
planScript(PLAN_CONTENT),
);
const { session } = await seedTask(testPage, apiClient, seedData, "plan-search-nav", {
description: planScript(PLAN_CONTENT),
});
await openPlanPanel(testPage, session);
await openPanelSearch(testPage, "plan");
@@ -129,13 +121,9 @@ test.describe("@search plan panel search", () => {
test("P9 Close removes all highlights", async ({ testPage, apiClient, seedData }) => {
test.setTimeout(120_000);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"plan-search-close",
planScript(PLAN_CONTENT),
);
const { session } = await seedTask(testPage, apiClient, seedData, "plan-search-close", {
description: planScript(PLAN_CONTENT),
});
await openPlanPanel(testPage, session);
await openPanelSearch(testPage, "plan");
@@ -157,13 +145,9 @@ test.describe("@search plan panel search", () => {
seedData,
}) => {
test.setTimeout(120_000);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"plan-search-toggles",
planScript(PLAN_CONTENT),
);
const { session } = await seedTask(testPage, apiClient, seedData, "plan-search-toggles", {
description: planScript(PLAN_CONTENT),
});
await openPlanPanel(testPage, session);
await openPanelSearch(testPage, "plan");
@@ -21,13 +21,9 @@ test.describe("@search session chat panel search", () => {
"this line has no match",
"third fox appearance here",
];
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"session-search-hits",
seedMessagesDescription(messages),
);
const { session } = await seedTask(testPage, apiClient, seedData, "session-search-hits", {
description: seedMessagesDescription(messages),
});
// Wait for at least one agent message to have rendered
await expect(session.chat.getByText("fox", { exact: false }).first()).toBeVisible({
timeout: 30_000,
@@ -50,13 +46,9 @@ test.describe("@search session chat panel search", () => {
test("C2 unmatched query shows No matches", async ({ testPage, apiClient, seedData }) => {
test.setTimeout(120_000);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"session-search-nomatch",
seedMessagesDescription(["hello world"]),
);
const { session } = await seedTask(testPage, apiClient, seedData, "session-search-nomatch", {
description: seedMessagesDescription(["hello world"]),
});
await expect(session.chat.getByText("hello world", { exact: false }).first()).toBeVisible({
timeout: 30_000,
});
@@ -83,13 +75,9 @@ test.describe("@search session chat panel search", () => {
lines.push(`line ${i} padding text`);
}
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"session-search-scroll",
seedMessagesDescription(lines),
);
const { session } = await seedTask(testPage, apiClient, seedData, "session-search-scroll", {
description: seedMessagesDescription(lines),
});
await expect(session.chat.getByText("padding text", { exact: false }).first()).toBeVisible({
timeout: 60_000,
});
@@ -148,13 +136,9 @@ test.describe("@search session chat panel search", () => {
.toBe(true);
// Now open task A and search for B's marker — should return no hits.
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"session-search-iso-A",
seedMessagesDescription([`hello with ${uniqueA} embedded`]),
);
const { session } = await seedTask(testPage, apiClient, seedData, "session-search-iso-A", {
description: seedMessagesDescription([`hello with ${uniqueA} embedded`]),
});
await expect(session.chat.getByText(uniqueA, { exact: false }).first()).toBeVisible({
timeout: 30_000,
});
@@ -171,13 +155,9 @@ test.describe("@search session chat panel search", () => {
test("C10 close button clears the bar", async ({ testPage, apiClient, seedData }) => {
test.setTimeout(120_000);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"session-search-close",
seedMessagesDescription(["foo"]),
);
const { session } = await seedTask(testPage, apiClient, seedData, "session-search-close", {
description: seedMessagesDescription(["foo"]),
});
await expect(session.chat.getByText("foo", { exact: false }).first()).toBeVisible({
timeout: 30_000,
});
@@ -195,14 +175,12 @@ test.describe("@search session chat panel search", () => {
seedData,
}) => {
test.setTimeout(120_000);
const { session } = await seedTask(
testPage,
apiClient,
seedData,
"session-search-virtuoso",
seedMessagesDescription(["virtuoso fox alpha", "virtuoso fox beta"]),
{ rendererOverride: "virtuoso" },
);
const { session } = await seedTask(testPage, apiClient, seedData, "session-search-virtuoso", {
description: {
description: seedMessagesDescription(["virtuoso fox alpha", "virtuoso fox beta"]),
rendererOverride: "virtuoso",
},
});
await expect(session.chat.getByText("virtuoso", { exact: false }).first()).toBeVisible({
timeout: 30_000,
});
+2 -3
View File
@@ -13,15 +13,14 @@ export async function seedTask(
apiClient: ApiClient,
seedData: SeedData,
title: string,
description: string,
opts: { rendererOverride?: "native" | "virtuoso" } = {},
opts: { description: string; rendererOverride?: "native" | "virtuoso" },
): Promise<{ session: SessionPage; taskId: string; sessionId: string }> {
const task = await apiClient.createTaskWithAgent(
seedData.workspaceId,
title,
seedData.agentProfileId,
{
description,
description: opts.description,
workflow_id: seedData.workflowId,
workflow_step_id: seedData.startStepId,
repository_ids: [seedData.repositoryId],
@@ -64,13 +64,9 @@ test.describe("@search terminal panel search", () => {
prCapture,
}) => {
test.setTimeout(120_000);
await seedTask(
testPage,
apiClient,
seedData,
"terminal-search-basic",
seedMessagesDescription(["idle"]),
);
await seedTask(testPage, apiClient, seedData, "terminal-search-basic", {
description: seedMessagesDescription(["idle"]),
});
await seedTerminalOutput(testPage);
const bufferBefore = await testPage.evaluate(() => {
@@ -106,13 +102,9 @@ test.describe("@search terminal panel search", () => {
test("T4 case sensitivity toggle affects matches", async ({ testPage, apiClient, seedData }) => {
test.setTimeout(120_000);
await seedTask(
testPage,
apiClient,
seedData,
"terminal-search-case",
seedMessagesDescription(["idle"]),
);
await seedTask(testPage, apiClient, seedData, "terminal-search-case", {
description: seedMessagesDescription(["idle"]),
});
await seedTerminalOutput(testPage);
await openPanelSearch(testPage, "terminal");
@@ -138,13 +130,9 @@ test.describe("@search terminal panel search", () => {
seedData,
}) => {
test.setTimeout(120_000);
await seedTask(
testPage,
apiClient,
seedData,
"terminal-search-regex",
seedMessagesDescription(["idle"]),
);
await seedTask(testPage, apiClient, seedData, "terminal-search-regex", {
description: seedMessagesDescription(["idle"]),
});
await seedTerminalOutput(testPage);
await openPanelSearch(testPage, "terminal");
@@ -170,13 +158,9 @@ test.describe("@search terminal panel search", () => {
seedData,
}) => {
test.setTimeout(120_000);
await seedTask(
testPage,
apiClient,
seedData,
"terminal-search-esc",
seedMessagesDescription(["idle"]),
);
await seedTask(testPage, apiClient, seedData, "terminal-search-esc", {
description: seedMessagesDescription(["idle"]),
});
await seedTerminalOutput(testPage);
// Capture buffer snapshot before opening search
@@ -202,13 +186,9 @@ test.describe("@search terminal panel search", () => {
seedData,
}) => {
test.setTimeout(120_000);
await seedTask(
testPage,
apiClient,
seedData,
"terminal-search-backspace",
seedMessagesDescription(["idle"]),
);
await seedTask(testPage, apiClient, seedData, "terminal-search-backspace", {
description: seedMessagesDescription(["idle"]),
});
await seedTerminalOutput(testPage);
await openPanelSearch(testPage, "terminal");