@@ -68,7 +68,6 @@ import { CHAT_CATEGORY, CHAT_OPEN_ACTION_ID, CHAT_SETUP_ACTION_ID } from './acti
68
68
import { ChatViewId , IChatWidgetService , showCopilotView } from './chat.js' ;
69
69
import { CHAT_SIDEBAR_PANEL_ID } from './chatViewPane.js' ;
70
70
import { coalesce } from '../../../../base/common/arrays.js' ;
71
- import { ThemeIcon } from '../../../../base/common/themables.js' ;
72
71
import { IButton } from '../../../../base/browser/ui/button/button.js' ;
73
72
import { ChatMode2 } from '../common/chatModes.js' ;
74
73
import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js' ;
@@ -592,7 +591,7 @@ class ChatSetup {
592
591
let instance = ChatSetup . instance ;
593
592
if ( ! instance ) {
594
593
instance = ChatSetup . instance = instantiationService . invokeFunction ( accessor => {
595
- return new ChatSetup ( context , controller , instantiationService , accessor . get ( ITelemetryService ) , accessor . get ( IWorkbenchLayoutService ) , accessor . get ( IKeybindingService ) , accessor . get ( IChatEntitlementService ) as ChatEntitlementService , accessor . get ( ILogService ) , accessor . get ( IConfigurationService ) , accessor . get ( IViewsService ) , accessor . get ( IProductService ) , accessor . get ( IOpenerService ) ) ;
594
+ return new ChatSetup ( context , controller , instantiationService , accessor . get ( ITelemetryService ) , accessor . get ( IWorkbenchLayoutService ) , accessor . get ( IKeybindingService ) , accessor . get ( IChatEntitlementService ) as ChatEntitlementService , accessor . get ( ILogService ) , accessor . get ( IConfigurationService ) , accessor . get ( IViewsService ) , accessor . get ( IOpenerService ) ) ;
596
595
} ) ;
597
596
}
598
597
@@ -614,7 +613,6 @@ class ChatSetup {
614
613
@ILogService private readonly logService : ILogService ,
615
614
@IConfigurationService private readonly configurationService : IConfigurationService ,
616
615
@IViewsService private readonly viewsService : IViewsService ,
617
- @IProductService private readonly productService : IProductService ,
618
616
@IOpenerService private readonly openerService : IOpenerService ,
619
617
) { }
620
618
@@ -691,40 +689,20 @@ class ChatSetup {
691
689
}
692
690
693
691
private async showDialog ( ) : Promise < ChatSetupStrategy > {
694
- let dialogVariant = this . configurationService . getValue < 'default' | 'brand-gh' | 'brand-vsc' | 'style-glow' | 'account-create' | unknown > ( 'chat.setup.signInDialogVariant' ) ;
695
- if ( this . context . state . entitlement !== ChatEntitlement . Unknown && dialogVariant === 'account-create' ) {
696
- dialogVariant = 'default' ; // fallback to modern/default for users that are signed in already
697
- }
698
-
699
692
const disposables = new DisposableStore ( ) ;
700
693
694
+ const dialogVariant = this . configurationService . getValue < 'default' | 'alternate-first' | 'alternate-color' | 'alternate-monochrome' | unknown > ( 'chat.setup.signInDialogVariant' ) ;
701
695
const buttons = this . getButtons ( dialogVariant ) ;
702
696
703
- let icon : ThemeIcon ;
704
- switch ( dialogVariant ) {
705
- case 'brand-gh' :
706
- icon = Codicon . github ;
707
- break ;
708
- case 'brand-vsc' :
709
- icon = this . productService . quality === 'stable' ? Codicon . vscode : this . productService . quality === 'insider' ? Codicon . vscodeInsiders : Codicon . codeOss ;
710
- break ;
711
- default :
712
- icon = Codicon . copilotLarge ;
713
- break ;
714
- }
715
-
716
697
const dialog = disposables . add ( new Dialog (
717
698
this . layoutService . activeContainer ,
718
- this . getDialogTitle ( dialogVariant ) ,
699
+ this . getDialogTitle ( ) ,
719
700
buttons . map ( button => button [ 0 ] ) ,
720
701
createWorkbenchDialogOptions ( {
721
702
type : 'none' ,
722
- extraClasses : coalesce ( [
723
- 'chat-setup-dialog' ,
724
- dialogVariant === 'style-glow' ? 'chat-setup-glow' : undefined
725
- ] ) ,
703
+ extraClasses : [ 'chat-setup-dialog' ] ,
726
704
detail : ' ' , // workaround allowing us to render the message in large
727
- icon,
705
+ icon : Codicon . copilotLarge ,
728
706
alignment : DialogContentsAlignment . Vertical ,
729
707
cancelId : buttons . length - 1 ,
730
708
disableCloseButton : true ,
@@ -739,77 +717,54 @@ class ChatSetup {
739
717
return buttons [ button ] ?. [ 1 ] ?? ChatSetupStrategy . Canceled ;
740
718
}
741
719
742
- private getButtons ( variant : unknown ) : Array < [ string , ChatSetupStrategy , { styleButton ?: ( button : IButton ) => void } | undefined ] > {
720
+ private getButtons ( variant : 'default' | 'alternate-first' | 'alternate-color' | 'alternate-monochrome' | unknown ) : Array < [ string , ChatSetupStrategy , { styleButton ?: ( button : IButton ) => void } | undefined ] > {
743
721
let buttons : Array < [ string , ChatSetupStrategy , { styleButton ?: ( button : IButton ) => void } | undefined ] > ;
744
722
745
723
if ( this . context . state . entitlement === ChatEntitlement . Unknown ) {
746
724
let alternateProvider : 'off' | 'monochrome' | 'colorful' | 'first' = 'off' ;
747
- const alternateProviderSetting : unknown = this . configurationService . getValue ( 'chat.setup.signInWithAlternateProvider' ) ;
748
- if ( alternateProviderSetting === true ) {
749
- alternateProvider = 'colorful' ;
750
- } else if ( alternateProviderSetting === 'monochrome' || alternateProviderSetting === 'colorful' || alternateProviderSetting === 'first' ) {
751
- alternateProvider = alternateProviderSetting ;
725
+ if ( defaultChat . alternativeProviderId ) {
726
+ switch ( variant ) {
727
+ case 'alternate-first' :
728
+ alternateProvider = 'first' ;
729
+ break ;
730
+ case 'alternate-color' :
731
+ alternateProvider = 'colorful' ;
732
+ break ;
733
+ case 'alternate-monochrome' :
734
+ alternateProvider = 'monochrome' ;
735
+ break ;
736
+ }
752
737
}
753
738
754
- const enableAlternateProvider = alternateProvider !== 'off' && defaultChat . alternativeProviderId ;
755
-
756
739
if ( ChatEntitlementRequests . providerId ( this . configurationService ) === defaultChat . enterpriseProviderId ) {
757
740
buttons = coalesce ( [
758
741
[ localize ( 'continueWith' , "Continue with {0}" , defaultChat . enterpriseProviderName ) , ChatSetupStrategy . SetupWithEnterpriseProvider , {
759
- styleButton : button => {
760
- button . element . classList . add ( 'continue-button' , 'default' ) ;
761
- }
742
+ styleButton : button => button . element . classList . add ( 'continue-button' , 'default' )
762
743
} ] ,
763
- enableAlternateProvider ? [ localize ( 'continueWith' , "Continue with {0}" , defaultChat . alternativeProviderName ) , ChatSetupStrategy . SetupWithAlternateProvider , {
764
- styleButton : button => {
765
- button . element . classList . add ( 'continue-button' , 'alternate' , alternateProvider ) ;
766
- }
744
+ alternateProvider !== 'off' ? [ localize ( 'continueWith' , "Continue with {0}" , defaultChat . alternativeProviderName ) , ChatSetupStrategy . SetupWithAlternateProvider , {
745
+ styleButton : button => button . element . classList . add ( 'continue-button' , 'alternate' , alternateProvider )
767
746
} ] : undefined ,
768
- [ variant !== 'account-create' ? localize ( 'signInWithProvider' , "Sign in with a {0} account" , defaultChat . providerName ) : localize ( 'continueWithProvider' , "Continue with {0}" , defaultChat . providerName ) , ChatSetupStrategy . SetupWithoutEnterpriseProvider , {
769
- styleButton : button => {
770
- if ( variant !== 'account-create' ) {
771
- button . element . classList . add ( 'link-button' ) ;
772
- } else {
773
- button . element . classList . add ( 'continue-button' , 'default' ) ;
774
- }
775
- }
747
+ [ localize ( 'signInWithProvider' , "Sign in with a {0} account" , defaultChat . providerName ) , ChatSetupStrategy . SetupWithoutEnterpriseProvider , {
748
+ styleButton : button => button . element . classList . add ( 'link-button' )
776
749
} ]
777
750
] ) ;
778
751
} else {
779
752
buttons = coalesce ( [
780
753
[ localize ( 'continueWith' , "Continue with {0}" , defaultChat . providerName ) , ChatSetupStrategy . SetupWithoutEnterpriseProvider , {
781
- styleButton : button => {
782
- button . element . classList . add ( 'continue-button' , 'default' ) ;
783
- }
754
+ styleButton : button => button . element . classList . add ( 'continue-button' , 'default' )
784
755
} ] ,
785
- enableAlternateProvider ? [ localize ( 'continueWith' , "Continue with {0}" , defaultChat . alternativeProviderName ) , ChatSetupStrategy . SetupWithAlternateProvider , {
786
- styleButton : button => {
787
- button . element . classList . add ( 'continue-button' , 'alternate' , alternateProvider ) ;
788
- }
756
+ alternateProvider !== 'off' ? [ localize ( 'continueWith' , "Continue with {0}" , defaultChat . alternativeProviderName ) , ChatSetupStrategy . SetupWithAlternateProvider , {
757
+ styleButton : button => button . element . classList . add ( 'continue-button' , 'alternate' , alternateProvider )
789
758
} ] : undefined ,
790
- [ variant !== 'account-create' ? localize ( 'signInWithProvider' , "Sign in with a {0} account" , defaultChat . enterpriseProviderName ) : localize ( 'continueWithProvider' , "Continue with {0}" , defaultChat . enterpriseProviderName ) , ChatSetupStrategy . SetupWithEnterpriseProvider , {
791
- styleButton : button => {
792
- if ( variant !== 'account-create' ) {
793
- button . element . classList . add ( 'link-button' ) ;
794
- } else {
795
- button . element . classList . add ( 'continue-button' , 'default' ) ;
796
- }
797
- }
759
+ [ localize ( 'signInWithProvider' , "Sign in with a {0} account" , defaultChat . enterpriseProviderName ) , ChatSetupStrategy . SetupWithEnterpriseProvider , {
760
+ styleButton : button => button . element . classList . add ( 'link-button' )
798
761
} ]
799
762
] ) ;
800
763
}
801
764
802
- if ( enableAlternateProvider && alternateProvider === 'first' ) {
765
+ if ( alternateProvider === 'first' ) {
803
766
[ buttons [ 0 ] , buttons [ 1 ] ] = [ buttons [ 1 ] , buttons [ 0 ] ] ;
804
767
}
805
-
806
- if ( variant === 'account-create' ) {
807
- buttons . push ( [ localize ( 'createAccount' , "Create a New Account" ) , ChatSetupStrategy . SetupWithAccountCreate , {
808
- styleButton : button => {
809
- button . element . classList . add ( 'link-button' ) ;
810
- }
811
- } ] ) ;
812
- }
813
768
} else {
814
769
buttons = [ [ localize ( 'setupCopilotButton' , "Set up Copilot" ) , ChatSetupStrategy . DefaultSetup , undefined ] ] ;
815
770
}
@@ -819,26 +774,12 @@ class ChatSetup {
819
774
return buttons ;
820
775
}
821
776
822
- private getDialogTitle ( variant : unknown ) : string {
777
+ private getDialogTitle ( ) : string {
823
778
if ( this . context . state . entitlement === ChatEntitlement . Unknown ) {
824
- switch ( variant ) {
825
- case 'brand-gh' :
826
- return localize ( 'signInGH' , "Sign in to use {0} Copilot" , defaultChat . providerName ) ;
827
- case 'brand-vsc' :
828
- return localize ( 'signInVSC' , "Sign in to use AI" ) ;
829
- default :
830
- return localize ( 'signIn' , "Sign in to use Copilot" ) ;
831
- }
779
+ return localize ( 'signIn' , "Sign in to use Copilot" ) ;
832
780
}
833
781
834
- switch ( variant ) {
835
- case 'brand-gh' :
836
- return localize ( 'startUsingGh' , "Start using {0} Copilot" , defaultChat . providerName ) ;
837
- case 'brand-vsc' :
838
- return localize ( 'startUsingVSC' , "Start using AI" ) ;
839
- default :
840
- return localize ( 'startUsing' , "Start using Copilot" ) ;
841
- }
782
+ return localize ( 'startUsing' , "Start using Copilot" ) ;
842
783
}
843
784
844
785
private createDialogFooter ( disposables : DisposableStore ) : HTMLElement {
0 commit comments