@@ -882,18 +882,61 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We
882882 const currentCline = provider . getCurrentCline ( )
883883 if ( currentCline ) {
884884 try {
885+ // First send a message to the webview to show a progress indicator
886+ provider . postMessageToWebview ( {
887+ type : "summarizationStatus" ,
888+ status : "started" ,
889+ text : t ( "common:info.summarizing_context" ) ,
890+ } )
891+
885892 // Notify user that summarization is in progress
886893 vscode . window . showInformationMessage ( t ( "common:info.summarizing_context" ) )
887894
895+ // Add a "summarizing" message to the chat
896+ await currentCline . say ( "summarizing" , t ( "common:info.summarizing_context" ) , undefined , true )
897+
888898 // Trigger the summarization process
889899 await currentCline . summarizeConversationContext ( true ) // true indicates manual trigger
890900
901+ // Update the "summarizing" message to show completion
902+ const lastMessage = currentCline . clineMessages . at ( - 1 )
903+ if ( lastMessage && lastMessage . say === "summarizing" && lastMessage . partial ) {
904+ lastMessage . text = t ( "common:info.summarization_complete" )
905+ lastMessage . partial = false
906+ await currentCline . saveClineMessages ( )
907+ await provider . postStateToWebview ( )
908+ }
909+
910+ // Send a message to the webview to hide the progress indicator
911+ provider . postMessageToWebview ( {
912+ type : "summarizationStatus" ,
913+ status : "completed" ,
914+ text : t ( "common:info.summarization_complete" ) ,
915+ } )
916+
891917 // Notify user that summarization is complete
892918 vscode . window . showInformationMessage ( t ( "common:info.summarization_complete" ) )
893919 } catch ( error ) {
894920 provider . log (
895921 `Error during manual summarization: ${ JSON . stringify ( error , Object . getOwnPropertyNames ( error ) , 2 ) } ` ,
896922 )
923+
924+ // Update the UI to show the error
925+ provider . postMessageToWebview ( {
926+ type : "summarizationStatus" ,
927+ status : "failed" ,
928+ text : t ( "common:errors.summarization_failed" ) ,
929+ } )
930+
931+ // Update any partial message
932+ const lastMessage = currentCline . clineMessages . at ( - 1 )
933+ if ( lastMessage && lastMessage . say === "summarizing" && lastMessage . partial ) {
934+ lastMessage . text = t ( "common:errors.summarization_failed" )
935+ lastMessage . partial = false
936+ await currentCline . saveClineMessages ( )
937+ await provider . postStateToWebview ( )
938+ }
939+
897940 vscode . window . showErrorMessage ( t ( "common:errors.summarization_failed" ) )
898941 }
899942 }
0 commit comments