More inline chat fixes (#208780)

* disable send dropdown menu rendering for anything but panel chat location

fixes https://github.com/microsoft/vscode/issues/208569

* fix https://github.com/microsoft/vscode/issues/208634
This commit is contained in:
Johannes Rieken 2024-03-26 15:07:20 +01:00 committed by GitHub
parent 9ed28b5d67
commit 1591ace90e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View file

@ -372,9 +372,11 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
},
hiddenItemStrategy: HiddenItemStrategy.Ignore, // keep it lean when hiding items and avoid a "..." overflow menu
actionViewItemProvider: (action, options) => {
if ((action.id === SubmitAction.ID || action.id === CancelAction.ID) && action instanceof MenuItemAction) {
const dropdownAction = this.instantiationService.createInstance(MenuItemAction, { id: 'chat.moreExecuteActions', title: localize('notebook.moreExecuteActionsLabel', "More..."), icon: Codicon.chevronDown }, undefined, undefined, undefined);
return this.instantiationService.createInstance(ChatSubmitDropdownActionItem, action, dropdownAction);
if (this.location === ChatAgentLocation.Panel) {
if ((action.id === SubmitAction.ID || action.id === CancelAction.ID) && action instanceof MenuItemAction) {
const dropdownAction = this.instantiationService.createInstance(MenuItemAction, { id: 'chat.moreExecuteActions', title: localize('notebook.moreExecuteActionsLabel', "More..."), icon: Codicon.chevronDown }, undefined, undefined, undefined);
return this.instantiationService.createInstance(ChatSubmitDropdownActionItem, action, dropdownAction);
}
}
return undefined;

View file

@ -553,9 +553,10 @@ export class InlineChatWidget {
const isTempMessage = typeof ops.resetAfter === 'number';
if (isTempMessage && !this._elements.statusLabel.dataset['state']) {
const statusLabel = this._elements.statusLabel.innerText;
const title = this._elements.statusLabel.dataset['title'];
const classes = Array.from(this._elements.statusLabel.classList.values());
setTimeout(() => {
this.updateStatus(statusLabel, { classes, keepMessage: true });
this.updateStatus(statusLabel, { classes, keepMessage: true, title });
}, ops.resetAfter);
}
const renderedMessage = renderLabelWithIcons(message);
@ -568,7 +569,11 @@ export class InlineChatWidget {
delete this._elements.statusLabel.dataset['state'];
}
this._elements.statusLabel.dataset['title'] = ops.title;
if (ops.title) {
this._elements.statusLabel.dataset['title'] = ops.title;
} else {
delete this._elements.statusLabel.dataset['title'];
}
this._onDidChangeHeight.fire();
}