Skip to content

Commit 8b640ee

Browse files
authored
Remove 'Del' button from session history window (#314425)
1 parent 717aa44 commit 8b640ee

2 files changed

Lines changed: 1 addition & 46 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { IAgentSessionsService, AgentSessionsService } from './agentSessionsServ
1616
import { LocalAgentsSessionsController } from './localAgentSessionsController.js';
1717
import { registerWorkbenchContribution2, WorkbenchPhase } from '../../../../common/contributions.js';
1818
import { ISubmenuItem, MenuId, MenuRegistry, registerAction2 } from '../../../../../platform/actions/common/actions.js';
19-
import { ArchiveAgentSessionAction, ArchiveAgentSessionSectionAction, UnarchiveAgentSessionAction, OpenAgentSessionInEditorGroupAction, OpenAgentSessionInNewEditorGroupAction, OpenAgentSessionInNewWindowAction, ShowAgentSessionsSidebar, HideAgentSessionsSidebar, ToggleAgentSessionsSidebar, RefreshAgentSessionsViewerAction, FindAgentSessionInViewerAction, MarkAgentSessionUnreadAction, MarkAgentSessionReadAction, FocusAgentSessionsAction, SetAgentSessionsOrientationStackedAction, SetAgentSessionsOrientationSideBySideAction, PickAgentSessionAction, ArchiveAllAgentSessionsAction, MarkAllAgentSessionsReadAction, RenameAgentSessionAction, DeleteAgentSessionAction, DeleteAgentSessionInlineAction, DeleteAllLocalSessionsAction, MarkAgentSessionSectionReadAction, ToggleShowAgentSessionsAction, UnarchiveAgentSessionSectionAction, PinAgentSessionAction, UnpinAgentSessionAction, CollapseAllAgentSessionSectionsAction } from './agentSessionsActions.js';
19+
import { ArchiveAgentSessionAction, ArchiveAgentSessionSectionAction, UnarchiveAgentSessionAction, OpenAgentSessionInEditorGroupAction, OpenAgentSessionInNewEditorGroupAction, OpenAgentSessionInNewWindowAction, ShowAgentSessionsSidebar, HideAgentSessionsSidebar, ToggleAgentSessionsSidebar, RefreshAgentSessionsViewerAction, FindAgentSessionInViewerAction, MarkAgentSessionUnreadAction, MarkAgentSessionReadAction, FocusAgentSessionsAction, SetAgentSessionsOrientationStackedAction, SetAgentSessionsOrientationSideBySideAction, PickAgentSessionAction, ArchiveAllAgentSessionsAction, MarkAllAgentSessionsReadAction, RenameAgentSessionAction, DeleteAgentSessionAction, DeleteAllLocalSessionsAction, MarkAgentSessionSectionReadAction, ToggleShowAgentSessionsAction, UnarchiveAgentSessionSectionAction, PinAgentSessionAction, UnpinAgentSessionAction, CollapseAllAgentSessionSectionsAction } from './agentSessionsActions.js';
2020
import { AgentSessionsQuickAccessProvider, AGENT_SESSIONS_QUICK_ACCESS_PREFIX } from './agentSessionsQuickAccess.js';
2121

2222
//#region Actions and Menus
@@ -35,7 +35,6 @@ registerAction2(PinAgentSessionAction);
3535
registerAction2(UnpinAgentSessionAction);
3636
registerAction2(RenameAgentSessionAction);
3737
registerAction2(DeleteAgentSessionAction);
38-
registerAction2(DeleteAgentSessionInlineAction);
3938
registerAction2(DeleteAllLocalSessionsAction);
4039
registerAction2(MarkAgentSessionUnreadAction);
4140
registerAction2(MarkAgentSessionReadAction);

src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -728,50 +728,6 @@ export class DeleteAgentSessionAction extends BaseAgentSessionAction {
728728
}
729729
}
730730

731-
export class DeleteAgentSessionInlineAction extends BaseAgentSessionAction {
732-
733-
constructor() {
734-
super({
735-
id: 'agentSession.deleteInline',
736-
title: localize2('del', "Del"),
737-
icon: Codicon.trash,
738-
menu: {
739-
id: MenuId.AgentSessionItemToolbar,
740-
group: 'navigation',
741-
order: 2,
742-
when: ChatContextKeys.agentSessionType.isEqualTo(AgentSessionProviders.Local)
743-
}
744-
});
745-
}
746-
747-
async runWithSessions(sessions: IAgentSession[], accessor: ServicesAccessor): Promise<void> {
748-
if (sessions.length === 0) {
749-
return;
750-
}
751-
752-
const chatService = accessor.get(IChatService);
753-
const widgetService = accessor.get(IChatWidgetService);
754-
const commandService = accessor.get(ICommandService);
755-
756-
const deletedSessionIds: string[] = [];
757-
758-
for (const session of sessions) {
759-
await widgetService.getWidgetBySessionResource(session.resource)?.clear();
760-
await chatService.removeHistoryEntry(session.resource);
761-
762-
const sessionId = LocalChatSessionUri.parseLocalSessionId(session.resource);
763-
if (sessionId) {
764-
deletedSessionIds.push(sessionId);
765-
}
766-
}
767-
768-
// Notify extensions to clean up cloud data (best effort)
769-
if (deletedSessionIds.length > 0) {
770-
commandService.executeCommand('github.copilot.sessionSync.deleteSessionFromCloud', deletedSessionIds).catch(() => { /* best effort */ });
771-
}
772-
}
773-
}
774-
775731
export class DeleteAllLocalSessionsAction extends Action2 {
776732

777733
constructor() {

0 commit comments

Comments
 (0)