@@ -2467,6 +2467,7 @@ const RepoEditView: React.FC<RepoEditViewProps> = ({ onSave, onCancel, repositor
24672467 { filteredLocalBranches . map ( b => {
24682468 const isCurrent = b === branchInfo ?. current ;
24692469 const isSelected = selectedBranchKeySet . has ( `local:${ b } ` ) ;
2470+ const isProtectedLocal = isProtectedBranch ( b , 'local' ) ;
24702471 return (
24712472 < li key = { b } >
24722473 < div
@@ -2483,13 +2484,14 @@ const RepoEditView: React.FC<RepoEditViewProps> = ({ onSave, onCancel, repositor
24832484 < HighlightedText text = { b } highlight = { debouncedBranchFilter } />
24842485 </ span >
24852486 { isCurrent && < span className = "text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded bg-blue-100 text-blue-700 dark:bg-blue-900/60 dark:text-blue-200" > Current</ span > }
2487+ { isProtectedLocal && < span className = "text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded bg-amber-100 text-amber-700 dark:bg-amber-900/60 dark:text-amber-200" > Protected</ span > }
24862488 </ div >
2487- { b !== branchInfo ?. current && (
2489+ { ! isCurrent && ! isProtectedLocal && (
24882490 < button
24892491 type = "button"
2490- onClick = { ( event ) => {
2491- event . stopPropagation ( ) ;
2492- handleDeleteBranch ( b , 'local' ) ;
2492+ onClick = { ( event ) => {
2493+ event . stopPropagation ( ) ;
2494+ handleDeleteBranch ( b , 'local' ) ;
24932495 } }
24942496 className = "p-1 text-red-500 hover:bg-red-100 dark:hover:bg-red-900/50 rounded-full"
24952497 >
@@ -2507,6 +2509,7 @@ const RepoEditView: React.FC<RepoEditViewProps> = ({ onSave, onCancel, repositor
25072509 < ul className = "flex-1 overflow-y-auto space-y-2 pr-1" >
25082510 { filteredRemoteBranches . map ( b => {
25092511 const isSelected = selectedBranchKeySet . has ( `remote:${ b } ` ) ;
2512+ const isProtectedRemote = isProtectedBranch ( b , 'remote' ) ;
25102513 return (
25112514 < li key = { b } >
25122515 < div
@@ -2518,19 +2521,24 @@ const RepoEditView: React.FC<RepoEditViewProps> = ({ onSave, onCancel, repositor
25182521 ref = { element => setBranchItemRef ( 'remote' , b , element ) }
25192522 className = { `flex items-center justify-between gap-3 rounded-md border px-3 py-2 cursor-pointer transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-blue-400 dark:focus-visible:ring-blue-500 focus-visible:ring-offset-0 ${ isSelected ? 'border-transparent bg-blue-100 text-blue-900 dark:bg-blue-900/50 dark:text-blue-100' : 'border-transparent bg-gray-50 dark:bg-gray-900/50 hover:bg-gray-100 dark:hover:bg-gray-800' } ` }
25202523 >
2521- < span className = "font-mono text-sm break-all" >
2522- < HighlightedText text = { b } highlight = { debouncedBranchFilter } />
2523- </ span >
2524- < button
2525- type = "button"
2526- onClick = { ( event ) => {
2527- event . stopPropagation ( ) ;
2528- handleDeleteBranch ( b , 'remote' ) ;
2529- } }
2530- className = "p-1 text-red-500 hover:bg-red-100 dark:hover:bg-red-900/50 rounded-full"
2531- >
2532- < TrashIcon className = "h-4 w-4" />
2533- </ button >
2524+ < div className = "flex items-center gap-2" >
2525+ < span className = "font-mono text-sm break-all" >
2526+ < HighlightedText text = { b } highlight = { debouncedBranchFilter } />
2527+ </ span >
2528+ { isProtectedRemote && < span className = "text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded bg-amber-100 text-amber-700 dark:bg-amber-900/60 dark:text-amber-200" > Protected</ span > }
2529+ </ div >
2530+ { ! isProtectedRemote && (
2531+ < button
2532+ type = "button"
2533+ onClick = { ( event ) => {
2534+ event . stopPropagation ( ) ;
2535+ handleDeleteBranch ( b , 'remote' ) ;
2536+ } }
2537+ className = "p-1 text-red-500 hover:bg-red-100 dark:hover:bg-red-900/50 rounded-full"
2538+ >
2539+ < TrashIcon className = "h-4 w-4" />
2540+ </ button >
2541+ ) }
25342542 </ div >
25352543 </ li >
25362544 ) ;
0 commit comments