From 35c45268873aa5d8fb5738c05e02e00b4391e6a2 Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Tue, 17 Nov 2026 08:45:30 -0600 Subject: [PATCH] fix(ui): clean up routines controls and folder loading (#22009) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip helps people manage AI agents and their work. > - Routines define work that repeats and provide controls to find and organize it. > - The routine list appeared before its folder data. The folder rail then moved the list. > - The page also repeated its folder summary and showed an extra selection control. > - This change loads the folder view with the list and reduces the controls. > - The result is a stable page with consistent folder rows and clear icon controls. ## Linked Issues or Issue Description **What existing behavior does this improve?** The Routines list page and its folder navigation. **Current behavior** The page shows a Select button, a repeated “All routines” summary, and text buttons for Sort and Group. A delayed folder response moves the visible list and can show “Unknown folder.” Folder names and counts use different columns. **Proposed behavior** Remove Select and the repeated summary. Show Sort and Group as named icon buttons. Wait for the initial folder read before showing a folder-based list. Align folder icons, names, and counts. Show folder read errors with a retry control. Keep routines readable after an error or a 15-second request deadline. **Reason and benefit** Operators can scan the list without a layout shift or repeated page labels. Sorting, grouping, search, folder navigation, and per-row filing remain available. **Breaking changes** The routine list no longer has bulk selection. Each row retains its Move to menu. No API or database contract changes. The roadmap has no overlapping page cleanup. The open routines PR search found backend, archive, and scheduling changes, with no matching list cleanup. ## What Changed - Remove the selection control, its unused bulk mode, and the repeated folder summary. - Use icon buttons with accessible names for Sort and Group. Keep them beside search on small screens. - Load folder data before the initial folder list appears. Keep cached rows visible during a folder refresh. Show folder read errors. - Use the same icon, name, count, and action columns for All routines, folders, and Unfiled. - Add regressions for delayed folder data, failed reads, retry recovery and stalled requests. - Keep cached folder names and rows visible after refresh failures. Suppress empty-folder prompts when the first read fails. - Update the Storybook test to use the new accessible button names. - Use the shared fail-fast retry helper with an explicit reason. The query-error policy check passes. - Remove the unused folder-row grid token. ## Verification - Revision: `27d70d1a37bda20496793bbff0fc6adf3a037e80`. Local Linux checkout, Node 25.9.0, Chromium 151. - Red/green: delayed folders, failed folder reads, stalled requests and saved folder filters each failed before their fixes. All now pass. Failed background reads preserve the routine link and folder navigation. A failed first read shows all routines; Retry restores the saved folder or Unfiled filter. - `pnpm --dir ui exec vitest run src/pages/Routines.test.tsx src/components/folders/FolderControls.test.tsx src/api/client.test.ts`: 51 tests pass. - Chromium checks pass for delayed first reveal, folder filters, Sort, Group, search, mobile folder selection, failed folder reads, the 15-second deadline, and retry recovery. No page errors occurred. - Storybook: the routine toolbar interaction test passes with the new button names. Seven interaction and geometry tests pass. The multi-story navigation test could not finish in the local dev server. Chromium reported insufficient resources. The first attempts also needed a browser install and the supported preview hostname. These attempts are not a full suite pass. - The visual baseline manifest has zero snapshots and no archive URL. There is no published baseline to refresh. Screenshots were captured for review; no baseline archive was created. - `pnpm --dir ui exec tsc --noEmit`: passes after stopping the local preview servers. An earlier overlapping attempt hit the workspace memory limit and is not a pass. - `node scripts/check-query-error-rendering.mjs --enforce --summary`: passes with zero findings. - `git diff --check`: passes. The ignored Storybook catalog was generated. - The original `pnpm verify` run selected 578 files and was stopped after source edits. It is not a pass. Focused checks above cover the final source. Required CI is running for the new revision. - Current-head Greptile and Paperclip reviews both give 5/5. All review threads are resolved. Build, policy and typecheck have passed. Remaining server suites are running. Squash auto-merge is enabled and waits for required checks. - Setup note: full preflight could not build Rust binaries because Cargo is absent. - Screenshots use the local source UI with sample API and WebSocket responses. They do not show a staging deployment or prove backend behavior. ## Risks Low risk. The initial folder view now waits for two reads. A folder read has a 15-second deadline and an explicit retry. A failed read with no cached data shows the routines without folder groups. Other group modes do not wait for folder data. Cached background reads keep the visible rows. Shared folder row alignment also applies to the legacy routines page. ## Model Used OpenAI Codex, GPT-6. The runtime did not expose a more specific model revision. Used reasoning, shell execution, and browser automation. No sub-agents were used. ## 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 tests locally and they pass - [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 - [ ] 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 --- .../storybook-visual/toolbars-design.spec.ts | 4 +- ui/src/api/folders.ts | 6 +- ui/src/components/RoutinesToolbar.tsx | 151 +++++++++--------- ui/src/components/folders/FolderControls.tsx | 23 +-- ui/src/index.css | 1 - ui/src/pages/Routines.test.tsx | 148 ++++++++++++++++- ui/src/pages/Routines.tsx | 126 ++++----------- 7 files changed, 271 insertions(+), 188 deletions(-) diff --git a/tests/storybook-visual/toolbars-design.spec.ts b/tests/storybook-visual/toolbars-design.spec.ts index e71c49a0750..982a61be397 100644 --- a/tests/storybook-visual/toolbars-design.spec.ts +++ b/tests/storybook-visual/toolbars-design.spec.ts @@ -159,10 +159,10 @@ test("routines toolbar updates search, sort, group and creation intent", async ( 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 preview.getByRole("button", { name: "Sort routines", 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 preview.getByRole("button", { name: "Group routines", 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); diff --git a/ui/src/api/folders.ts b/ui/src/api/folders.ts index 97bab9d34ce..86884c42735 100644 --- a/ui/src/api/folders.ts +++ b/ui/src/api/folders.ts @@ -8,11 +8,11 @@ import type { MoveFolderRequest, UpdateFolderRequest, } from "@paperclipai/shared"; -import { api } from "./client"; +import { api, type RequestOptions } from "./client"; export const foldersApi = { - list: (companyId: string, kind: FolderKind) => - api.get(`/companies/${encodeURIComponent(companyId)}/folders?kind=${kind}`), + list: (companyId: string, kind: FolderKind, options?: RequestOptions) => + api.get(`/companies/${encodeURIComponent(companyId)}/folders?kind=${kind}`, options), create: (companyId: string, payload: CreateFolderRequest) => api.post(`/companies/${encodeURIComponent(companyId)}/folders`, payload), ensureMy: (companyId: string, payload: EnsureMySkillFolderRequest = {}) => diff --git a/ui/src/components/RoutinesToolbar.tsx b/ui/src/components/RoutinesToolbar.tsx index f3dd2f63c0a..7c20cbed1b0 100644 --- a/ui/src/components/RoutinesToolbar.tsx +++ b/ui/src/components/RoutinesToolbar.tsx @@ -8,7 +8,7 @@ export type RoutineGroupBy = "folder" | "none" | "project" | "assignee"; export type RoutineSortField = "updated" | "created" | "title" | "lastRun"; export type RoutineSortDir = "asc" | "desc"; -export function RoutinesToolbar({ query, onQueryChange, sortField, sortDir, groupBy, onSortChange, onGroupChange, onNewFolder, onCreateRoutine, tasksHref, selectMode, onToggleSelect }: { +export function RoutinesToolbar({ query, onQueryChange, sortField, sortDir, groupBy, onSortChange, onGroupChange, onNewFolder, onCreateRoutine, tasksHref }: { query: string; onQueryChange: (value: string) => void; sortField: RoutineSortField; @@ -19,85 +19,82 @@ export function RoutinesToolbar({ query, onQueryChange, sortField, sortDir, grou onNewFolder?: () => void; onCreateRoutine: () => void; tasksHref?: string; - selectMode?: boolean; - onToggleSelect?: () => void; }) { return
- - - - - - -
- {([ - ["updated", "Updated"], - ["created", "Created"], - ["lastRun", "Last run"], - ["title", "Title"], - ] as const).map(([field, label]) => ( - - ))} -
-
-
- - - - - -
- {([ - ["folder", "Folder"], - ["project", "Project"], - ["assignee", "Agent"], - ["none", "None"], - ] as const).map(([value, label]) => ( - - ))} -
-
-
+
+ + + + + + +
+ {([ + ["updated", "Updated"], + ["created", "Created"], + ["lastRun", "Last run"], + ["title", "Title"], + ] as const).map(([field, label]) => ( + + ))} +
+
+
+ + + + + +
+ {([ + ["folder", "Folder"], + ["project", "Project"], + ["assignee", "Agent"], + ["none", "None"], + ] as const).map(([value, label]) => ( + + ))} +
+
+
+
- {onToggleSelect && } {tasksHref && } {onNewFolder && } diff --git a/ui/src/components/folders/FolderControls.tsx b/ui/src/components/folders/FolderControls.tsx index 47a773ad816..56e1fab1d63 100644 --- a/ui/src/components/folders/FolderControls.tsx +++ b/ui/src/components/folders/FolderControls.tsx @@ -208,22 +208,23 @@ export function FolderRail({ ); } return ( @@ -265,9 +266,8 @@ export function FolderRail({ } /** - * One selectable rail row. The leading 1rem grid column is the reserved - * disclosure/indent slot so nested folders can slot in later without relayout - * (ux-spec §3.1/§3.2 "nesting-ready"). + * One selectable rail row. Use the same icon, label, count and action columns + * as All and Unfiled so every folder label and count aligns. */ export function FolderRailItem({ folder, @@ -297,19 +297,20 @@ export function FolderRailItem({ return (
-