Skip to content

Commit 9f0fbb2

Browse files
committed
Move confirmation actions to bottom section
Part of microsoft#257468
1 parent 3c25740 commit 9f0fbb2

File tree

4 files changed

+40
-26
lines changed

4 files changed

+40
-26
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,13 @@ abstract class BaseChatConfirmationWidget extends Disposable {
351351
const elements = dom.h('.chat-confirmation-widget2@root', [
352352
dom.h('.chat-confirmation-widget-title', [
353353
dom.h('.chat-title@title'),
354-
dom.h('.chat-buttons@buttons'),
354+
dom.h('.chat-toolbar-container@buttonsContainer', [
355+
dom.h('.chat-toolbar@toolbar'),
356+
]),
355357
]),
356358
dom.h('.chat-confirmation-widget-message@message'),
357-
dom.h('.chat-buttons-container@buttonsContainer', [
358-
dom.h('.chat-toolbar@toolbar'),
359+
dom.h('.chat-confirmation-widget-buttons', [
360+
dom.h('.chat-buttons@buttons'),
359361
]),
360362
]);
361363
this._domNode = elements.root;

src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatConfirmationWidget.css

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,6 @@
188188
justify-content: space-between;
189189
column-gap: 10px;
190190

191-
.chat-buttons {
192-
display: flex;
193-
column-gap: 10px;
194-
align-items: center;
195-
}
196-
197-
.monaco-button {
198-
overflow-wrap: break-word;
199-
padding: 2px 4px;
200-
}
201-
202191
.rendered-markdown {
203192
line-height: 24px !important;
204193
p {
@@ -226,20 +215,43 @@
226215
background: var(--vscode-chat-requestBackground);
227216
border: 1px solid var(--vscode-chat-requestBorder);
228217
padding: 6px 9px 0 9px;
229-
border-bottom-left-radius: 3px;
230-
border-bottom-right-radius: 3px;
231218

232219
p {
233220
margin-top: 0;
234221
margin-bottom: 9px;
235222
}
236223
}
237224

225+
238226
.interactive-session .interactive-response .chat-confirmation-widget2 .chat-confirmation-message-terminal .interactive-result-code-block {
239-
border-top-left-radius: 0px;
240-
border-top-right-radius: 0px;
227+
border-radius: 0px;
228+
}
229+
.interactive-session .interactive-response .chat-confirmation-widget2 .chat-confirmation-widget-buttons:not(:has(.chat-confirmation-widget-buttons)) .chat-confirmation-message-terminal .interactive-result-code-block {
230+
border-bottom-left-radius: 4px;
231+
border-bottom-right-radius: 4px;
241232
}
242233

243-
.chat-confirmation-widget2.hideButtons .chat-buttons {
234+
.chat-confirmation-widget2.hideButtons .chat-confirmation-widget-buttons,
235+
.chat-confirmation-widget2.hideButtons .chat-toolbar-container {
244236
display: none;
245237
}
238+
239+
.chat-confirmation-widget2 .chat-confirmation-widget-buttons {
240+
display: flex;
241+
border: 1px solid var(--vscode-chat-requestBorder);
242+
border-top: none;
243+
border-bottom-left-radius: 4px;
244+
border-bottom-right-radius: 4px;
245+
padding: 5px 9px;
246+
247+
.chat-buttons {
248+
display: flex;
249+
column-gap: 10px;
250+
align-items: center;
251+
252+
.monaco-button {
253+
overflow-wrap: break-word;
254+
padding: 2px 4px;
255+
}
256+
}
257+
}

src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,18 @@ export class ChatTerminalToolConfirmationSubPart extends BaseChatToolInvocationS
8787
terminalData = migrateLegacyTerminalToolSpecificData(terminalData);
8888

8989
const { title, message, disclaimer, terminalCustomActions } = toolInvocation.confirmationMessages;
90-
const runLabel = localize('run', "Run");
91-
const runKeybinding = keybindingService.lookupKeybinding(AcceptToolConfirmationActionId)?.getLabel();
92-
const runTooltip = runKeybinding ? `${runLabel} (${runKeybinding})` : runLabel;
90+
const continueLabel = localize('continue', "Continue");
91+
const continueKeybinding = keybindingService.lookupKeybinding(AcceptToolConfirmationActionId)?.getLabel();
92+
const continueTooltip = continueKeybinding ? `${continueLabel} (${continueKeybinding})` : continueLabel;
9393
const cancelLabel = localize('cancel', "Cancel");
9494
const cancelKeybinding = keybindingService.lookupKeybinding(CancelChatActionId)?.getLabel();
9595
const cancelTooltip = cancelKeybinding ? `${cancelLabel} (${cancelKeybinding})` : cancelLabel;
9696

9797
const buttons: IChatConfirmationButton[] = [
9898
{
99-
label: runLabel,
99+
label: continueLabel,
100100
data: true,
101-
tooltip: runTooltip,
101+
tooltip: continueTooltip,
102102
moreActions: terminalCustomActions,
103103
},
104104
{

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
337337
}
338338
confirmationMessages = isAutoApproved ? undefined : {
339339
title: args.isBackground
340-
? localize('runInTerminal.background', "{0} (background terminal)", shellType)
341-
: shellType,
340+
? localize('runInTerminal.background', "Run `{0}` command? (background terminal)", shellType)
341+
: localize('runInTerminal', "Run `{0}` command?", shellType),
342342
message: new MarkdownString(args.explanation),
343343
disclaimer,
344344
terminalCustomActions: customActions,

0 commit comments

Comments
 (0)