@@ -115,6 +115,7 @@ export function SessionControls({ ws, activeSession, inputRef, onAfterAction, on
115115 // File upload state
116116 const fileInputRef = useRef < HTMLInputElement > ( null ) ;
117117 const [ uploading , setUploading ] = useState ( false ) ;
118+ const [ uploadProgress , setUploadProgress ] = useState ( 0 ) ;
118119 const [ uploadError , setUploadError ] = useState < string | null > ( null ) ;
119120
120121 // Keep external inputRef in sync so parent can call .focus()
@@ -309,11 +310,12 @@ export function SessionControls({ ws, activeSession, inputRef, onAfterAction, on
309310 const handleFileUpload = useCallback ( async ( files : FileList | null ) => {
310311 if ( ! files || files . length === 0 || ! serverId ) return ;
311312 setUploading ( true ) ;
313+ setUploadProgress ( 0 ) ;
312314 setUploadError ( null ) ;
313315 const paths : string [ ] = [ ] ;
314316 for ( const file of Array . from ( files ) ) {
315317 try {
316- const result = await uploadFile ( serverId , file ) ;
318+ const result = await uploadFile ( serverId , file , ( pct ) => setUploadProgress ( pct ) ) ;
317319 if ( result . attachment ?. daemonPath ) {
318320 paths . push ( '@' + result . attachment . daemonPath + ' ' ) ;
319321 }
@@ -504,6 +506,16 @@ export function SessionControls({ ws, activeSession, inputRef, onAfterAction, on
504506 ) }
505507 </ div > }
506508
509+ { /* Upload progress bar */ }
510+ { uploading && (
511+ < div style = { { margin : '0 8px 4px' , height : 18 , display : 'flex' , alignItems : 'center' , gap : 8 } } >
512+ < div style = { { flex : 1 , height : 4 , background : 'rgba(255,255,255,0.1)' , borderRadius : 2 , overflow : 'hidden' } } >
513+ < div style = { { width : `${ uploadProgress } %` , height : '100%' , background : '#3b82f6' , borderRadius : 2 , transition : 'width 0.2s ease' } } />
514+ </ div >
515+ < span style = { { fontSize : 11 , color : '#94a3b8' , minWidth : 32 } } > { uploadProgress } %</ span >
516+ </ div >
517+ ) }
518+
507519 { /* Upload error banner */ }
508520 { uploadError && (
509521 < div style = { { padding : '4px 12px' , fontSize : 12 , color : '#ef4444' , background : 'rgba(239,68,68,0.1)' , borderRadius : 4 , margin : '0 8px 4px' } } >
0 commit comments