feat: workspace source-of-truth hard cut

This commit is contained in:
Mohamed Boudra
2026-03-03 23:28:16 +07:00
parent f3796e2ba5
commit cb92f39e73
20 changed files with 1813 additions and 945 deletions
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import type { SidebarProjectEntry, SidebarWorkspaceEntry } from "@/hooks/use-sidebar-agents-list";
import type { SidebarProjectEntry, SidebarWorkspaceEntry } from "@/hooks/use-sidebar-workspaces-list";
import { buildSidebarWorkspaceViewModel } from "./sidebar-shortcuts";
@@ -7,11 +7,9 @@ function workspace(serverId: string, cwd: string): SidebarWorkspaceEntry {
return {
workspaceKey: `${serverId}:${cwd}`,
serverId,
cwd,
branchName: null,
createdAt: null,
isMainCheckout: false,
isPaseoOwnedWorktree: false,
workspaceId: cwd,
name: cwd,
activityAt: null,
statusBucket: "done",
};
}
@@ -20,11 +18,11 @@ function project(projectKey: string, workspaces: SidebarWorkspaceEntry[]): Sideb
return {
projectKey,
projectName: projectKey,
iconWorkingDir: workspaces[0]?.cwd ?? "",
iconWorkingDir: workspaces[0]?.workspaceId ?? "",
statusBucket: "done",
activeCount: 0,
totalCount: workspaces.length,
latestCreatedAt: null,
totalWorkspaces: workspaces.length,
latestActivityAt: null,
workspaces,
};
}