fix: use long press for mobile task actions (#1673)

This commit is contained in:
Carlos Florêncio
2026-07-13 13:56:55 +01:00
committed by GitHub
parent 892ce9bf09
commit c4dd45f9ac
3 changed files with 82 additions and 4 deletions
@@ -40,7 +40,21 @@ test.describe("Mobile sidebar — external link menu", () => {
hasText: "Mobile external link task",
});
await expect(taskRow).toBeVisible({ timeout: 10_000 });
await taskRow.getByRole("button", { name: "Task actions" }).click();
await taskRow.dispatchEvent("pointerdown", {
pointerType: "touch",
isPrimary: true,
button: 0,
clientX: 120,
clientY: 240,
});
await testPage.waitForTimeout(1000);
await taskRow.dispatchEvent("pointerup", {
pointerType: "touch",
isPrimary: true,
button: 0,
clientX: 120,
clientY: 240,
});
const linkTrigger = testPage.getByRole("menuitem", { name: /^Link$/ });
await expect(linkTrigger).toBeVisible();
@@ -0,0 +1,60 @@
import { test, expect } from "../../fixtures/test-base";
import { SessionPage } from "../../pages/session-page";
test.describe("Mobile sidebar task actions", () => {
test("opens task actions on long press without covering diff stats", async ({
testPage,
apiClient,
seedData,
}) => {
const taskTitle = "Mobile task with diff stats";
const task = await apiClient.createTaskWithAgent(
seedData.workspaceId,
taskTitle,
seedData.agentProfileId,
{
description: "/e2e:diff-update-setup",
workflow_id: seedData.workflowId,
workflow_step_id: seedData.startStepId,
repository_ids: [seedData.repositoryId],
executor_profile_id: seedData.worktreeExecutorProfileId,
},
);
await testPage.goto(`/t/${task.id}`);
const session = new SessionPage(testPage);
await session.waitForLoad();
await expect(
session.chat.getByText("diff-update-setup complete", { exact: false }),
).toBeVisible({
timeout: 60_000,
});
await testPage.getByTestId("mobile-session-menu").click();
const sheet = testPage.getByRole("dialog");
const taskRow = sheet.getByTestId("sidebar-task-item").filter({ hasText: taskTitle });
const diffStats = taskRow.getByTestId("sidebar-task-diff-stats");
const actions = taskRow.getByRole("button", { name: "Task actions" });
await expect(diffStats).toBeVisible({ timeout: 15_000 });
await expect(actions).toBeHidden();
await taskRow.dispatchEvent("pointerdown", {
pointerType: "touch",
isPrimary: true,
button: 0,
clientX: 120,
clientY: 240,
});
await testPage.waitForTimeout(1000);
await taskRow.dispatchEvent("pointerup", {
pointerType: "touch",
isPrimary: true,
button: 0,
clientX: 120,
clientY: 240,
});
await expect(testPage.getByRole("menuitem", { name: "Archive" })).toBeVisible();
});
});