Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/chat/browser/chatViewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
try {
super.renderBody(parent);

this._register(this.instantiationService.createInstance(ChatViewWelcomeController, parent, this));
this._register(this.instantiationService.createInstance(ChatViewWelcomeController, parent, this, this.chatOptions.location));

const scopedInstantiationService = this._register(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
const locationBasedColors = this.getLocationBasedColors();
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/chat/browser/chatWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
const welcomePart = this._register(this.instantiationService.createInstance(
ChatViewWelcomePart,
{ ...welcomeContent, tips, },
{}
{ location: this.location }
));
dom.append(this.welcomeMessageContainer, welcomePart.element);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ div.chat-welcome-view {
font-weight: 500;
}

& > .chat-welcome-view-indicator {
color: var(--vscode-badge-foreground);
background: var(--vscode-badge-background);
padding: 1px 8px;
border-radius: 14px;
margin-top: 10px;
font-size: 11px;
}

& > .chat-welcome-view-message {
color: var(--vscode-descriptionForeground);
text-align: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import { IMarkdownString } from '../../../../../base/common/htmlContent.js';
import { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';
import { ThemeIcon } from '../../../../../base/common/themables.js';
import { MarkdownRenderer } from '../../../../../editor/browser/widget/markdownRenderer/browser/markdownRenderer.js';
import { localize } from '../../../../../nls.js';
import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
import { ILogService } from '../../../../../platform/log/common/log.js';
import { IOpenerService } from '../../../../../platform/opener/common/opener.js';
import { defaultButtonStyles } from '../../../../../platform/theme/browser/defaultStyles.js';
import { ChatAgentLocation } from '../../common/chatAgents.js';
import { chatViewsWelcomeRegistry, IChatViewsWelcomeDescriptor } from './chatViewsWelcome.js';

const $ = dom.$;
Expand All @@ -35,6 +37,7 @@ export class ChatViewWelcomeController extends Disposable {
constructor(
private readonly container: HTMLElement,
private readonly delegate: IViewWelcomeDelegate,
private readonly location: ChatAgentLocation,
@IContextKeyService private contextKeyService: IContextKeyService,
@IInstantiationService private instantiationService: IInstantiationService,
) {
Expand Down Expand Up @@ -85,7 +88,7 @@ export class ChatViewWelcomeController extends Disposable {
title: enabledDescriptor.title,
message: enabledDescriptor.content,
};
const welcomeView = this.renderDisposables.add(this.instantiationService.createInstance(ChatViewWelcomePart, content, { firstLinkToButton: true }));
const welcomeView = this.renderDisposables.add(this.instantiationService.createInstance(ChatViewWelcomePart, content, { firstLinkToButton: true, location: this.location }));
this.element!.appendChild(welcomeView.element);
this.container.classList.toggle('chat-view-welcome-visible', true);
} else {
Expand All @@ -103,6 +106,7 @@ export interface IChatViewWelcomeContent {

export interface IChatViewWelcomeRenderOptions {
firstLinkToButton?: boolean;
location: ChatAgentLocation;
}

export class ChatViewWelcomePart extends Disposable {
Expand All @@ -121,6 +125,11 @@ export class ChatViewWelcomePart extends Disposable {
try {
const icon = dom.append(this.element!, $('.chat-welcome-view-icon'));
const title = dom.append(this.element!, $('.chat-welcome-view-title'));

if (options?.location === ChatAgentLocation.EditingSession) {
const featureIndicator = dom.append(this.element!, $('.chat-welcome-view-indicator'));
featureIndicator.textContent = localize('preview', 'PREVIEW');
}
const message = dom.append(this.element!, $('.chat-welcome-view-message'));

if (content.icon) {
Expand Down