Code change:
macOS, VS Code Insiders into explorer focus via keyboard hover does not show. There is no command to trigger the custom hover to show Like the activity bar, we have to make sure that the custom hover can be accessed in the tree/list only with the keyboard.
Would you suggest adding a keybinding to toggle the visibility of the custom hover of the html element which has focus?
Yeah, ideally it is . The same shortcut that we use in the editor for showing the hover. So it is consistent and easy for user to understand that there is one shortcut which does the right thing everywhere.
Isn't this a duplicate of ? Btw we seem to be having this support for extension provided trees at least:
I think it's good to have this one separate to .
Solving this for all trees/lists is pretty hard as the tree/list does not know anything about the underlying elements being rendered. For extension trees it is much easier as they all consist of a label which the creates and controls.
One option could be to utilize the to get the tooltip. Currently it already provides
After further discussions we came to the conclusion that we would use the DOM tree to figure out if there is any custom hovers available and trigger the hover by dispatching a mouse event on the HTMLElement. This might seem rather hacky but it ensures the consumers of the tree only have to support hover once and lets the tree handle keyboard triggers. Handling focus is still tricky and a open problem. Until this focus problem is properly fixed the treeview will keep it's own implementation which directly uses the hover service and moves the focus into the hover. The treeview implementation of this has it's own flaws but will b kept for the meantime to not cause regressions.

Related discussion:
text: }); KeybindingsRegistry.registerCommandAndKeybindingRule({ <ins> id: 'list.showHover', weight: KeybindingWeight.WorkbenchContrib, primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI), when: WorkbenchListFocusContextKey, handler: async (accessor: ServicesAccessor, ...args: any[]) => { const listService = accessor.get(IListService); const lastFocusedList = listService.lastFocusedList; if (!lastFocusedList) { return; } // Check if a tree element is focused const focus = lastFocusedList.getFocus(); if (!focus || (focus.length === 0)) { return; } // As the tree does not know anything about the rendered DOM elements // we have to traverse the dom to find the HTMLElements const treeDOM = lastFocusedList.getHTMLElement(); const scrollableElement = treeDOM.querySelector('.monaco-scrollable-element'); const listRows = scrollableElement?.querySelector('.monaco-list-rows'); const focusedElement = listRows?.querySelector('.focused'); if (!focusedElement) { return; } // Check if the focused element has a hover, otherwise find the first child with a hover const elementWithHover = focusedElement.matches('[custom-hover="true"]') ? focusedElement : focusedElement.querySelector('[custom-hover="true"]'); if (!elementWithHover) { return; } toggleCustomHover(elementWithHover as HTMLElement, lastFocusedList); }, }); let activeHover: undefined | HTMLElement; let disposable: IDisposable | undefined; function toggleCustomHover(element: HTMLElement, list: WorkbenchListWidget) { const show = !element.getAttribute('custom-hover-active'); const mouseEvent = new MouseEvent(show ? EventType.MOUSE_OVER : EventType.MOUSE_LEAVE, { view: getActiveWindow(), bubbles: true, cancelable: true, }); element.dispatchEvent(mouseEvent); if (activeHover === element && !show) { activeHover = undefined; disposable?.dispose(); disposable = undefined; } else { activeHover = element; disposable = list.onDidBlur(() => { toggleCustomHover(element, list); }); } } KeybindingsRegistry.registerCommandAndKeybindingRule({ </ins> id: 'list.toggleExpand', weight: KeybindingWeight.WorkbenchContrib, when: WorkbenchListFocusContextKey,