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
12 changes: 0 additions & 12 deletions src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ import { ChatAgentVoteDirection, ChatAgentVoteDownReason, IChatService } from '.
import { isResponseVM } from '../../common/model/chatViewModel.js';
import { ChatModeKind } from '../../common/constants.js';
import { IChatAccessibilityService, IChatWidgetService } from '../chat.js';
import { triggerConfetti } from '../widget/chatConfetti.js';
import { CHAT_CATEGORY } from './chatActions.js';
import { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';

export const MarkUnhelpfulActionId = 'workbench.action.chat.markUnhelpful';
const enableFeedbackConfig = 'config.telemetry.feedback.enabled';
Expand Down Expand Up @@ -77,16 +75,6 @@ export function registerChatTitleActions() {
});
item.setVote(ChatAgentVoteDirection.Up);
item.setVoteDownReason(undefined);

const configurationService = accessor.get(IConfigurationService);
const accessibilityService = accessor.get(IAccessibilityService);
if (configurationService.getValue<boolean>('chat.confettiOnThumbsUp') && !accessibilityService.isMotionReduced()) {
const chatWidgetService = accessor.get(IChatWidgetService);
const widget = chatWidgetService.getWidgetBySessionResource(item.session.sessionResource);
if (widget) {
triggerConfetti(widget.domNode);
}
}
}
});

Expand Down
6 changes: 1 addition & 5 deletions src/vs/workbench/contrib/chat/browser/chat.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,7 @@ configurationRegistry.registerConfiguration({
mode: 'auto'
}
},
'chat.confettiOnThumbsUp': {
type: 'boolean',
description: nls.localize('chat.confettiOnThumbsUp', "Controls whether a confetti animation is shown when clicking the thumbs up button on a chat response."),
default: false,
},

'chat.experimental.detectParticipant.enabled': {
type: 'boolean',
deprecationMessage: nls.localize('chat.experimental.detectParticipant.enabled.deprecated', "This setting is deprecated. Please use `chat.detectParticipant.enabled` instead."),
Expand Down
20 changes: 15 additions & 5 deletions src/vs/workbench/contrib/chat/browser/chatTipService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const IChatTipService = createDecorator<IChatTipService>('chatTipService'
export interface IChatTip {
readonly id: string;
readonly content: MarkdownString;
readonly enabledCommands?: readonly string[];
}

export interface IChatTipService {
Expand Down Expand Up @@ -67,7 +68,7 @@ export interface IChatTipService {

/**
* Dismisses the current tip and allows a new one to be picked for the same request.
* The dismissed tip will not be shown again in this workspace.
* The dismissed tip will not be shown again in this profile.
*/
dismissTip(): void;

Expand Down Expand Up @@ -543,7 +544,7 @@ export class ChatTipService extends Disposable implements IChatTipService {
if (this._shownTip) {
const dismissed = this._getDismissedTipIds();
dismissed.push(this._shownTip.id);
this._storageService.store(ChatTipService._DISMISSED_TIP_KEY, JSON.stringify(dismissed), StorageScope.WORKSPACE, StorageTarget.MACHINE);
this._storageService.store(ChatTipService._DISMISSED_TIP_KEY, JSON.stringify(dismissed), StorageScope.PROFILE, StorageTarget.MACHINE);
}
Comment thread
meganrogge marked this conversation as resolved.
this._hasShownRequestTip = false;
this._shownTip = undefined;
Expand All @@ -552,7 +553,7 @@ export class ChatTipService extends Disposable implements IChatTipService {
}

private _getDismissedTipIds(): string[] {
const raw = this._storageService.get(ChatTipService._DISMISSED_TIP_KEY, StorageScope.WORKSPACE);
const raw = this._storageService.get(ChatTipService._DISMISSED_TIP_KEY, StorageScope.PROFILE);
if (!raw) {
return [];
}
Expand Down Expand Up @@ -600,6 +601,14 @@ export class ChatTipService extends Disposable implements IChatTipService {
return this._createTip(this._shownTip);
}

// A new request arrived while we already showed a tip, hide the old one
if (this._hasShownRequestTip && this._tipRequestId && this._tipRequestId !== requestId) {
this._shownTip = undefined;
this._tipRequestId = undefined;
this._onDidDismissTip.fire();
return undefined;
}

// Only show one tip per session
if (this._hasShownRequestTip) {
return undefined;
Expand Down Expand Up @@ -643,7 +652,7 @@ export class ChatTipService extends Disposable implements IChatTipService {
let selectedTip: ITipDefinition | undefined;

// Determine where to start in the catalog based on the last-shown tip.
const lastTipId = this._storageService.get(ChatTipService._LAST_TIP_ID_KEY, StorageScope.WORKSPACE);
const lastTipId = this._storageService.get(ChatTipService._LAST_TIP_ID_KEY, StorageScope.PROFILE);
const lastCatalogIndex = lastTipId ? TIP_CATALOG.findIndex(tip => tip.id === lastTipId) : -1;
const startIndex = lastCatalogIndex === -1 ? 0 : (lastCatalogIndex + 1) % TIP_CATALOG.length;

Expand Down Expand Up @@ -679,7 +688,7 @@ export class ChatTipService extends Disposable implements IChatTipService {
}

// Persist the selected tip id so the next use advances to the following one.
this._storageService.store(ChatTipService._LAST_TIP_ID_KEY, selectedTip.id, StorageScope.WORKSPACE, StorageTarget.MACHINE);
this._storageService.store(ChatTipService._LAST_TIP_ID_KEY, selectedTip.id, StorageScope.PROFILE, StorageTarget.USER);

// Record that we've shown a tip this session
this._hasShownRequestTip = sourceId !== 'welcome';
Expand Down Expand Up @@ -713,6 +722,7 @@ export class ChatTipService extends Disposable implements IChatTipService {
return {
id: tipDef.id,
content: markdown,
enabledCommands: tipDef.enabledCommands,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
margin-bottom: 8px;
padding: 6px 10px;
border-radius: 4px;
border: 1px solid var(--vscode-focusBorder);
border: 1px solid var(--vscode-editorWidget-border, var(--vscode-input-border, transparent));
background-color: var(--vscode-editorWidget-background);
font-size: var(--vscode-chat-font-size-body-s);
font-family: var(--vscode-chat-font-family, inherit);
color: var(--vscode-descriptionForeground);
position: relative;
overflow: hidden;
}

.interactive-item-container .chat-tip-widget .codicon-lightbulb {
Expand Down Expand Up @@ -59,10 +61,13 @@
font-size: var(--vscode-chat-font-size-body-s);
font-family: var(--vscode-chat-font-family, inherit);
color: var(--vscode-descriptionForeground);
position: relative;
overflow: hidden;
}

.chat-getting-started-tip-container .chat-tip-widget .codicon-lightbulb {
display: none;
font-size: 12px;
color: var(--vscode-notificationsWarningIcon-foreground);
}

.chat-getting-started-tip-container .chat-tip-widget .rendered-markdown p {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ export const tocData: ITOCEntry<string> = {
'chat.notifyWindow*',
'chat.statusWidget.*',
'chat.tips.*',
'chat.unifiedAgentsBar.*',
'chat.confettiOnThumbsUp'
'chat.unifiedAgentsBar.*'
]
},
{
Expand Down
Loading