mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 01:50:13 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Operators use connector setup, collection headers, empty states, and agent lists to manage that work. > - Provider redirects replace the setup page, and collection controls use different sizes. > - Agent selection inserts a bar above the list. The row link highlights only part of the row. > - This pull request keeps sign-in in a separate window and applies the Tasks control sizes to collection and audit headers. > - It also reuses artifact artwork for empty collections and gives agent selection a fixed action card. > - These changes preserve the operator's place and keep controls and rows stable. ## Linked Issues or Issue Description **What happened?** Connector sign-in replaced the current page. Inline collection controls had different heights. Projects and Artifacts used small placeholder empty states. Agent selection moved the list, hover covered only the identity cell, and chat/status shared that cell without matching headings. **Expected behavior** Provider sign-in opens in a new tab or window. Collection controls match Tasks. Empty collections use the large artifact graphics. Agent actions float above the page while rows remain aligned. **Steps to reproduce** Start connector sign-in from a page or dialog. Compare collection and Audit headers. Open an empty Projects or Artifacts collection. Select an agent, then hover across its row. Related public work: #13584 covers an earlier connector new-tab implementation, including same-page fallbacks that this bundle does not use. #8528 covers Tasks toggle sizing. #17742 covers scoped agent Audit sections. This bundle does not change server callback or audit authorization contracts. ## What Changed - Reserve a separate authorization window during the click. Use validated sign-in URLs, retain a new-tab fallback, and close blank windows after failed requests. Store Cloud reauthentication state in the destination window. - Use the Tasks 44px control foundation for shared collection headers and Audit, Costs, Timeline, Secrets, Teams, Gateways, and agent skill controls. - Use a large artifact stack with an off-white Paperclip image with a dark icon for Projects and artifact Tasks empty states. Use one matching artifact for other types. Set 20px gaps and use the label “Create project”. Action hover and keyboard focus animate the artwork. - Portal agent bulk actions to a fixed card 48px above the bottom safe area. Use quintic entry/exit motion and respect reduced motion. Retain card contents during exit. - Give chat and status separate cells, add a Status heading, use the MessagesSquare chat action with a hover tooltip, and highlight the entire row. - Add linked agent chips and a manager picker to the agent profile. Block self and descendant manager choices. Keep the name crown and custom title inline during edits. - Update design guidance, the connection maps, regression tests, and empty-state Storybook fixtures. ## Verification - Final commit `a41a6c6494a839deaaec1ef7cc50c90078ab6381`: all 55 checks passed, three skipped. [Canonical CI run](https://github.com/paperclipai/paperclip/actions/runs/41999792769) includes all eight browser shards and all server/runner/workspace groups. Greptile: 5/5, zero unresolved review findings. - Workspace typecheck/build passed. Local UI suite passed 11,006 tests in 880 files, plus 542 CLI tests. Subsequent connector callback changes passed all 245 AppsConnect tests, UI typecheck, token gates, and query-error policy checks. Manager cache/error regressions passed four tests. Map checks passed. - Local connector browser suite: 20 passed. All six chat integration shards: 1,931 passed. Workspace B groups passed; database tests passed 313 cases across 72 files with one worker. - Browser preview verified agent manager changes, overview links, inline name/title geometry, empty-state colors, row actions and the chat tooltip. Live provider consent and post-deployment feature verification remain separate from these fixtures. - Preserved failures: ten bulk-roster tests initially missed the portaled action card; their selectors were fixed and all twelve roster tests passed. A nested fixture selected pnpm 11 and removed local dependencies; the local shim now pins pnpm 9. Embedded PostgreSQL native links were restored. A Python 3.9 fixture failure passed all 19 tests with the current runtime. Concurrent local database startup failures passed on the one-worker rerun. - The broad local serialized server run passed 3,791 tests with one scheduling assertion failure, which passed in isolation. The local general-server run reproduced a native recovery provider/model fixture failure and has not completed. These server sources are unchanged by this bundle; all final canonical CI server shards passed. This is not a claim that every broad local run passed. - [Earlier CI run](https://github.com/paperclipai/paperclip/actions/runs/41995119880) failed a browser test during cleanup when heartbeat-run cancellation hit a PostgreSQL lock timeout. All final browser shards passed without weakening that test. - Review follow-ups cover Slack popup/fallback recovery, a single artwork hover transform, shared manager error rendering, detached standalone OAuth windows, and verified task-bound callbacks in both hosts. ## Risks - Browser popup policy and provider callback behavior can affect sign-in completion. The original setup page stays open; blocked windows have an explicit recovery path. - Shared toolbar styles affect several surfaces. Menu content remains in its existing portals; canonical label tabs and search clear buttons retain their own geometry. - No schema, server, API authorization, or migration change. - Required CI and review are complete. Deployment provenance and hosted feature verification are checked separately after merge. ## Model Used OpenAI Codex, GPT-6 family, with reasoning, repository tools, test execution, and browser inspection. The exact model ID and context-window size were not exposed in this session. ## 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) - [x] 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 relevant tests locally and they pass (broader local exceptions are recorded above) - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>
172 lines
12 KiB
TypeScript
172 lines
12 KiB
TypeScript
import { expect, test, type Page } from "@playwright/test";
|
|
|
|
test.use({ viewport: { width: 1440, height: 1100 } });
|
|
async function openToolbars(page: Page, story = "playground") {
|
|
await page.goto(`/iframe.html?id=design-toolbars--${story}&viewMode=story&globals=theme:dark`);
|
|
await expect(page.getByTestId("toolbars-preview")).toBeVisible();
|
|
return page.getByTestId("toolbars-preview");
|
|
}
|
|
|
|
test("canonical toolbar stories mount the shared components under the proposal theme", async ({ page }) => {
|
|
const errors: string[] = [];
|
|
page.on("pageerror", error => errors.push(error.message));
|
|
for (const [story, count] of [["playground", 6], ["tasks", 1], ["decisions", 1], ["skills", 1], ["artifacts", 1], ["projects", 1], ["routines", 1], ["narrow", 6]] as const) {
|
|
const preview = await openToolbars(page, story);
|
|
await expect(page.locator(".design-proposal-theme")).toBeVisible();
|
|
await expect(preview.getByRole("toolbar")).toHaveCount(count);
|
|
}
|
|
expect(errors).toEqual([]);
|
|
});
|
|
|
|
test("task toolbar retains real view, search, layout, expansion and filter controls", async ({ page }) => {
|
|
const preview = await openToolbars(page, "tasks");
|
|
const toolbar = preview.getByRole("toolbar", { name: "Task list controls" });
|
|
|
|
await toolbar.getByRole("button", { name: "Task view: All tasks", exact: true }).click();
|
|
await page.getByRole("menuitemradio", { name: "Unread", exact: true }).click();
|
|
await expect(toolbar.getByRole("button", { name: "Task view: Unread", exact: true })).toBeVisible();
|
|
await toolbar.getByRole("textbox", { name: "Search tasks", exact: true }).fill("connector");
|
|
await toolbar.getByRole("button", { name: "Clear search", exact: true }).click();
|
|
await expect(toolbar.getByRole("textbox", { name: "Search tasks", exact: true })).toHaveValue("");
|
|
await toolbar.getByRole("button", { name: "Board view", exact: true }).click();
|
|
await expect(toolbar.getByRole("button", { name: "Board view", exact: true })).toHaveAttribute("aria-pressed", "true");
|
|
await expect(toolbar.getByRole("button", { name: /all tasks/ })).toBeDisabled();
|
|
await toolbar.getByRole("button", { name: "List view", exact: true }).click();
|
|
await toolbar.getByRole("button", { name: "Collapse all tasks", exact: true }).click();
|
|
await expect(toolbar.getByRole("button", { name: "Expand all tasks", exact: true })).toBeEnabled();
|
|
await toolbar.getByRole("button", { name: "Filter", exact: true }).click();
|
|
await expect(page.getByRole("dialog", { name: "Filters", exact: true })).toBeVisible();
|
|
await page.keyboard.press("Escape");
|
|
await toolbar.getByRole("button", { name: "New Task", exact: true }).click();
|
|
await expect(preview.getByRole("status")).toContainText("New Task requested · local preview only");
|
|
});
|
|
|
|
test("decision menus update local state", async ({ page }) => {
|
|
const writes: string[] = [];
|
|
page.on("request", request => { if (["POST", "PATCH", "PUT", "DELETE"].includes(request.method()) && request.url().includes("/api/")) writes.push(request.url()); });
|
|
const preview = await openToolbars(page);
|
|
const decisions = preview.getByRole("region", { name: "Decisions toolbar", exact: true });
|
|
await decisions.getByRole("button", { name: "Group", exact: true }).click();
|
|
await page.getByRole("button", { name: "Severity", exact: true }).click();
|
|
await page.keyboard.press("Escape");
|
|
await expect(decisions.getByRole("status")).toContainText("Group: severity");
|
|
await decisions.getByRole("button", { name: "Sort", exact: true }).click();
|
|
await page.getByRole("button", { name: "Oldest first", exact: true }).click();
|
|
await page.keyboard.press("Escape");
|
|
await expect(decisions.getByRole("status")).toContainText("Sort: oldest");
|
|
await decisions.getByRole("button", { name: "Filter", exact: true }).click();
|
|
await page.getByRole("button", { name: "Critical", exact: true }).click();
|
|
await page.keyboard.press("Escape");
|
|
await expect(decisions.getByRole("status")).toContainText("1 active filters");
|
|
expect(writes).toEqual([]);
|
|
});
|
|
|
|
test("width controls expose narrow wrapping and keyboard focus", async ({ page }) => {
|
|
const preview = await openToolbars(page);
|
|
await preview.getByRole("combobox", { name: "Toolbar container width", exact: true }).selectOption("narrow");
|
|
const specimens = preview.getByTestId("toolbar-specimens");
|
|
await expect(specimens).toHaveAttribute("data-container-width", "narrow");
|
|
expect(await specimens.evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true);
|
|
const search = preview.getByRole("textbox", { name: "Search tasks", exact: true });
|
|
await search.focus();
|
|
await page.keyboard.press("Tab");
|
|
const list = preview.getByRole("button", { name: "List view", exact: true });
|
|
await expect(list).toBeFocused();
|
|
await expect(list).not.toHaveCSS("box-shadow", "none");
|
|
});
|
|
|
|
test("Skills and Artifacts use their shared production controls with local preview state", async ({ page }) => {
|
|
let preview = await openToolbars(page, "skills");
|
|
await preview.getByRole("textbox", { name: "Search installed skills", exact: true }).fill("review");
|
|
await preview.getByRole("button", { name: "Sort Most agents", exact: true }).click();
|
|
await page.getByRole("menuitemradio", { name: "Alphabetical", exact: true }).click();
|
|
await expect(preview.getByRole("status")).toContainText("Search: review · Sort: alphabetical");
|
|
await preview.getByRole("button", { name: "Source All", exact: true }).click();
|
|
await page.getByRole("menuitemradio", { name: "GitHub", exact: true }).click();
|
|
await expect(preview.getByRole("status")).toContainText("Source: github");
|
|
const scan = preview.getByRole("button", { name: "Scan project workspaces for skills", exact: true });
|
|
await scan.click();
|
|
await expect(scan).toBeDisabled();
|
|
await preview.getByRole("button", { name: "Complete simulated scan", exact: true }).click();
|
|
await expect(scan).toBeEnabled();
|
|
await preview.getByRole("button", { name: "New", exact: true }).click();
|
|
await page.getByRole("menuitem", { name: "Create new skill", exact: true }).click();
|
|
await expect(preview.getByRole("status")).toContainText("Create skill requested");
|
|
await preview.getByRole("button", { name: "New folder", exact: true }).click();
|
|
await expect(preview.getByRole("status")).toContainText("New folder requested");
|
|
preview = await openToolbars(page, "artifacts");
|
|
await preview.getByRole("textbox", { name: "Search artifacts", exact: true }).fill("mockup");
|
|
await preview.getByRole("radio", { name: "Images", exact: true }).click();
|
|
await expect(preview.getByRole("radio", { name: "Images", exact: true })).toHaveCSS("font-size", "14px");
|
|
await expect(preview.getByRole("radio", { name: "Images", exact: true })).toHaveCSS("height", "32px");
|
|
await preview.getByTestId("artifact-group-control").click();
|
|
await page.getByTestId("artifact-group-option-parent_task").click();
|
|
await expect(preview.getByRole("status")).toHaveText("Search: mockup · Group: parent_task · Type: image");
|
|
await preview.getByRole("button", { name: "Clear artifact search", exact: true }).click();
|
|
await expect(preview.getByRole("textbox", { name: "Search artifacts", exact: true })).toHaveValue("");
|
|
});
|
|
|
|
test("canonical toolbars share control geometry and keep the requested keyboard order", async ({ page }) => {
|
|
const preview = await openToolbars(page);
|
|
const geometry = await preview.locator("[data-canonical-toolbar]").evaluateAll(toolbars => toolbars.map(toolbar => {
|
|
const search = toolbar.querySelector<HTMLElement>("[data-toolbar-search]")!;
|
|
const first = toolbar.querySelector("input, button")!;
|
|
const controls = [...toolbar.querySelectorAll<HTMLElement>("button:not([data-toolbar-clear], .canonical-tab), [data-toolbar-control]")].filter(button => !button.closest(".design-view-toggle"));
|
|
const style = getComputedStyle(search);
|
|
return { name: toolbar.getAttribute("data-canonical-toolbar"), searchHeight: search.getBoundingClientRect().height, gap: getComputedStyle(toolbar).columnGap,
|
|
border: style.borderColor, radius: style.borderRadius, first: first.getAttribute("aria-label"),
|
|
controls: controls.map(button => ({ height: button.getBoundingClientRect().height, border: getComputedStyle(button).borderColor, radius: getComputedStyle(button).borderRadius })) };
|
|
}));
|
|
expect(geometry).toHaveLength(6);
|
|
for (const toolbar of geometry) {
|
|
expect(toolbar.searchHeight).toBe(44);
|
|
expect(toolbar.gap).toBe("8px");
|
|
expect(toolbar.first).toBe(toolbar.name === "tasks" ? "Task view: All tasks" : toolbar.name === "skills" ? "Search installed skills" : `Search ${toolbar.name}`);
|
|
for (const control of toolbar.controls) {
|
|
expect(control.height).toBe(toolbar.searchHeight);
|
|
expect(control.border).toBe(toolbar.border);
|
|
expect(control.radius).toBe(toolbar.radius);
|
|
}
|
|
}
|
|
const skills = preview.getByRole("toolbar", { name: "Skills controls", exact: true });
|
|
const skillViews = skills.getByRole("navigation", { name: "Skills views" });
|
|
await expect(skillViews.getByRole("link")).toHaveText(["Installed", "Discover", "My Skills"]);
|
|
await expect(skillViews.getByRole("link", { name: "Installed", exact: true })).toHaveAttribute("aria-current", "page");
|
|
await expect(skillViews.getByRole("link", { name: "My Skills", exact: true })).toHaveAttribute("href", /\/skills\/studio$/);
|
|
await expect(skillViews.getByRole("link", { name: "Sources", exact: true })).toHaveCount(0);
|
|
|
|
await expect(skills.getByRole("button").last()).toHaveAccessibleName("New");
|
|
const decisions = preview.getByRole("region", { name: "Decisions toolbar", exact: true });
|
|
await decisions.getByRole("textbox", { name: "Search decisions", exact: true }).fill("des-3");
|
|
await expect(decisions.locator("[data-toolbar-count]")).toHaveText("1 decision");
|
|
await decisions.getByRole("button", { name: "Clear search", exact: true }).click();
|
|
await expect(decisions.locator("[data-toolbar-count]")).toHaveText("2 decisions");
|
|
});
|
|
|
|
test("Projects toolbar searches, sorts and reports creation locally", async ({ page }) => {
|
|
const preview = await openToolbars(page, "projects");
|
|
await preview.getByRole("textbox", { name: "Search projects", exact: true }).fill("design");
|
|
await preview.getByRole("button", { name: "Sort: Name", exact: true }).click();
|
|
await page.getByRole("button", { name: "Updated", exact: true }).click();
|
|
await page.keyboard.press("Escape");
|
|
await expect(preview.getByRole("status")).toContainText("Search: design · Sort: updated · Direction: desc");
|
|
await preview.getByRole("button", { name: "Create project", exact: true }).click();
|
|
await expect(preview.getByRole("status")).toContainText("Create project requested · local preview only");
|
|
});
|
|
|
|
|
|
test("routines toolbar updates search, sort, group and creation intent", async ({ page }) => {
|
|
const preview = await openToolbars(page, "routines");
|
|
await preview.getByRole("textbox", { name: "Search routines", exact: true }).fill("review");
|
|
await expect(preview.locator("output")).toContainText("Search: review");
|
|
await preview.getByRole("button", { name: "Sort", exact: true }).click();
|
|
await page.getByRole("button", { name: "Title", exact: true }).click();
|
|
await expect(preview.locator("output")).toContainText("Sort: title · Direction: asc");
|
|
await preview.getByRole("button", { name: "Group", exact: true }).click();
|
|
await page.getByRole("button", { name: "Agent", exact: true }).click();
|
|
await expect(preview.locator("output")).toContainText("Group: assignee");
|
|
await expect(preview.getByRole("button", { name: "New folder" })).toHaveCount(0);
|
|
await preview.getByRole("button", { name: "Create routine" }).click();
|
|
await expect(preview.locator("output")).toContainText("Create routine requested");
|
|
});
|