From 7f92f7f51d915b8e13eb2becfbcaafb955909c10 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 14 Apr 2026 22:27:06 +0700 Subject: [PATCH] fix: stabilize branch switcher layout on mobile Always render the GitBranch icon regardless of branch availability so the layout doesn't shift when the branch name loads. Only the chevron remains dynamic. Also removes vertical padding on mobile to tighten the gap between the branch row and project subtitle. --- .../app/src/components/branch-switcher.tsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/app/src/components/branch-switcher.tsx b/packages/app/src/components/branch-switcher.tsx index f9ce26bf9..aeef7b346 100644 --- a/packages/app/src/components/branch-switcher.tsx +++ b/packages/app/src/components/branch-switcher.tsx @@ -43,12 +43,17 @@ export function BranchSwitcher({ queryClient, }); - if (!currentBranchName) { - return ( + const titleContent = ( + <> + {title} - ); + + ); + + if (!currentBranchName) { + return {titleContent}; } return ( @@ -63,10 +68,7 @@ export function BranchSwitcher({ accessibilityRole="button" accessibilityLabel={`Current branch: ${currentBranchName}. Press to switch branch.`} > - - - {title} - + {titleContent} {!isCompact ? : null} ({ xs: -theme.spacing[2], md: 0, }, - paddingVertical: theme.spacing[1], + paddingVertical: { + xs: 0, + md: theme.spacing[1], + }, paddingHorizontal: theme.spacing[2], borderRadius: theme.borderRadius.md, flexShrink: 1,