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 (
-