From 725f782079283f8b8fb23e28fa201b0c8a90f9c5 Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Fri, 12 Dec 2025 20:31:53 -0500 Subject: [PATCH] Add iconOnly prop to BranchSwitcher for compact display --- frontend/src/components/repo/BranchSwitcher.tsx | 7 ++++--- frontend/src/components/session/SessionDetailHeader.tsx | 1 + frontend/src/pages/RepoDetail.tsx | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/repo/BranchSwitcher.tsx b/frontend/src/components/repo/BranchSwitcher.tsx index 804b0ade..12bb2544 100644 --- a/frontend/src/components/repo/BranchSwitcher.tsx +++ b/frontend/src/components/repo/BranchSwitcher.tsx @@ -21,9 +21,10 @@ interface BranchSwitcherProps { repoUrl?: string | null; repoLocalPath?: string; className?: string; + iconOnly?: boolean; } -export function BranchSwitcher({ repoId, currentBranch, isWorktree, repoUrl, repoLocalPath, className }: BranchSwitcherProps) { +export function BranchSwitcher({ repoId, currentBranch, isWorktree, repoUrl, repoLocalPath, className, iconOnly }: BranchSwitcherProps) { const [addBranchOpen, setAddBranchOpen] = useState(false); const [gitChangesOpen, setGitChangesOpen] = useState(false); const queryClient = useQueryClient(); @@ -63,14 +64,14 @@ export function BranchSwitcher({ repoId, currentBranch, isWorktree, repoUrl, rep variant="ghost" size="sm" disabled={switchBranchMutation.isPending} - className={`h-6 px-1 sm:px-2 text-[10px] sm:text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:bg-accent gap-1 border border-blue-500/20 ${className || ""}`} + className={`h-6 px-1 sm:px-2 text-[10px] sm:text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:bg-accent gap-1 border border-blue-500/20 ${iconOnly ? 'w-6' : ''} ${className || ""}`} > {switchBranchMutation.isPending ? ( ) : ( )} - {currentBranch} + {!iconOnly && {currentBranch}} diff --git a/frontend/src/components/session/SessionDetailHeader.tsx b/frontend/src/components/session/SessionDetailHeader.tsx index 2aad2d7b..6adacfb9 100644 --- a/frontend/src/components/session/SessionDetailHeader.tsx +++ b/frontend/src/components/session/SessionDetailHeader.tsx @@ -159,6 +159,7 @@ export function SessionDetailHeader({ repoUrl={repo.repoUrl} repoLocalPath={repo.localPath} className="max-w-[80px] sm:w-[140px] sm:max-w-[140px]" + iconOnly />
) : branchToDisplay ? (