mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +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) {
|
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);
|
const textLabel = dom.$('span.chat-attached-context-custom-text', {}, friendlyName);
|
||||||
this.element.appendChild(pillIcon);
|
this.element.appendChild(pillIcon);
|
||||||
this.element.appendChild(textLabel);
|
this.element.appendChild(textLabel);
|
||||||
|
|
||||||
const hoverElement = dom.$('div.chat-attached-context-hover');
|
const hoverElement = dom.$('div.chat-attached-context-hover');
|
||||||
hoverElement.setAttribute('aria-label', ariaLabel);
|
hoverElement.setAttribute('aria-label', ariaLabel);
|
||||||
|
|
||||||
if (!this.modelSupportsVision()) {
|
|
||||||
this.element.classList.add('warning');
|
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');
|
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 }));
|
this._register(this.hoverService.setupManagedHover(hoverDelegate, this.element, hoverElement, { trapFocus: true }));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user