From caf7060ec571039102acd7b4fd73008fdecbe8a9 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Sun, 20 Sep 2026 16:55:12 +0900 Subject: feat(workspaces): archive option + archived-workspaces view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consume the backend's archive contract (feature/archive-workspaces): - adapter/http: archive(id)/unarchive(id) (PUT/DELETE /workspaces/:id/archive); list(archived?) passes the ?archived= query - logic/view-model: pure applyArchived(list, id, archived) - store.svelte: setArchived(id, archived) (optimistic + revert-on-error + reconciling refresh); archivedList + refreshArchived() for the archived view - ui/TileActionBar: new Archive action (the right-click→select action bar) - ui/HomeHeader: new Archived button opens the archived view - ui/ArchivedWorkspaces (new): modal listing archived workspaces with Unarchive + View (navigates to /) - ui/WorkspacesHome: wire the Archive action + the Archived modal - .dispatch/wire.reference.md + backend-handoff.md: record the contract delta --- src/features/workspaces/ui/TileActionBar.test.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/features/workspaces/ui/TileActionBar.test.ts') diff --git a/src/features/workspaces/ui/TileActionBar.test.ts b/src/features/workspaces/ui/TileActionBar.test.ts index 4b0377e..c00de19 100644 --- a/src/features/workspaces/ui/TileActionBar.test.ts +++ b/src/features/workspaces/ui/TileActionBar.test.ts @@ -11,6 +11,7 @@ function ws(overrides: Partial = {}): WorkspaceEntry { defaultCwd: null, defaultComputerId: null, starred: false, + archived: false, createdAt: 1, lastActivityAt: 2, conversationCount: 0, @@ -26,6 +27,7 @@ function handlers() { onToggleStar: vi.fn(), onDetails: vi.fn(), onPlugins: vi.fn(), + onArchive: vi.fn(), onDelete: vi.fn(), onClose: vi.fn(), }; @@ -40,6 +42,7 @@ describe("TileActionBar", () => { expect(screen.getByRole("button", { name: "Resize" })).toBeInTheDocument(); expect(screen.getByRole("button", { name: "Star" })).toBeInTheDocument(); expect(screen.getByRole("button", { name: "Details" })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Archive" })).toBeInTheDocument(); expect(screen.getByRole("button", { name: "Delete" })).toBeInTheDocument(); expect(screen.getByRole("button", { name: "Close actions" })).toBeInTheDocument(); }); @@ -74,6 +77,7 @@ describe("TileActionBar", () => { await user.click(screen.getByRole("button", { name: "Resize" })); await user.click(screen.getByRole("button", { name: "Star" })); await user.click(screen.getByRole("button", { name: "Details" })); + await user.click(screen.getByRole("button", { name: "Archive" })); await user.click(screen.getByRole("button", { name: "Delete" })); await user.click(screen.getByRole("button", { name: "Close actions" })); @@ -82,6 +86,7 @@ describe("TileActionBar", () => { expect(h.onResize).toHaveBeenCalledTimes(1); expect(h.onToggleStar).toHaveBeenCalledTimes(1); expect(h.onDetails).toHaveBeenCalledTimes(1); + expect(h.onArchive).toHaveBeenCalledTimes(1); expect(h.onDelete).toHaveBeenCalledTimes(1); expect(h.onClose).toHaveBeenCalledTimes(1); }); -- cgit v1.2.3