File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,10 +76,10 @@ newSession :: SessionConfig -> IO Session
7676newSession cfg = newSessionStreaming cfg (\ _ -> pure () )
7777
7878newSessionStreaming :: SessionConfig -> (Text -> IO () ) -> IO Session
79- newSessionStreaming cfg onStderrLine = do
79+ newSessionStreaming cfg onStartupLine = do
8080 (hIn, hOut, hErr, ph) <- createGhciProcess cfg
81- sess <- buildSessionState cfg hIn hOut hErr ph onStderrLine
82- initializeGhci sess
81+ sess <- buildSessionState cfg hIn hOut hErr ph onStartupLine
82+ initializeGhci sess onStartupLine
8383 pure sess
8484
8585createGhciProcess :: SessionConfig -> IO (Handle , Handle , Handle , ProcessHandle )
@@ -141,13 +141,13 @@ buildSessionState cfg hIn hOut hErr ph onStderrLine = do
141141 , sessErrCallback = cbRef
142142 }
143143
144- initializeGhci :: Session -> IO ()
145- initializeGhci sess = do
144+ initializeGhci :: Session -> ( Text -> IO () ) -> IO ()
145+ initializeGhci sess onLine = do
146146 clearGhciPrompt sess
147147 sendRaw sess (" :cd " ++ scWorkDir (sessConfig sess))
148148 mk <- getMarker sess
149149 placeMarker sess mk
150- _ <- drainUntilMarker sess mk
150+ _ <- drainUntilMarkerStreaming (sessLines sess) mk onLine
151151 pure ()
152152
153153resetSession :: Session -> IO Session
Original file line number Diff line number Diff line change 524524 .build-modal-title { flex : 1 ; font-weight : 500 ; }
525525 .build-modal-title .ok { color : var (--green ); }
526526 .build-modal-title .err { color : var (--red ); }
527+ .build-spinner {
528+ width : 12px ; height : 12px ; border-radius : 50% ;
529+ border : 2px solid var (--border ); border-top-color : var (--accent );
530+ animation : build-spin 0.8s linear infinite; flex-shrink : 0 ;
531+ }
532+ .build-modal-title .ok ~ .build-spinner ,
533+ .build-modal-title .err ~ .build-spinner { display : none; }
534+ @keyframes build-spin { to { transform : rotate (360deg ); } }
527535 .build-modal-close {
528536 background : none; border : none; color : var (--fg-dim ); cursor : pointer;
529537 font-size : 18px ; line-height : 1 ; padding : 0 2px ;
@@ -554,6 +562,7 @@ <h2>Connect to AI</h2>
554562< div id ="build-modal " class ="build-modal " style ="display:none " role ="dialog " aria-label ="Build log ">
555563 < div class ="build-modal-header ">
556564 < span class ="build-modal-title " id ="build-modal-title "> Building…</ span >
565+ < span class ="build-spinner " aria-hidden ="true "> </ span >
557566 < button class ="build-modal-close " onclick ="closeBuildModal() " aria-label ="Close build log "> ×</ button >
558567 </ div >
559568 < div class ="build-modal-body " id ="build-log "> </ div >
You can’t perform that action at this time.
0 commit comments