@@ -69,6 +69,7 @@ export const CortexGitPanel: Component = () => {
6969 const [ expandStash , setExpandStash ] = createSignal ( false ) ;
7070 const [ stashes , setStashes ] = createSignal < StashEntry [ ] > ( [ ] ) ;
7171 const [ stashLoading , setStashLoading ] = createSignal ( false ) ;
72+ const [ error , setError ] = createSignal < string | null > ( null ) ;
7273 let dotsRef : HTMLDivElement | undefined ;
7374
7475 const repo = ( ) => multiRepo ?. activeRepository ( ) ?? null ;
@@ -109,19 +110,22 @@ export const CortexGitPanel: Component = () => {
109110 const handleStashCreate = async ( ) => {
110111 const r = repo ( ) ;
111112 if ( ! r ) return ;
112- try { await gitStashCreate ( r . path , "" , true ) ; await fetchStashes ( ) ; refresh ( ) ; } catch { /* ignore */ }
113+ setError ( null ) ;
114+ try { await gitStashCreate ( r . path , "" , true ) ; await fetchStashes ( ) ; refresh ( ) ; } catch ( err ) { setError ( `Stash create failed: ${ err } ` ) ; }
113115 } ;
114116
115117 const handleStashPop = async ( index : number ) => {
116118 const r = repo ( ) ;
117119 if ( ! r ) return ;
118- try { await gitStashPop ( r . path , index ) ; await fetchStashes ( ) ; refresh ( ) ; } catch { /* ignore */ }
120+ setError ( null ) ;
121+ try { await gitStashPop ( r . path , index ) ; await fetchStashes ( ) ; refresh ( ) ; } catch ( err ) { setError ( `Stash pop failed: ${ err } ` ) ; }
119122 } ;
120123
121124 const handleStashDrop = async ( index : number ) => {
122125 const r = repo ( ) ;
123126 if ( ! r ) return ;
124- try { await gitStashDrop ( r . path , index ) ; await fetchStashes ( ) ; } catch { /* ignore */ }
127+ setError ( null ) ;
128+ try { await gitStashDrop ( r . path , index ) ; await fetchStashes ( ) ; } catch ( err ) { setError ( `Stash drop failed: ${ err } ` ) ; }
125129 } ;
126130
127131 const dotsAction = ( action : string ) => {
@@ -201,6 +205,14 @@ export const CortexGitPanel: Component = () => {
201205 </ label >
202206 </ div >
203207
208+ < Show when = { error ( ) } >
209+ < div style = { { display : "flex" , "align-items" : "center" , gap : "8px" , padding : "8px 12px" , background : "rgba(239,68,68,0.1)" , color : "#ef4444" , "font-size" : "13px" } } >
210+ < CortexIcon name = "alert-circle" size = { 14 } color = "#ef4444" />
211+ < span style = { { flex : 1 , overflow : "hidden" , "text-overflow" : "ellipsis" , "white-space" : "nowrap" } } > { error ( ) } </ span >
212+ < button onClick = { ( ) => setError ( null ) } style = { { background : "transparent" , border : "none" , color : "#ef4444" , cursor : "pointer" , padding : "2px" } } > ✕</ button >
213+ </ div >
214+ </ Show >
215+
204216 < div style = { { flex : 1 , overflow : "auto" } } >
205217 < SectionHeader title = "Changes" count = { unstaged ( ) . length } expanded = { expandChanges ( ) } onToggle = { ( ) => setExpandChanges ( ( v ) => ! v ) } actions = {
206218 < >
0 commit comments