summaryrefslogtreecommitdiffhomepage
path: root/src/features/workspaces/ui/TileActionBar.test.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-09-20 16:55:12 +0900
committerAdam Malczewski <[email protected]>2026-09-20 16:55:12 +0900
commitcaf7060ec571039102acd7b4fd73008fdecbe8a9 (patch)
tree7eac6c55556d20021de4a6e19f63d8efaa21ce84 /src/features/workspaces/ui/TileActionBar.test.ts
parent72663945ef0a0053fbfd83b168e90f12169a5c3a (diff)
downloaddispatch-web-caf7060ec571039102acd7b4fd73008fdecbe8a9.tar.gz
dispatch-web-caf7060ec571039102acd7b4fd73008fdecbe8a9.zip
feat(workspaces): archive option + archived-workspaces view
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 /<id>) - ui/WorkspacesHome: wire the Archive action + the Archived modal - .dispatch/wire.reference.md + backend-handoff.md: record the contract delta
Diffstat (limited to 'src/features/workspaces/ui/TileActionBar.test.ts')
-rw-r--r--src/features/workspaces/ui/TileActionBar.test.ts5
1 files changed, 5 insertions, 0 deletions
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> = {}): 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);
});