fix attachments not getting omission warning when not supported (#244932)

fix attachments not getting omitted
This commit is contained in:
Justin Chen
2025-03-27 15:34:10 -07:00
committed by GitHub
parent e6ef6295bf
commit 3aa8a71efd

View File

@@ -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 }));
}
}
}