chat - address some feedback on toast changes (#292347)

* chat - address some feedback on toast changes

* .
This commit is contained in:
Benjamin Pasero
2026-02-02 18:35:18 +01:00
committed by GitHub
parent 0e1c5103cd
commit d1afadebfa
3 changed files with 6 additions and 4 deletions
@@ -19,6 +19,7 @@ import { isExportableSessionData } from '../../common/model/chatModel.js';
import { IChatService } from '../../common/chatService/chatService.js';
import { URI } from '../../../../../base/common/uri.js';
import { revive } from '../../../../../base/common/marshalling.js';
import { ACTIVE_GROUP, PreferredGroup } from '../../../../services/editor/common/editorService.js';
const defaultFileName = 'chat.json';
const filters = [{ name: localize('chat.file.label', "Chat Session"), extensions: ['json'] }];
@@ -118,7 +119,7 @@ export function registerChatExportActions() {
}
let sessionResource: URI;
let resolvedTarget: typeof ChatViewPaneTarget | undefined;
let resolvedTarget: typeof ChatViewPaneTarget | PreferredGroup;
let options: IChatEditorOptions;
if (opts?.target === 'chatViewPane') {
@@ -131,7 +132,7 @@ export function registerChatExportActions() {
options = { pinned: true };
} else {
sessionResource = ChatEditorInput.getNewEditorUri();
resolvedTarget = undefined;
resolvedTarget = ACTIVE_GROUP;
options = { target: { data }, pinned: true };
}
@@ -100,7 +100,7 @@ export class ChatWindowNotifier extends Disposable implements IWorkbenchContribu
const result = await this._hostService.showToast({
title: this._sanitizeOSToastText(notificationTitle),
body: info.detail ? this._sanitizeOSToastText(info.detail) : localize('notificationDetail', "Approval needed to continue."),
actions: [localize('approveAction', "Approve"), localize('showChat', "Show")],
actions: [localize('allowAction', "Allow"), localize('showChat', "Show")],
}, cts.token);
if (result.clicked || typeof result.actionIndex === 'number') {
@@ -109,7 +109,7 @@ export class ChatWindowNotifier extends Disposable implements IWorkbenchContribu
const widget = await this._chatWidgetService.openSession(sessionResource);
widget?.focusInput();
if (result.actionIndex === 0 /* Approve */) {
if (result.actionIndex === 0 /* Allow */) {
await this._commandService.executeCommand(AcceptToolConfirmationActionId, { sessionResource } satisfies IToolConfirmationActionContext);
}
}
@@ -533,6 +533,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
const cts = new CancellationTokenSource();
this.toast.value = toDisposable(() => cts.dispose(true));
const { clicked } = await this._hostService.showToast({ title: message }, cts.token);
this.toast.clear();
if (clicked) {
this._hostService.focus(targetWindow, { mode: FocusMode.Force });
}