Skip to content

Commit 5368bb1

Browse files
authored
Update chat widget welcome view and telemetry logging (microsoft#253121)
* Update chat widget welcome view and telemetry logging - Localize the welcome title in the chat widget. - Update max width for chat inputs - Integrate telemetry logging for suggested prompt clicks in the chat view welcome part. * Rename telemetry event for suggested prompt clicks to improve clarity
1 parent f44887a commit 5368bb1

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

src/vs/workbench/contrib/chat/browser/chatWidget.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
788788
private getExpWelcomeViewContent(): IChatViewWelcomeContent {
789789
const baseMessage = localize('chatMessage', "Copilot is powered by AI, so mistakes are possible. Review output carefully before use.");
790790
const welcomeContent = {
791-
title: 'Get Started with VS Code',
791+
title: localize('expChatTitle', 'Get Started with VS Code'),
792792
message: new MarkdownString(baseMessage),
793793
icon: Codicon.copilotLarge,
794794
suggestedPrompts: this.getExpSuggestedPrompts(),
@@ -1725,7 +1725,14 @@ export class ChatWidget extends Disposable implements IChatWidget {
17251725
if (this.viewModel?.editing) {
17261726
this.inlineInputPart?.layout(layoutHeight, width);
17271727
}
1728-
this.inputPart.layout(layoutHeight, width);
1728+
1729+
if (this.container.classList.contains('experimental-welcome-view')) {
1730+
this.inputPart.layout(layoutHeight, Math.min(width, 700));
1731+
}
1732+
else {
1733+
this.inputPart.layout(layoutHeight, width);
1734+
}
1735+
17291736
const inputHeight = this.inputPart.inputPartHeight;
17301737
const lastElementVisible = this.tree.scrollTop + this.tree.renderHeight >= this.tree.scrollHeight - 2;
17311738

src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
overflow: hidden;
2222
}
2323

24+
.interactive-session .experimental-welcome-view & > .chat-welcome-view-input-part {
25+
max-width: 700px;
26+
}
27+
2428
/* Container for ChatViewPane welcome view */
2529
.pane-body > .chat-view-welcome {
2630
flex-direction: column;

src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { defaultButtonStyles } from '../../../../../platform/theme/browser/defau
2020
import { ChatAgentLocation } from '../../common/constants.js';
2121
import { chatViewsWelcomeRegistry, IChatViewsWelcomeDescriptor } from './chatViewsWelcome.js';
2222
import { IChatWidgetService } from '../chat.js';
23+
import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js';
2324

2425
const $ = dom.$;
2526

@@ -139,6 +140,7 @@ export class ChatViewWelcomePart extends Disposable {
139140
@IInstantiationService private instantiationService: IInstantiationService,
140141
@ILogService private logService: ILogService,
141142
@IChatWidgetService private chatWidgetService: IChatWidgetService,
143+
@ITelemetryService private telemetryService: ITelemetryService,
142144
) {
143145
super();
144146
this.element = dom.$('.chat-welcome-view');
@@ -199,6 +201,19 @@ export class ChatViewWelcomePart extends Disposable {
199201
const labelElement = dom.append(promptElement, $('.chat-welcome-view-suggested-prompt-label'));
200202
labelElement.textContent = prompt.label;
201203
this._register(dom.addDisposableListener(promptElement, dom.EventType.CLICK, () => {
204+
205+
type SuggestedPromptClickEvent = { suggestedPrompt: string };
206+
207+
type SuggestedPromptClickData = {
208+
owner: 'bhavyaus';
209+
comment: 'Event used to gain insights into when suggested prompts are clicked.';
210+
suggestedPrompt: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The suggested prompt clicked.' };
211+
};
212+
213+
this.telemetryService.publicLog2<SuggestedPromptClickEvent, SuggestedPromptClickData>('chat.clickedSuggestedPrompt', {
214+
suggestedPrompt: prompt.prompt,
215+
});
216+
202217
this.chatWidgetService.lastFocusedWidget?.setInput(prompt.prompt);
203218
}));
204219
}

0 commit comments

Comments
 (0)