@@ -397,7 +397,7 @@ class SetupAgent extends Disposable implements IChatAgentImplementation {
397
397
398
398
let result : IChatSetupResult | undefined = undefined ;
399
399
try {
400
- result = await ChatSetup . getInstance ( this . instantiationService , this . context , this . controller ) . run ( ) ;
400
+ result = await ChatSetup . getInstance ( this . instantiationService , this . context , this . controller ) . run ( { disableChatViewReveal : true /* we are already in a chat context */ } ) ;
401
401
} catch ( error ) {
402
402
this . logService . error ( `[chat setup] Error during setup: ${ toErrorMessage ( error ) } ` ) ;
403
403
} finally {
@@ -577,7 +577,7 @@ class ChatSetup {
577
577
let instance = ChatSetup . instance ;
578
578
if ( ! instance ) {
579
579
instance = ChatSetup . instance = instantiationService . invokeFunction ( accessor => {
580
- return new ChatSetup ( context , controller , instantiationService , accessor . get ( ITelemetryService ) , accessor . get ( IWorkbenchLayoutService ) , accessor . get ( IKeybindingService ) , accessor . get ( IChatEntitlementService ) , accessor . get ( ILogService ) , accessor . get ( IConfigurationService ) ) ;
580
+ return new ChatSetup ( context , controller , instantiationService , accessor . get ( ITelemetryService ) , accessor . get ( IWorkbenchLayoutService ) , accessor . get ( IKeybindingService ) , accessor . get ( IChatEntitlementService ) , accessor . get ( ILogService ) , accessor . get ( IConfigurationService ) , accessor . get ( IViewsService ) ) ;
581
581
} ) ;
582
582
}
583
583
@@ -597,19 +597,20 @@ class ChatSetup {
597
597
@IKeybindingService private readonly keybindingService : IKeybindingService ,
598
598
@IChatEntitlementService private readonly chatEntitlementService : IChatEntitlementService ,
599
599
@ILogService private readonly logService : ILogService ,
600
- @IConfigurationService private readonly configurationService : IConfigurationService
600
+ @IConfigurationService private readonly configurationService : IConfigurationService ,
601
+ @IViewsService private readonly viewsService : IViewsService
601
602
) { }
602
603
603
604
skipDialog ( ) : void {
604
605
this . skipDialogOnce = true ;
605
606
}
606
607
607
- async run ( ) : Promise < IChatSetupResult > {
608
+ async run ( options ?: { disableChatViewReveal ?: boolean } ) : Promise < IChatSetupResult > {
608
609
if ( this . pendingRun ) {
609
610
return this . pendingRun ;
610
611
}
611
612
612
- this . pendingRun = this . doRun ( ) ;
613
+ this . pendingRun = this . doRun ( options ) ;
613
614
614
615
try {
615
616
return await this . pendingRun ;
@@ -618,7 +619,7 @@ class ChatSetup {
618
619
}
619
620
}
620
621
621
- private async doRun ( ) : Promise < IChatSetupResult > {
622
+ private async doRun ( options ?: { disableChatViewReveal ?: boolean } ) : Promise < IChatSetupResult > {
622
623
const dialogSkipped = this . skipDialogOnce ;
623
624
this . skipDialogOnce = false ;
624
625
@@ -633,6 +634,12 @@ class ChatSetup {
633
634
setupStrategy = ChatSetupStrategy . SetupWithEnterpriseProvider ; // users with a configured provider go through provider setup
634
635
}
635
636
637
+ if ( setupStrategy !== ChatSetupStrategy . Canceled && ! options ?. disableChatViewReveal ) {
638
+ // Show the chat view now to better indicate progress
639
+ // while installing the extension or returning from sign in
640
+ showCopilotView ( this . viewsService , this . layoutService ) ;
641
+ }
642
+
636
643
let success = undefined ;
637
644
try {
638
645
switch ( setupStrategy ) {
@@ -838,9 +845,8 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr
838
845
839
846
await context . update ( { hidden : false } ) ;
840
847
841
- const chatWidgetPromise = showCopilotView ( viewsService , layoutService ) ;
842
848
if ( mode ) {
843
- const chatWidget = await chatWidgetPromise ;
849
+ const chatWidget = await showCopilotView ( viewsService , layoutService ) ;
844
850
chatWidget ?. input . setChatMode ( mode ) ;
845
851
}
846
852
0 commit comments