Skip to content

Commit 268d4cf

Browse files
authored
chat - tweaks to welcome (microsoft#234343)
1 parent ec8a019 commit 268d4cf

File tree

4 files changed

+16
-26
lines changed

4 files changed

+16
-26
lines changed

src/vs/workbench/contrib/chat/browser/chatSetup.contribution.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,25 +171,27 @@ class ChatSetupContribution extends Disposable implements IWorkbenchContribution
171171
ChatContextKeys.Setup.installed.negate()
172172
)!,
173173
icon: defaultChat.icon,
174-
progress: localize('setupChatSigningIn', "Signing in to {0}...", defaultChat.providerName),
174+
disableFirstLinkToButton: true,
175175
content: new MarkdownString([
176176
header,
177+
localize('setupChatSigningIn', "$(loading~spin) Signing in to {0}...", defaultChat.providerName),
177178
footer,
178179
`[${localize('learnMore', "Learn More")}](${defaultChat.documentationUrl})`,
179-
].join('\n\n'), { isTrusted: true }),
180+
].join('\n\n'), { isTrusted: true, supportThemeIcons: true }),
180181
});
181182

182183
// Setup: Installing
183184
Registry.as<IChatViewsWelcomeContributionRegistry>(ChatViewsWelcomeExtensions.ChatViewsWelcomeRegistry).register({
184185
title: defaultChat.chatWelcomeTitle,
185186
when: ChatContextKeys.Setup.installing,
186187
icon: defaultChat.icon,
187-
progress: localize('setupChatInstalling', "Setting up Chat for you..."),
188+
disableFirstLinkToButton: true,
188189
content: new MarkdownString([
189190
header,
191+
localize('setupChatInstalling', "$(loading~spin) Setting up Chat for you..."),
190192
footer,
191193
`[${localize('learnMore', "Learn More")}](${defaultChat.documentationUrl})`,
192-
].join('\n\n'), { isTrusted: true }),
194+
].join('\n\n'), { isTrusted: true, supportThemeIcons: true }),
193195
});
194196
}
195197

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@ div.chat-welcome-view {
5959
font-size: 11px;
6060
}
6161

62-
& > .chat-welcome-view-progress {
63-
display: flex;
64-
gap: 6px;
65-
text-align: center;
66-
max-width: 350px;
67-
padding: 0 20px;
68-
margin-top: 20px;
69-
}
70-
7162
& > .chat-welcome-view-message {
7263
text-align: center;
7364
max-width: 350px;
@@ -77,6 +68,12 @@ div.chat-welcome-view {
7768
a {
7869
color: var(--vscode-textLink-foreground);
7970
}
71+
72+
.codicon[class*='codicon-'] {
73+
font-size: 13px;
74+
line-height: 1.4em;
75+
vertical-align: bottom;
76+
}
8077
}
8178

8279
.monaco-button {

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { IInstantiationService } from '../../../../../platform/instantiation/com
1717
import { ILogService } from '../../../../../platform/log/common/log.js';
1818
import { IOpenerService } from '../../../../../platform/opener/common/opener.js';
1919
import { defaultButtonStyles } from '../../../../../platform/theme/browser/defaultStyles.js';
20-
import { spinningLoading } from '../../../../../platform/theme/common/iconRegistry.js';
2120
import { ChatAgentLocation } from '../../common/chatAgents.js';
2221
import { chatViewsWelcomeRegistry, IChatViewsWelcomeDescriptor } from './chatViewsWelcome.js';
2322

@@ -89,7 +88,7 @@ export class ChatViewWelcomeController extends Disposable {
8988
icon: enabledDescriptor.icon,
9089
title: enabledDescriptor.title,
9190
message: enabledDescriptor.content,
92-
progress: enabledDescriptor.progress
91+
disableFirstLinkToButton: enabledDescriptor.disableFirstLinkToButton,
9392
};
9493
const welcomeView = this.renderDisposables.add(this.instantiationService.createInstance(ChatViewWelcomePart, content, { firstLinkToButton: true, location: this.location }));
9594
this.element!.appendChild(welcomeView.element);
@@ -104,7 +103,7 @@ export interface IChatViewWelcomeContent {
104103
icon?: ThemeIcon;
105104
title: string;
106105
message: IMarkdownString;
107-
progress?: string;
106+
disableFirstLinkToButton?: boolean;
108107
tips?: IMarkdownString;
109108
}
110109

@@ -144,7 +143,7 @@ export class ChatViewWelcomePart extends Disposable {
144143
title.textContent = content.title;
145144
const renderer = this.instantiationService.createInstance(MarkdownRenderer, {});
146145
const messageResult = this._register(renderer.render(content.message));
147-
const firstLink = (options?.firstLinkToButton && !content.progress) ? messageResult.element.querySelector('a') : undefined;
146+
const firstLink = options?.firstLinkToButton && !content.disableFirstLinkToButton ? messageResult.element.querySelector('a') : undefined;
148147
if (firstLink) {
149148
const target = firstLink.getAttribute('data-href');
150149
const button = this._register(new Button(firstLink.parentElement!, defaultButtonStyles));
@@ -159,14 +158,6 @@ export class ChatViewWelcomePart extends Disposable {
159158

160159
dom.append(message, messageResult.element);
161160

162-
if (content.progress) {
163-
const progress = dom.append(this.element, $('.chat-welcome-view-progress'));
164-
progress.appendChild(renderIcon(spinningLoading));
165-
166-
const progressLabel = dom.append(progress, $('span'));
167-
progressLabel.textContent = content.progress;
168-
}
169-
170161
if (content.tips) {
171162
const tips = dom.append(this.element, $('.chat-welcome-view-tips'));
172163
const tipsResult = this._register(renderer.render(content.tips));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface IChatViewsWelcomeDescriptor {
1717
icon?: ThemeIcon;
1818
title: string;
1919
content: IMarkdownString;
20-
progress?: string;
20+
disableFirstLinkToButton?: boolean;
2121
when: ContextKeyExpression;
2222
}
2323

0 commit comments

Comments
 (0)