@@ -153,7 +153,8 @@ const ComposeChecklist: React.FC = () => {
153153// ─── Sidebar ─────────────────────────────────────────────────────────────────
154154
155155const Sidebar : React . FC = ( ) => {
156- const { config, state, updateConfig, startDeployment } = useDeployment ( ) ;
156+ const { config, state, updateConfig, startDeployment, rescanWithBranch, isRescanning } =
157+ useDeployment ( ) ;
157158 const { t } = useI18n ( ) ;
158159 const { requireCloud } = useCloud ( ) ;
159160 const { baseDomain, selfHosted, deployMode } = usePlatform ( ) ;
@@ -163,6 +164,15 @@ const Sidebar: React.FC = () => {
163164 const { showToast } = useToast ( ) ;
164165 const router = useRouter ( ) ;
165166 const isServices = usesServiceDeployment ( config ) ;
167+ const [ branchError , setBranchError ] = React . useState < string | null > ( null ) ;
168+ const handleBranchChange = useCallback (
169+ async ( branch : string ) => {
170+ setBranchError ( null ) ;
171+ const result = await rescanWithBranch ( branch ) ;
172+ if ( ! result . success && result . error ) setBranchError ( result . error ) ;
173+ } ,
174+ [ rescanWithBranch ] ,
175+ ) ;
166176
167177 // Copy a ready-to-run `git clone` command with a short-lived GitHub App
168178 // installation token. Cloud / GitHub-App mode only — surfaces a clear
@@ -457,7 +467,8 @@ const Sidebar: React.FC = () => {
457467 repo = { config . repo }
458468 projectId = { config . projectId }
459469 value = { config . branch }
460- onChange = { ( val ) => updateConfig ( { branch : val } ) }
470+ onChange = { ( val ) => void handleBranchChange ( val ) }
471+ disabled = { isRescanning || isSaving || state . isDeploying }
461472 initialBranches = { config . branches }
462473 initialPage = { config . branchPage }
463474 initialHasMore = { config . branchesHasMore }
@@ -469,6 +480,20 @@ const Sidebar: React.FC = () => {
469480 }
470481 : undefined }
471482 />
483+ { isRescanning && (
484+ < p
485+ role = "status"
486+ className = "flex items-center gap-2 mt-2 text-sm text-muted-foreground"
487+ >
488+ < Loader2 className = "size-3.5 animate-spin" aria-hidden = "true" />
489+ { t . importProject . buildSettings . composePath . scanning }
490+ </ p >
491+ ) }
492+ { branchError && (
493+ < p role = "alert" className = "mt-2 text-sm text-danger break-words" >
494+ { branchError }
495+ </ p >
496+ ) }
472497 </ div >
473498 ) }
474499 { config . branches . length === 0 && config . branch && (
@@ -518,7 +543,7 @@ const Sidebar: React.FC = () => {
518543 { isConfigMode ? (
519544 < button
520545 onClick = { handleSave }
521- disabled = { isSaving }
546+ disabled = { isSaving || isRescanning }
522547 className = "w-full inline-flex items-center justify-center gap-2 px-5 py-3 bg-primary text-primary-foreground text-sm font-medium rounded-xl hover:bg-primary/90 transition-all hover:shadow-lg hover:shadow-primary/25 hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed"
523548 >
524549 { isSaving ? (
@@ -536,7 +561,7 @@ const Sidebar: React.FC = () => {
536561 ) : (
537562 < button
538563 onClick = { handleDeploy }
539- disabled = { state . isDeploying }
564+ disabled = { state . isDeploying || isRescanning }
540565 className = "w-full inline-flex items-center justify-center gap-2 px-5 py-3 bg-primary text-primary-foreground text-sm font-medium rounded-xl hover:bg-primary/90 transition-all hover:shadow-lg hover:shadow-primary/25 hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed"
541566 >
542567 { state . isDeploying ? (
0 commit comments