Improve workspace navigation and render isolation

This commit is contained in:
Mohamed Boudra
2026-04-20 16:14:22 +07:00
parent 403fb03c97
commit a6423f7f0a
46 changed files with 2801 additions and 862 deletions
@@ -6,7 +6,6 @@ import type {
export interface SidebarProjectWorkspaceLinkRowModel {
kind: "workspace_link";
workspace: SidebarWorkspaceEntry;
selected: boolean;
chevron: null;
trailingAction: "new_worktree" | "none";
}
@@ -28,23 +27,15 @@ export function isSidebarProjectFlattened(project: SidebarProjectEntry): boolean
export function buildSidebarProjectRowModel(input: {
project: SidebarProjectEntry;
collapsed: boolean;
serverId?: string | null;
activeWorkspaceSelection?: { serverId: string; workspaceId: string } | null;
}): SidebarProjectRowModel {
const flattenedWorkspace = isSidebarProjectFlattened(input.project)
? (input.project.workspaces[0] ?? null)
: null;
const selected =
flattenedWorkspace !== null &&
Boolean(input.serverId) &&
input.activeWorkspaceSelection?.serverId === input.serverId &&
input.activeWorkspaceSelection?.workspaceId === flattenedWorkspace.workspaceId;
if (flattenedWorkspace) {
return {
kind: "workspace_link",
workspace: flattenedWorkspace,
selected,
chevron: null,
trailingAction: input.project.projectKind === "git" ? "new_worktree" : "none",
};