@@ -42,6 +42,7 @@ import {
4242 type BranchToolbarBranchSelectorHandle ,
4343} from "./BranchToolbarBranchSelector" ;
4444import { BranchToolbarEnvironmentSelector } from "./BranchToolbarEnvironmentSelector" ;
45+ import type { PendingServerUpdate } from "./ServerUpdateAction" ;
4546import { BranchToolbarEnvModeSelector } from "./BranchToolbarEnvModeSelector" ;
4647import { PreviousWorktreeItemContent } from "./PreviousWorktreeItemContent" ;
4748import { ThreadDetailsControl } from "./chat/ThreadDetailsControl" ;
@@ -99,6 +100,7 @@ interface BranchToolbarProps {
99100 onEnvironmentChange ?: ( environmentId : EnvironmentId ) => void ;
100101 composerControlsHostRef ?: ( element : HTMLDivElement | null ) => void ;
101102 contextStripVisible ?: boolean ;
103+ serverUpdate ?: PendingServerUpdate | null ;
102104}
103105
104106function showWorkspaceContextMenu ( event : ReactMouseEvent , workspacePath : string ) {
@@ -586,6 +588,7 @@ export const BranchToolbar = memo(function BranchToolbar({
586588 onEnvironmentChange,
587589 composerControlsHostRef,
588590 contextStripVisible = true ,
591+ serverUpdate = null ,
589592} : BranchToolbarProps ) {
590593 const branchSelectorRef = useRef < BranchToolbarBranchSelectorHandle > ( null ) ;
591594 const threadRef = scopeThreadRef ( environmentId , threadId ) ;
@@ -659,6 +662,7 @@ export const BranchToolbar = memo(function BranchToolbar({
659662 const showEnvironmentIndicator = shouldShowEnvironmentIndicator ( {
660663 activeEnvironment : activeEnvironmentOption ,
661664 canPickEnvironment : hasMultipleEnvironments ,
665+ serverUpdateAvailable : serverUpdate !== null ,
662666 } ) ;
663667 const [ stripElement , setStripElement ] = useState < HTMLDivElement | null > ( null ) ;
664668 const labelsOverflow = useLabelsOverflow ( stripElement ) ;
@@ -723,6 +727,17 @@ export const BranchToolbar = memo(function BranchToolbar({
723727 ! contextStripVisible && "pointer-events-none invisible absolute inset-x-0 top-full" ,
724728 ) }
725729 >
730+ { serverUpdate && availableEnvironments ? (
731+ < BranchToolbarEnvironmentSelector
732+ autoEnvironmentLabel = { autoEnvironmentLabel }
733+ onAutoEnvironment = { onAutoEnvironment }
734+ envLocked = { envLocked }
735+ environmentId = { environmentId }
736+ availableEnvironments = { availableEnvironments }
737+ { ...( showEnvironmentPicker ? { onEnvironmentChange } : { } ) }
738+ serverUpdate = { serverUpdate }
739+ />
740+ ) : null }
726741 { showGitControls ? (
727742 < div className = "contents @3xl/composer-surface:hidden" >
728743 < RunContextSelector
@@ -733,8 +748,8 @@ export const BranchToolbar = memo(function BranchToolbar({
733748 envModeLocked = { envModeLocked }
734749 environmentId = { environmentId }
735750 availableEnvironments = { availableEnvironments }
736- showEnvironmentPicker = { showEnvironmentPicker }
737- showEnvironmentIndicator = { showEnvironmentIndicator }
751+ showEnvironmentPicker = { showEnvironmentPicker && serverUpdate === null }
752+ showEnvironmentIndicator = { showEnvironmentIndicator && serverUpdate === null }
738753 onEnvironmentChange = { onEnvironmentChange }
739754 effectiveEnvMode = { effectiveEnvMode }
740755 activeWorktreePath = { activeWorktreePath }
@@ -745,7 +760,7 @@ export const BranchToolbar = memo(function BranchToolbar({
745760 />
746761 </ div >
747762 ) : null }
748- { showGitControls || showEnvironmentIndicator ? (
763+ { showGitControls || ( showEnvironmentIndicator && serverUpdate === null ) ? (
749764 < div
750765 className = { cn (
751766 "min-h-7 min-w-10 items-center gap-1 sm:min-h-6" ,
@@ -755,14 +770,16 @@ export const BranchToolbar = memo(function BranchToolbar({
755770 >
756771 { showEnvironmentIndicator && availableEnvironments && (
757772 < >
758- < BranchToolbarEnvironmentSelector
759- autoEnvironmentLabel = { autoEnvironmentLabel }
760- onAutoEnvironment = { onAutoEnvironment }
761- envLocked = { envLocked }
762- environmentId = { environmentId }
763- availableEnvironments = { availableEnvironments }
764- { ...( showEnvironmentPicker ? { onEnvironmentChange } : { } ) }
765- />
773+ { serverUpdate === null ? (
774+ < BranchToolbarEnvironmentSelector
775+ autoEnvironmentLabel = { autoEnvironmentLabel }
776+ onAutoEnvironment = { onAutoEnvironment }
777+ envLocked = { envLocked }
778+ environmentId = { environmentId }
779+ availableEnvironments = { availableEnvironments }
780+ { ...( showEnvironmentPicker ? { onEnvironmentChange } : { } ) }
781+ />
782+ ) : null }
766783 { showGitControls ? (
767784 < Separator
768785 orientation = "vertical"
0 commit comments