Skip to content

Commit

Permalink
fix: try decluttering the chat editing widget toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceerhl committed Nov 22, 2024
1 parent e1de2a4 commit 932da0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class ChatEditingAcceptAllAction extends Action2 {
id: MenuId.ChatEditingWidgetToolbar,
group: 'navigation',
order: 0,
when: ContextKeyExpr.and(applyingChatEditsFailedContextKey.negate(), ContextKeyExpr.or(hasAppliedChatEditsContextKey.negate(), ContextKeyExpr.and(hasUndecidedChatEditingResourceContextKey, ContextKeyExpr.and(ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession)))))
when: ContextKeyExpr.and(applyingChatEditsFailedContextKey.negate(), ContextKeyExpr.and(hasUndecidedChatEditingResourceContextKey, ContextKeyExpr.and(ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession))))
}
]
});
Expand Down Expand Up @@ -247,7 +247,7 @@ export class ChatEditingDiscardAllAction extends Action2 {
id: MenuId.ChatEditingWidgetToolbar,
group: 'navigation',
order: 1,
when: ContextKeyExpr.and(applyingChatEditsFailedContextKey.negate(), ContextKeyExpr.or(hasAppliedChatEditsContextKey.negate(), ContextKeyExpr.and(ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession), hasUndecidedChatEditingResourceContextKey)))
when: ContextKeyExpr.and(applyingChatEditsFailedContextKey.negate(), ContextKeyExpr.and(ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession), hasUndecidedChatEditingResourceContextKey))
}
],
keybinding: {
Expand Down Expand Up @@ -288,21 +288,21 @@ export class ChatEditingDiscardAllAction extends Action2 {
registerAction2(ChatEditingDiscardAllAction);

export class ChatEditingRemoveAllFilesAction extends Action2 {
static readonly ID = 'chatEditing.removeAllFiles';
static readonly ID = 'chatEditing.clearWorkingSet';

constructor() {
super({
id: ChatEditingRemoveAllFilesAction.ID,
title: localize('removeAll', 'Remove All'),
title: localize('clearWorkingSet', 'Clear Working Set'),
icon: Codicon.clearAll,
tooltip: localize('removeAllFiles', 'Remove All Files'),
tooltip: localize('clearWorkingSet', 'Clear Working Set'),
precondition: ContextKeyExpr.and(ChatContextKeys.requestInProgress.negate()),
menu: [
{
id: MenuId.ChatEditingWidgetToolbar,
group: 'navigation',
order: 5,
when: ContextKeyExpr.and(ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession))
when: ContextKeyExpr.and(hasAppliedChatEditsContextKey.negate(), ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession))
}
]
});
Expand Down Expand Up @@ -344,7 +344,7 @@ export class ChatEditingShowChangesAction extends Action2 {
id: MenuId.ChatEditingWidgetToolbar,
group: 'navigation',
order: 4,
when: ContextKeyExpr.and(applyingChatEditsFailedContextKey.negate(), ContextKeyExpr.or(hasAppliedChatEditsContextKey.negate(), ContextKeyExpr.and(hasAppliedChatEditsContextKey, hasUndecidedChatEditingResourceContextKey, ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession))))
when: ContextKeyExpr.and(applyingChatEditsFailedContextKey.negate(), ContextKeyExpr.and(hasAppliedChatEditsContextKey, hasUndecidedChatEditingResourceContextKey, ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession)))
}
],
});
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/chat/browser/chatEditorSaving.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { IFilesConfigurationService } from '../../../services/filesConfiguration
import { ITextFileService } from '../../../services/textfile/common/textfiles.js';
import { ChatAgentLocation, IChatAgentService } from '../common/chatAgents.js';
import { ChatContextKeys } from '../common/chatContextKeys.js';
import { applyingChatEditsFailedContextKey, CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME, hasAppliedChatEditsContextKey, hasUndecidedChatEditingResourceContextKey, IChatEditingService, IChatEditingSession, IModifiedFileEntry, WorkingSetEntryState } from '../common/chatEditingService.js';
import { applyingChatEditsFailedContextKey, CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME, hasUndecidedChatEditingResourceContextKey, IChatEditingService, IChatEditingSession, IModifiedFileEntry, WorkingSetEntryState } from '../common/chatEditingService.js';
import { IChatModel } from '../common/chatModel.js';
import { IChatService } from '../common/chatService.js';
import { ChatEditingModifiedFileEntry } from './chatEditing/chatEditingModifiedFileEntry.js';
Expand Down Expand Up @@ -270,7 +270,7 @@ export class ChatEditingSaveAllAction extends Action2 {
// Show the option to save without accepting if the user hasn't configured the setting to always save with generated changes
when: ContextKeyExpr.and(
applyingChatEditsFailedContextKey.negate(),
ContextKeyExpr.or(hasUndecidedChatEditingResourceContextKey, hasAppliedChatEditsContextKey.negate()),
hasUndecidedChatEditingResourceContextKey,
ContextKeyExpr.equals(`config.${ChatEditorSaving._config}`, false),
ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession)
)
Expand Down

0 comments on commit 932da0a

Please sign in to comment.