Add workspace title display preference

This commit is contained in:
Mohamed Boudra
2026-06-20 19:44:30 +07:00
parent 0718e7c914
commit 68bbc75df1
12 changed files with 155 additions and 17 deletions
@@ -0,0 +1,12 @@
import type { SidebarWorkspaceEntry } from "@/hooks/use-sidebar-workspaces-list";
import type { WorkspaceTitleSource } from "@/hooks/use-settings";
export function resolveSidebarWorkspacePrimaryLabel(input: {
workspace: Pick<SidebarWorkspaceEntry, "name" | "currentBranch">;
workspaceTitleSource: WorkspaceTitleSource;
}): string {
if (input.workspaceTitleSource === "branch") {
return input.workspace.currentBranch ?? input.workspace.name;
}
return input.workspace.name;
}