Make "Toggle Changes" more prominent and re-run less (#208917)

- add regenerage and regenerate w/o intent detection to response title menu
- have toggle changes command with accept and discard
- add context key for chat widget location
This commit is contained in:
Johannes Rieken
2024-03-27 17:30:18 +01:00
committed by GitHub
parent da9a5c450b
commit 9757f7c73a
6 changed files with 39 additions and 20 deletions

View File

@@ -14,7 +14,7 @@ import { ZoneWidget } from 'vs/editor/contrib/zoneWidget/browser/zoneWidget';
import { localize } from 'vs/nls';
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ACTION_ACCEPT_CHANGES, ACTION_REGENERATE_RESPONSE, ACTION_VIEW_IN_CHAT, CTX_INLINE_CHAT_OUTER_CURSOR_POSITION, MENU_INLINE_CHAT_WIDGET, MENU_INLINE_CHAT_WIDGET_FEEDBACK, MENU_INLINE_CHAT_WIDGET_STATUS } from 'vs/workbench/contrib/inlineChat/common/inlineChat';
import { ACTION_ACCEPT_CHANGES, ACTION_REGENERATE_RESPONSE, ACTION_TOGGLE_DIFF, ACTION_VIEW_IN_CHAT, CTX_INLINE_CHAT_OUTER_CURSOR_POSITION, MENU_INLINE_CHAT_WIDGET, MENU_INLINE_CHAT_WIDGET_FEEDBACK, MENU_INLINE_CHAT_WIDGET_STATUS } from 'vs/workbench/contrib/inlineChat/common/inlineChat';
import { EditorBasedInlineChatWidget } from './inlineChatWidget';
import { MenuId } from 'vs/platform/actions/common/actions';
@@ -49,7 +49,7 @@ export class InlineChatZoneWidget extends ZoneWidget {
menu: MENU_INLINE_CHAT_WIDGET_STATUS,
options: {
buttonConfigProvider: action => {
if (action.id === ACTION_REGENERATE_RESPONSE) {
if (action.id === ACTION_REGENERATE_RESPONSE || action.id === ACTION_TOGGLE_DIFF) {
return { showIcon: true, showLabel: false, isSecondary: true };
} else if (action.id === ACTION_VIEW_IN_CHAT || action.id === ACTION_ACCEPT_CHANGES) {
return { isSecondary: false };