From 5ea8c99717eb61fc708cb29744002c9e0fee6c51 Mon Sep 17 00:00:00 2001 From: Tonio Date: Thu, 26 Nov 2026 02:23:18 +0000 Subject: [PATCH] fix(ui): close the Plugins review follow-ups and add the Reviews page (#23005) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The Plugins page is where a person connects tools to agents and approves the actions that those tools request > - #22869 turned Connectors into a Plugins marketplace. Three review findings stayed open after the merge > - The page also did not show clearly which account needs attention, and the Reviews page was a plain queue > - A person must see what waits for a decision and must be able to leave a setup step > - This pull request fixes the three findings, adds a review chip and a Reviews page with decision cards, marks the account rows that need attention, and adds a Close button to the chat connection purpose step > - The benefit is a Plugins page that shows pending work, and permission controls that do not accept changes on stale data ## Linked Issues or Issue Description Refs #22869 **What existing behavior does this improve?** The Plugins marketplace pages under `ui/src/pages/apps`: the plugin page, the header, the Reviews page, and the chat connection setup. **Subsystem affected** UI, Plugins (Apps catalog) pages. **Current behavior** - After a failed refresh of the permissions, the menus stay enabled and work on stale data. - The plugin page shows a different category from Browse for Composio and Arcade apps. - Browse classifies each plugin one time for each category on each render. - A chat connection that needs attention shows only text in its row. - The header shows a count only. The Reviews page shows a plain queue. - The "Choose how to connect" step has no control to leave the flow. **Proposed behavior** - After a failed refresh, the actions stay visible, the menus are disabled, and a status line offers "Try again". - The plugin page uses the same category as Browse. - Browse classifies each plugin one time for each render. - A chat connection row that needs attention shows a small warning glyph with a text alternative. - The header shows the logos of the plugins with pending requests (maximum four), an "N to review" chip, and a chevron. It opens the Reviews page. - The Reviews page shows a back button, a title, a count sentence, and one decision card for each request with "Decline" and "Allow once". - The "Choose how to connect" step has a Close button that returns to Plugins. **Reason and benefit** A person sees what waits for a decision and where. Permission changes do not run on stale data. The render cost of Browse does not grow with the number of categories. **Breaking changes** None. The default layout of the review queue on the app detail page does not change. ## What Changed - `plugin-categories.ts`: add `groupPluginsByCategory`, a single pass that classifies each row one time. `Browse.tsx` uses it. - `Browse.tsx`: the plugin page reads its category label from the same function as Browse. Chat connection rows show a warning glyph when `chatEndpointAttention` returns a reason. - `PluginPermissions.tsx`: `staleReads` finds the reads with an error. The menus are disabled while a read is stale, and a status line with "Try again" refetches the stale queries. - `useReviewCount.ts`: add `useReviewQueue`, which returns the count and the application names from the same query. - `PluginsHeader.tsx`: the review button shows stacked plugin logos, the count chip, and a chevron. - `AppsReview.tsx` and `ReviewQueueCard.tsx`: the Reviews page has a header and a `decisions` layout that reuses the coordinator decision card parts. - `ChatEndpointSetup.tsx`: `ChatConnectionPurpose` accepts `onClose` and shows a Close button. - `Browse.tsx`, `PluginMarketplace.tsx`, `AssistantConnection.tsx`: the Installed tab shows the same tiles as the rest of the page. The account rows stay on the plugin page. Assistant Connection (MCP) has a tile of its own. - `ReviewQueueCard.tsx` (review fixes): linked requests use the compact decision presentation of the interaction card, the fallback card is masked as a whole, and the agents list is indexed by id one time. - Specs: `connection-reviews` reads the "Deny" label. `agentmail`, `ai-connections-app`, and `runner-e2e/connection-flow` open the plugin page from an Installed tile. ## Verification These checks ran on the change before the rebase onto current master. The rebase did not touch `ui/src/pages/apps`. - `cd ui && pnpm typecheck`: pass. - `cd ui && npx vitest run src/pages/apps src/features/connections src/lib/analytics`: 539 tests pass. - `pnpm run check:token-gates`: pass. - `node scripts/check-query-error-rendering.mjs`: 0 findings. - Playwright specs `connection-reviews`, `plugins-browse`, and `one-click-connect`: 7 tests pass. - Manual check in a browser with four sample requests: the header chip and the Reviews page render the logos, the count, and the cards. - After the Installed tiles change: 478 unit tests in `src/pages/apps`, `src/lib/analytics`, and the deep-link routing test pass. The `agentmail`, `plugins-browse`, and `one-click-connect` Playwright specs pass. A manual check in a browser shows the tiles on the Installed tab. Not run or not seen: - The full UI Vitest suite and the Storybook build did not run locally. CI supplies that coverage. - The Close button and the row warning glyph were not seen in a browser. Unit tests cover them. - The decision card layout has no unit test of its own. - The stale-permissions state is tested through the `staleReads` helper only. - The edits to `tests/ai-connections-app/app.spec.ts` and `tests/runner-e2e/connection-flow.ts` did not run locally. ## Risks Low risk. The change is UI only, with no schema or API change. - The decision cards say "Decline", and the "Always allow" action is in a menu. This differs from the design exploration, because the product has no snooze and requests carry no written summary. - The review chip counts pending requests only. It does not count accounts that need attention. - The Installed tab no longer lists account rows. A person opens the plugin page to manage an account or to set a default model account. The "Manage connectors" link on an agent opens the Installed tab. - On an instance without the assistant connection route, the Assistant Connection tile shows the attention mark. ## Model Used Claude Fable 5.2 (`claude-fable-5-2`) in Claude Code, with tool use, code execution, and extended thinking. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 --- tests/ai-connections-app/app.spec.ts | 8 +- tests/e2e/agentmail.spec.ts | 3 +- tests/e2e/connection-reviews.spec.ts | 6 +- tests/runner-e2e/connection-flow.ts | 3 + ui/src/pages/apps/AppsReview.tsx | 30 ++-- ui/src/pages/apps/AssistantConnection.tsx | 18 +++ .../pages/apps/Browse.pluginTileState.test.ts | 11 +- ui/src/pages/apps/Browse.tsx | 58 ++++--- ui/src/pages/apps/PluginMarketplace.tsx | 5 +- ui/src/pages/apps/PluginPermissions.test.ts | 11 +- ui/src/pages/apps/PluginPermissions.tsx | 18 ++- ui/src/pages/apps/PluginsHeader.test.tsx | 15 +- ui/src/pages/apps/PluginsHeader.tsx | 31 ++-- .../pages/apps/ReviewQueueCard.agents.test.ts | 25 +++ ui/src/pages/apps/ReviewQueueCard.tsx | 147 +++++++++++++++++- .../apps/chat/ChatConnectionPurpose.test.tsx | 43 +++++ ui/src/pages/apps/chat/ChatEndpointSetup.tsx | 24 ++- ui/src/pages/apps/plugin-categories.test.ts | 33 +++- ui/src/pages/apps/plugin-categories.ts | 22 +++ ui/src/pages/apps/useReviewCount.ts | 20 +++ 20 files changed, 458 insertions(+), 73 deletions(-) create mode 100644 ui/src/pages/apps/ReviewQueueCard.agents.test.ts create mode 100644 ui/src/pages/apps/chat/ChatConnectionPurpose.test.tsx diff --git a/tests/ai-connections-app/app.spec.ts b/tests/ai-connections-app/app.spec.ts index a9ad160b434..881dbcba3a4 100644 --- a/tests/ai-connections-app/app.spec.ts +++ b/tests/ai-connections-app/app.spec.ts @@ -105,9 +105,11 @@ test("personal provider defaults move the crown only after saving and survive re const announcement = page.getByRole("button", { name: "Dismiss announcement" }); if (await announcement.isVisible()) await announcement.click(); const provider = page.locator('[data-app-slug="openai"]'); + // Installed lists plugins as tiles; the accounts are on the plugin page, always open. const expand = async () => { - const trigger = provider.getByRole("button", { name: /^\d+ connections$/ }); - if (await trigger.getAttribute("data-state") === "closed") await trigger.click(); + const tile = provider.locator("h3 button"); + if (await tile.count()) await tile.click(); + await expect(provider.getByRole("button", { name: "Your default for OpenAI" })).toBeVisible(); }; await expect(provider).toBeVisible(); await expand(); @@ -176,7 +178,7 @@ test("personal provider defaults expose crown meaning on touch in both themes at const announcement = page.getByRole("button", { name: "Dismiss announcement" }); if (await announcement.isVisible()) await announcement.click(); const provider = page.locator('[data-app-slug="openai"]'); - await provider.getByRole("button", { name: /^\d+ connections$/ }).tap(); + await provider.locator("h3 button").tap(); const crown = provider.getByRole("button", { name: "Your default for OpenAI" }); await crown.scrollIntoViewIfNeeded(); await crown.tap(); diff --git a/tests/e2e/agentmail.spec.ts b/tests/e2e/agentmail.spec.ts index 9b85a4b88df..8bfdba7edbd 100644 --- a/tests/e2e/agentmail.spec.ts +++ b/tests/e2e/agentmail.spec.ts @@ -262,8 +262,9 @@ test("AgentMail setup and email work through the normal task conversation", asyn 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(); - // Account rows, including one waiting on setup, are listed under Installed. + // 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(); await page.getByRole("button", { name: "Finish setup", exact: true }).click(); await expect(page.getByText("mail-agent-free@verified.example.test", { exact: true })).toBeVisible(); await expect(addressField).toHaveCount(0); diff --git a/tests/e2e/connection-reviews.spec.ts b/tests/e2e/connection-reviews.spec.ts index 54dcc1107d2..e8f85b67175 100644 --- a/tests/e2e/connection-reviews.spec.ts +++ b/tests/e2e/connection-reviews.spec.ts @@ -254,7 +254,7 @@ for (const journey of [ queue = await context.newPage(); await queue.goto(`/${seed.prefix}/apps/review`); await expect( - queue.getByRole("button", { name: "Decline", exact: true }), + queue.getByRole("button", { name: "Deny", exact: true }), ).toBeVisible({ timeout: 20_000 }); } if (journey === "restart") { @@ -290,7 +290,7 @@ for (const journey of [ if (journey === "decline") { // Resolve from Connections and observe the still-open task tab update. await queue! - .getByRole("button", { name: "Decline", exact: true }) + .getByRole("button", { name: "Deny", exact: true }) .click(); } else { @@ -339,7 +339,7 @@ for (const journey of [ ).not.toBeVisible(); if (queue) { await expect( - queue.getByRole("button", { name: "Decline", exact: true }), + queue.getByRole("button", { name: "Deny", exact: true }), ).not.toBeVisible({ timeout: 20_000 }); } await page.bringToFront(); diff --git a/tests/runner-e2e/connection-flow.ts b/tests/runner-e2e/connection-flow.ts index 77ab07a95bd..85dc33790d4 100644 --- a/tests/runner-e2e/connection-flow.ts +++ b/tests/runner-e2e/connection-flow.ts @@ -204,6 +204,9 @@ async function createConnectionThroughUi(input: ConnectionFlowInput, agentURL: s } else if (connection.provider !== harness.provider) throw new ConnectionFailure("saved_provider_mismatch"); // Navigate away and return through the normal list: proof includes durable UI state. await page.goto(`${api.origin}/${company.issuePrefix}/apps?source=installed`, { waitUntil: "domcontentloaded" }); + // Installed lists plugins as tiles; search by account name, then open the plugin page that lists its accounts. + await page.getByPlaceholder("Search plugins…").fill(connection.name); + await page.locator('[role="listitem"][data-connected="true"] h3 button').first().click(); await expect(page.getByText(connection.name, { exact: true }).first()).toBeVisible(); await page.reload({ waitUntil: "domcontentloaded" }); await expect(page.getByText(connection.name, { exact: true }).first()).toBeVisible(); diff --git a/ui/src/pages/apps/AppsReview.tsx b/ui/src/pages/apps/AppsReview.tsx index 7d1bd372ff7..20e30373230 100644 --- a/ui/src/pages/apps/AppsReview.tsx +++ b/ui/src/pages/apps/AppsReview.tsx @@ -5,6 +5,7 @@ import { Button } from "@/components/ui/button"; import { useBreadcrumbs } from "@/context/BreadcrumbContext"; import { useCompany } from "@/context/CompanyContext"; import { ReviewQueueCard } from "./ReviewQueueCard"; +import { useReviewQueue } from "./useReviewCount"; /** * Review — the "decisions waiting on you" inbox (PAP-12371, Finding B). @@ -19,11 +20,12 @@ import { ReviewQueueCard } from "./ReviewQueueCard"; export function AppsReview() { const { selectedCompanyId } = useCompany(); const { setBreadcrumbs } = useBreadcrumbs(); + const queue = useReviewQueue(); useEffect(() => { setBreadcrumbs([ { label: "Plugins", href: "/apps" }, - { label: "Review" }, + { label: "Reviews" }, ]); return () => setBreadcrumbs([]); }, [setBreadcrumbs]); @@ -33,18 +35,24 @@ export function AppsReview() { } return ( -
- -
-

Review

-

- Actions your agents want to run that need your OK first. Approve, always-allow, or decline. -

+
+
+ +
+

Reviews

+ {queue.loaded ? ( +

+ {queue.count === 0 + ? "Nothing is waiting on you." + : `${queue.count} ${queue.count === 1 ? "request" : "requests"} from your plugins ${queue.count === 1 ? "is" : "are"} waiting on you.`} +

+ ) : null} +
- +
); } diff --git a/ui/src/pages/apps/AssistantConnection.tsx b/ui/src/pages/apps/AssistantConnection.tsx index d090bf0b7f2..64c0b010ce6 100644 --- a/ui/src/pages/apps/AssistantConnection.tsx +++ b/ui/src/pages/apps/AssistantConnection.tsx @@ -17,6 +17,7 @@ import { Button } from "@/components/ui/button"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; import { cn } from "@/lib/utils"; +import { PluginTile } from "./PluginMarketplace"; export const ASSISTANT_CONNECTION_PATH = "/apps/assistant-connection"; const connectionsKey = ["mcp-connections"]; @@ -70,6 +71,23 @@ export function AssistantConnectionCard({ onNavigate }: { onNavigate: (href: str
; } +/** The same entry as a marketplace tile, for the Installed grid. Opening it shows the accounts and any load failure in full. */ +export function AssistantConnectionTile({ onNavigate }: { onNavigate: (href: string) => void }) { + const connections = useAssistantConnections(); + const failed = connections.view.kind === "error"; + return