mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 22:12:26 +01:00
fix attachments not getting omission warning when not supported (#244932)
fix attachments not getting omitted
This commit is contained in:
@@ -173,19 +173,18 @@ export class FileAttachmentWidget extends AbstractChatAttachmentWidget {
|
||||
}
|
||||
|
||||
private renderOmittedWarning(friendlyName: string, ariaLabel: string, hoverDelegate: IHoverDelegate) {
|
||||
const pillIcon = dom.$('div.chat-attached-context-pill', {}, dom.$(this.modelSupportsVision() ? 'span.codicon.codicon-file-media' : 'span.codicon.codicon-warning'));
|
||||
const pillIcon = dom.$('div.chat-attached-context-pill', {}, dom.$('span.codicon.codicon-warning'));
|
||||
const textLabel = dom.$('span.chat-attached-context-custom-text', {}, friendlyName);
|
||||
this.element.appendChild(pillIcon);
|
||||
this.element.appendChild(textLabel);
|
||||
|
||||
const hoverElement = dom.$('div.chat-attached-context-hover');
|
||||
hoverElement.setAttribute('aria-label', ariaLabel);
|
||||
this.element.classList.add('warning');
|
||||
|
||||
hoverElement.textContent = localize('chat.fileAttachmentHover', "{0} does not support this {1} type.", this.currentLanguageModel ? this.languageModelsService.lookupLanguageModel(this.currentLanguageModel.identifier)?.name : this.currentLanguageModel, 'file');
|
||||
this._register(this.hoverService.setupManagedHover(hoverDelegate, this.element, hoverElement, { trapFocus: true }));
|
||||
|
||||
if (!this.modelSupportsVision()) {
|
||||
this.element.classList.add('warning');
|
||||
hoverElement.textContent = localize('chat.fileAttachmentHover', "{0} does not support this {1} type.", this.currentLanguageModel ? this.languageModelsService.lookupLanguageModel(this.currentLanguageModel.identifier)?.name : this.currentLanguageModel, 'file');
|
||||
this._register(this.hoverService.setupManagedHover(hoverDelegate, this.element, hoverElement, { trapFocus: true }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user