diff --git a/doc/PRODUCT.md b/doc/PRODUCT.md index 983c0f6b5e2..13cc4b36c7b 100644 --- a/doc/PRODUCT.md +++ b/doc/PRODUCT.md @@ -126,6 +126,8 @@ completed tasks remain eligible. Opening a recent task moves its row to the top of Recents. Standard Recents also shows recent chats and projects. +The Coordinator sidebar pins **Plugins** above **More** by default. Users can +unpin it there and pin it again from **More**. The browser remembers their choice. Coordinator Recents lets you pin tasks, agent chats, and projects above More. The pin button appears on the current row or when a row is hovered or focused with the keyboard. Shortcuts share the saved order with pinned pages and stay diff --git a/tests/e2e/agentmail.spec.ts b/tests/e2e/agentmail.spec.ts index 8bfdba7edbd..faf7cd820c3 100644 --- a/tests/e2e/agentmail.spec.ts +++ b/tests/e2e/agentmail.spec.ts @@ -260,8 +260,7 @@ test("AgentMail setup and email work through the normal task conversation", asyn await expect(page.getByText("Internal server error", { exact: true })).toHaveCount(0); await expect(page.getByRole("heading", { name: "Your agent’s email is ready" })).toHaveCount(0); await page.screenshot({ path: test.info().outputPath("agentmail-permission-denied.png"), fullPage: true }); - await page.getByRole("button", { name: "More workspace pages", exact: true }).click(); - await page.getByRole("link", { name: "Plugins", exact: true }).click(); + await page.getByRole("navigation", { name: "Workspace navigation" }).getByRole("link", { name: "Plugins", exact: true }).click(); // Installed lists plugins as tiles; account rows, including one waiting on setup, are on the plugin page. await page.getByRole("radio", { name: "Installed", exact: true }).click(); await page.locator('[data-app-slug="agentmail"] h3 button').click(); diff --git a/tests/e2e/plugins-browse.spec.ts b/tests/e2e/plugins-browse.spec.ts index a429dbb1bd6..c04e2ba0de7 100644 --- a/tests/e2e/plugins-browse.spec.ts +++ b/tests/e2e/plugins-browse.spec.ts @@ -1,5 +1,32 @@ import { expect, test } from "@playwright/test"; +test("Plugins is pinned on first visit and remembers unpinning and re-pinning", async ({ page, request }) => { + const response = await request.post("/api/companies", { data: { name: `plugin pins ${Date.now()}` } }); + expect(response.ok()).toBe(true); + const company = await response.json(); + const navigation = page.getByRole("navigation", { name: "Workspace navigation" }); + const plugins = navigation.getByRole("link", { name: "Plugins", exact: true }); + try { + await page.goto(`/${company.issuePrefix}/issues`); + await expect(plugins).toBeVisible(); + await expect(plugins).toHaveAttribute("href", `/${company.issuePrefix}/apps`); + await plugins.hover(); + await navigation.getByRole("button", { name: "Unpin Plugins" }).click(); + await expect(plugins).toHaveCount(0); + + await page.reload(); + await navigation.getByRole("button", { name: "More workspace pages" }).click(); + const pin = page.getByRole("button", { name: "Pin Plugins", exact: true }); + await expect(pin).toBeEnabled(); + await expect(plugins).toHaveCount(0); + await pin.click(); + await page.reload(); + await expect(plugins).toBeVisible(); + } finally { + await request.delete(`/api/companies/${company.id}`); + } +}); + test("browse shows capped category blocks that open a full category page", async ({ page, request }) => { const res = await request.post("/api/companies", { data: { name: `plugins browse ${Date.now()}` } }); expect(res.ok(), `create company failed ${res.status()}: ${await res.text()}`).toBe(true); diff --git a/ui/src/hooks/usePinnedNavigation.ts b/ui/src/hooks/usePinnedNavigation.ts index 662c7dd6ba2..294215df6b5 100644 --- a/ui/src/hooks/usePinnedNavigation.ts +++ b/ui/src/hooks/usePinnedNavigation.ts @@ -6,9 +6,10 @@ export function projectPinKey(project: { companyId: string; id: string }) { const UPDATED = "paperclip:pinned-navigation-updated"; const EMPTY = "[]"; +const DEFAULT_PINS = JSON.stringify(["/apps"]); function read(key: string | null) { - try { return key ? localStorage.getItem(key) ?? EMPTY : EMPTY; } + try { return key ? localStorage.getItem(key) ?? DEFAULT_PINS : EMPTY; } catch { return EMPTY; } }