@@ -40,7 +40,7 @@ import { buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHo
40
40
import { asCssVariable } from '../../../../platform/theme/common/colorUtils.js' ;
41
41
import { IThemeService } from '../../../../platform/theme/common/themeService.js' ;
42
42
import { checkModeOption } from '../common/chat.js' ;
43
- import { IChatAgentCommand , IChatAgentData , IChatAgentService , IChatWelcomeMessageContent } from '../common/chatAgents.js' ;
43
+ import { IChatAgentCommand , IChatAgentData , IChatAgentService } from '../common/chatAgents.js' ;
44
44
import { ChatContextKeys } from '../common/chatContextKeys.js' ;
45
45
import { applyingChatEditsFailedContextKey , decidedChatEditingResourceContextKey , hasAppliedChatEditsContextKey , hasUndecidedChatEditingResourceContextKey , IChatEditingService , IChatEditingSession , inChatEditingSessionContextKey , ModifiedFileEntryState } from '../common/chatEditingService.js' ;
46
46
import { ChatPauseState , IChatModel , IChatResponseModel } from '../common/chatModel.js' ;
@@ -65,12 +65,13 @@ import { ChatEditorOptions } from './chatOptions.js';
65
65
import './media/chat.css' ;
66
66
import './media/chatAgentHover.css' ;
67
67
import './media/chatViewWelcome.css' ;
68
- import { ChatViewWelcomePart } from './viewsWelcome/chatViewWelcomeController.js' ;
68
+ import { ChatViewWelcomePart , IChatSuggestedPrompts , IChatViewWelcomeContent } from './viewsWelcome/chatViewWelcomeController.js' ;
69
69
import { MicrotaskDelay } from '../../../../base/common/symbols.js' ;
70
70
import { IChatRequestVariableEntry , ChatRequestVariableSet as ChatRequestVariableSet , isPromptFileVariableEntry , toPromptFileVariableEntry , PromptFileVariableKind } from '../common/chatVariableEntries.js' ;
71
71
import { PromptsConfig } from '../common/promptSyntax/config/config.js' ;
72
72
import { CancellationToken } from '../../../../base/common/cancellation.js' ;
73
73
import { ComputeAutomaticInstructions } from '../common/promptSyntax/computeAutomaticInstructions.js' ;
74
+ import { startupExpContext , StartupExperimentGroup } from '../../../services/coreExperimentation/common/coreExperimentationService.js' ;
74
75
75
76
const $ = dom . $ ;
76
77
@@ -711,22 +712,43 @@ export class ChatWidget extends Disposable implements IChatWidget {
711
712
}
712
713
713
714
private renderWelcomeViewContentIfNeeded ( ) {
715
+
716
+ // reset the input in welcome view if it was rendered in experimental mode
717
+ if ( this . container . classList . contains ( 'experimental-welcome-view' ) ) {
718
+ this . container . classList . remove ( 'experimental-welcome-view' ) ;
719
+ const renderFollowups = this . viewOptions . renderFollowups ?? false ;
720
+ const renderStyle = this . viewOptions . renderStyle ;
721
+ this . createInput ( this . container , { renderFollowups, renderStyle } ) ;
722
+ }
723
+
714
724
if ( this . viewOptions . renderStyle === 'compact' || this . viewOptions . renderStyle === 'minimal' ) {
715
725
return ;
716
726
}
717
727
718
728
const numItems = this . viewModel ?. getItems ( ) . length ?? 0 ;
719
729
if ( ! numItems ) {
720
- const welcomeContent = this . getWelcomeViewContent ( ) ;
721
730
dom . clearNode ( this . welcomeMessageContainer ) ;
722
- const tips = this . input . currentModeKind === ChatModeKind . Ask
723
- ? new MarkdownString ( localize ( 'chatWidget.tips' , "{0} or type {1} to attach context\n\n{2} to chat with extensions\n\nType {3} to use commands" , '$(attach)' , '#' , '$(mention)' , '/' ) , { supportThemeIcons : true } )
724
- : new MarkdownString ( localize ( 'chatWidget.tips.withoutParticipants' , "{0} or type {1} to attach context" , '$(attach)' , '#' ) , { supportThemeIcons : true } ) ;
725
731
const defaultAgent = this . chatAgentService . getDefaultAgent ( this . location , this . input . currentModeKind ) ;
726
732
const additionalMessage = defaultAgent ?. metadata . additionalWelcomeMessage ;
733
+
734
+ const startupExpValue = startupExpContext . getValue ( this . contextKeyService ) ;
735
+ let welcomeContent : IChatViewWelcomeContent ;
736
+ if ( startupExpValue === StartupExperimentGroup . MaximizedChat
737
+ || startupExpValue === StartupExperimentGroup . SplitEmptyEditorChat
738
+ || startupExpValue === StartupExperimentGroup . SplitWelcomeChat ) {
739
+ welcomeContent = this . getExpWelcomeViewContent ( ) ;
740
+ this . container . classList . add ( 'experimental-welcome-view' ) ;
741
+ }
742
+ else {
743
+ const tips = this . input . currentModeKind === ChatModeKind . Ask
744
+ ? new MarkdownString ( localize ( 'chatWidget.tips' , "{0} or type {1} to attach context\n\n{2} to chat with extensions\n\nType {3} to use commands" , '$(attach)' , '#' , '$(mention)' , '/' ) , { supportThemeIcons : true } )
745
+ : new MarkdownString ( localize ( 'chatWidget.tips.withoutParticipants' , "{0} or type {1} to attach context" , '$(attach)' , '#' ) , { supportThemeIcons : true } ) ;
746
+ welcomeContent = this . getWelcomeViewContent ( ) ;
747
+ welcomeContent . tips = tips ;
748
+ }
727
749
this . welcomePart . value = this . instantiationService . createInstance (
728
750
ChatViewWelcomePart ,
729
- { ...welcomeContent , tips , additionalMessage } ,
751
+ { ...welcomeContent , additionalMessage } ,
730
752
{
731
753
location : this . location ,
732
754
isWidgetAgentWelcomeViewContent : this . input ?. currentModeKind === ChatModeKind . Agent
@@ -741,7 +763,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
741
763
}
742
764
}
743
765
744
- private getWelcomeViewContent ( ) : IChatWelcomeMessageContent {
766
+ private getWelcomeViewContent ( ) : IChatViewWelcomeContent {
745
767
const baseMessage = localize ( 'chatMessage' , "Copilot is powered by AI, so mistakes are possible. Review output carefully before use." ) ;
746
768
if ( this . input . currentModeKind === ChatModeKind . Ask ) {
747
769
return {
@@ -764,6 +786,35 @@ export class ChatWidget extends Disposable implements IChatWidget {
764
786
}
765
787
}
766
788
789
+ private getExpWelcomeViewContent ( ) : IChatViewWelcomeContent {
790
+ const baseMessage = localize ( 'chatMessage' , "Copilot is powered by AI, so mistakes are possible. Review output carefully before use." ) ;
791
+ const welcomeContent = {
792
+ title : 'Get Started with VS Code' ,
793
+ message : new MarkdownString ( baseMessage ) ,
794
+ icon : Codicon . copilotLarge ,
795
+ suggestedPrompts : this . getExpSuggestedPrompts ( ) ,
796
+ inputPart : this . inputPart . element ,
797
+ } ;
798
+ return welcomeContent ;
799
+ }
800
+
801
+ private getExpSuggestedPrompts ( ) : IChatSuggestedPrompts [ ] {
802
+
803
+ return [
804
+ {
805
+ icon : Codicon . vscode ,
806
+ label : localize ( 'chatWidget.suggestedPrompts.gettingStarted' , "Ask @vscode" ) ,
807
+ prompt : '@vscode Help me get started with VS Code?' ,
808
+ } ,
809
+ {
810
+ icon : Codicon . newFolder ,
811
+ label : localize ( 'chatWidget.suggestedPrompts.newProject' , "Create a #new Project" ) ,
812
+ prompt : '#new Create a new project for me' ,
813
+ }
814
+ ] ;
815
+ }
816
+
817
+
767
818
private async renderChatEditingSessionState ( ) {
768
819
if ( ! this . input ) {
769
820
return ;
0 commit comments