@@ -2679,12 +2679,24 @@ export class AppStore extends TypedBaseStore<IAppState> {
26792679 this . commitSummaryWidth = constrain ( this . commitSummaryWidth , 100 , filesMax )
26802680 this . stashedFilesWidth = constrain ( this . stashedFilesWidth , 100 , filesMax )
26812681
2682- // Allocate branch first (highest priority), then worktree , then
2682+ // Allocate worktree first (highest priority), then branch , then
26832683 // push-pull. Each subsequent allocation uses the clamped value of the
26842684 // previous to prevent the total from exceeding the available space.
2685+ const worktreeDropdownMax =
2686+ available - defaultBranchDropdownWidth - defaultPushPullButtonWidth
2687+ const minimumWorktreeDropdownWidth =
2688+ defaultWorktreeDropdownWidth > available / numButtons
2689+ ? available / numButtons - 10
2690+ : defaultWorktreeDropdownWidth
2691+ this . worktreeDropdownWidth = constrain (
2692+ this . worktreeDropdownWidth ,
2693+ minimumWorktreeDropdownWidth ,
2694+ worktreeDropdownMax
2695+ )
2696+
26852697 const branchDropdownMax =
26862698 available -
2687- ( this . showWorktrees ? defaultWorktreeDropdownWidth : 0 ) -
2699+ ( this . showWorktrees ? clamp ( this . worktreeDropdownWidth ) : 0 ) -
26882700 defaultPushPullButtonWidth
26892701 const minimumBranchDropdownWidth =
26902702 defaultBranchDropdownWidth > available / numButtons
@@ -2696,22 +2708,10 @@ export class AppStore extends TypedBaseStore<IAppState> {
26962708 branchDropdownMax
26972709 )
26982710
2699- const worktreeDropdownMax =
2700- available - clamp ( this . branchDropdownWidth ) - defaultPushPullButtonWidth
2701- const minimumWorktreeDropdownWidth =
2702- defaultWorktreeDropdownWidth > available / numButtons
2703- ? available / numButtons - 10
2704- : defaultWorktreeDropdownWidth
2705- this . worktreeDropdownWidth = constrain (
2706- this . worktreeDropdownWidth ,
2707- minimumWorktreeDropdownWidth ,
2708- worktreeDropdownMax
2709- )
2710-
27112711 const pushPullButtonMaxWidth =
27122712 available -
2713- clamp ( this . branchDropdownWidth ) -
2714- ( this . showWorktrees ? clamp ( this . worktreeDropdownWidth ) : 0 )
2713+ ( this . showWorktrees ? clamp ( this . worktreeDropdownWidth ) : 0 ) -
2714+ clamp ( this . branchDropdownWidth )
27152715 const minimumPushPullToolBarWidth =
27162716 defaultPushPullButtonWidth > available / numButtons
27172717 ? available / numButtons - 10
0 commit comments