hover for attach button in chat widget context action

This commit is contained in:
BeniBenj
2026-03-10 16:48:04 +01:00
parent 4198c6b4c4
commit 368df9ea1c

View File

@@ -609,10 +609,15 @@ class NewChatWidget extends Disposable implements IHistoryNavigationWidget {
private _createAttachButton(container: HTMLElement): void {
const attachButton = dom.append(container, dom.$('.sessions-chat-attach-button'));
const attachButtonLabel = localize('addContext', "Add Context...");
attachButton.tabIndex = 0;
attachButton.role = 'button';
attachButton.title = localize('addContext', "Add Context...");
attachButton.ariaLabel = localize('addContext', "Add Context...");
attachButton.ariaLabel = attachButtonLabel;
this._register(this.hoverService.setupDelayedHover(attachButton, {
content: attachButtonLabel,
position: { hoverPosition: HoverPosition.BELOW },
appearance: { showPointer: true }
}));
dom.append(attachButton, renderIcon(Codicon.add));
this._register(dom.addDisposableListener(attachButton, dom.EventType.CLICK, () => {
this._contextAttachments.showPicker(this._getContextFolderUri());