33 getHistory ,
44 getCommitFiles ,
55 getCommitParents ,
6+ getLocalOnlyBranches ,
67 getStaleBranches ,
78 type CommitInfo ,
89 type CommitFile ,
@@ -203,6 +204,7 @@ export function HistoryTab({ repoPath, filePath, refreshKey, onRefresh, onFileSe
203204 const [ fileCtxMenu , setFileCtxMenu ] = useState < { x : number ; y : number ; absolutePath : string } | null > ( null ) ;
204205 const [ allBranches , setAllBranches ] = useState ( true ) ;
205206 const [ staleBranches , setStaleBranches ] = useState < Set < string > > ( new Set ( ) ) ;
207+ const [ localOnlyBranches , setLocalOnlyBranches ] = useState < Set < string > > ( new Set ( ) ) ;
206208
207209 // ── load history ──────────────────────────────────────────────────────────
208210
@@ -235,6 +237,9 @@ export function HistoryTab({ repoPath, filePath, refreshKey, onRefresh, onFileSe
235237 getStaleBranches ( repoPath )
236238 . then ( ( branches ) => setStaleBranches ( new Set ( branches ) ) )
237239 . catch ( ( ) => setStaleBranches ( new Set ( ) ) ) ;
240+ getLocalOnlyBranches ( repoPath )
241+ . then ( ( branches ) => setLocalOnlyBranches ( new Set ( branches ) ) )
242+ . catch ( ( ) => setLocalOnlyBranches ( new Set ( ) ) ) ;
238243 } , [ repoPath , refreshKey ] ) ;
239244
240245 // ── select commit → load files + parents ─────────────────────────────────
@@ -346,9 +351,10 @@ export function HistoryTab({ repoPath, filePath, refreshKey, onRefresh, onFileSe
346351 < div className = "flex-1 min-w-0 flex items-center gap-1" >
347352 { refs . map ( ( r , i ) => {
348353 const isStale = r . kind === "remote" && staleBranches . has ( r . label ) ;
354+ const isLocalOnly = ( r . kind === "branch" || r . kind === "head" ) && localOnlyBranches . has ( r . label ) ;
349355 return (
350- < span key = { i } className = { `inline-flex items-center shrink-0 leading-4 overflow-hidden ${ isStale ? "rounded border border-red-950 bg-red-600" : "rounded "} ` } >
351- < span className = { `text-[10px] px-1 leading-4 inline-flex items-center gap-0.5 ${ isStale ? "bg-red-800 text-white" : REF_BADGE [ r . kind ] } ` } >
356+ < span key = { i } className = { `inline-flex items-center shrink-0 leading-4 overflow-hidden rounded ${ isStale ? "border border-red-950 bg-red-600" : isLocalOnly ? "border border-orange-950 bg-orange-500" : " "} ` } >
357+ < span className = { `text-[10px] px-1 leading-4 inline-flex items-center gap-0.5 ${ isStale ? "bg-red-800 text-white" : isLocalOnly ? "bg-orange-700 text-white" : REF_BADGE [ r . kind ] } ` } >
352358 { ( r . kind === "head" || r . kind === "branch" || r . kind === "remote" ) && (
353359 < svg width = "10" height = "10" viewBox = "0 0 16 16" fill = "currentColor" className = "shrink-0" >
354360 < path d = "M11.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zm-2.25.75a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25zM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zM3.5 3.25a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0z" />
@@ -367,6 +373,12 @@ export function HistoryTab({ repoPath, filePath, refreshKey, onRefresh, onFileSe
367373 < span className = "text-[10px] px-1 leading-4 text-white" > deleted on remote</ span >
368374 </ >
369375 ) }
376+ { isLocalOnly && (
377+ < >
378+ < span className = "self-stretch w-px bg-orange-950" />
379+ < span className = "text-[10px] px-1 leading-4 text-white" > local only</ span >
380+ </ >
381+ ) }
370382 </ span >
371383 ) ;
372384 } ) }
0 commit comments