Skip to content

Commit 0d4cdd4

Browse files
authored
only show dropdown if there are more actions (microsoft#264945)
1 parent a11231a commit 0d4cdd4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class ChatElicitationContentPart extends Disposable implements IChatConte
3232
{
3333
label: elicitation.acceptButtonLabel,
3434
data: true,
35-
moreActions: (elicitation.moreActions || []).map((action: IAction) => ({
35+
moreActions: elicitation.moreActions?.map((action: IAction) => ({
3636
label: action.label,
3737
data: action,
3838
run: action.run

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
532532
}
533533
}
534534

535-
function getMoreActions(suggestedOption: SuggestedOption, confirmationPrompt: IConfirmationPrompt): IAction[] {
535+
function getMoreActions(suggestedOption: SuggestedOption, confirmationPrompt: IConfirmationPrompt): IAction[] | undefined {
536536
const moreActions: IAction[] = [];
537537
const moreOptions = confirmationPrompt.options.filter(a => a !== (typeof suggestedOption === 'string' ? suggestedOption : suggestedOption.option));
538538
let i = 0;
@@ -549,7 +549,7 @@ function getMoreActions(suggestedOption: SuggestedOption, confirmationPrompt: IC
549549
i++;
550550
moreActions.push(action);
551551
}
552-
return moreActions;
552+
return moreActions.length ? moreActions : undefined;
553553
}
554554

555555
type SuggestedOption = string | { description: string; option: string };

0 commit comments

Comments
 (0)