You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here are my notes I presented and action items at the end:
Hover consistency
Background
Rich content
Better looking than standard
More control
Custom vs native
The custom hover is mostly spread throughout the workbench but there are some cases where title is still used:
Default setupDelayedHover
setupDelayedHover(target,{ content })
Shows above the target element, aligned to the top-left.
This top-left behavior originated from monaco.
Default setupDelayedHoverAtMouse
setupDelayedHoverAtMouse({ content })
Shows just below and to the right of the cursor.
This aligns closest with the native title hover.
Locking
Normally you can only mouse over the hover if it contains a link or action in the status bar.
Holding alt will "lock" the hover, adding a 2px border and making the hover not go away when the mouse is moved, regardless of the specific options used. This is an accessibility feature useful to all to select text or when we explicitly hideOnHover.
Options
There are many options that allow devs a lot of control on how these hovers are shown. The biggest one being showPointer which centers the hover and adds a pointer.
Should this be the default for showDelayedHover? Should we have a showDelayedHoverWithPointer?
Naming could be "PointerHover" and "MouseHover"?
TextHover vs Regular (pointer)?
Should hideOnKeyDown: true be the default?
Probably flip default, understand why
compact is used inconsistently. When should we use this?
Could we get rid of forcePosition if we handled the small space case better?
A lot of times this is used to force a horizontal only position.
If we marked a hover as horizontally (sidebar) or vertically (status bar) positioned, maybe we could avoid being explicit about the exact position and avoid the need for forcePosition as it's implied?
Activity
Tyriar commentedon Mar 12, 2025
Here are my notes I presented and action items at the end:
Hover consistency
Background
Custom vs native
The custom hover is mostly spread throughout the workbench but there are some cases where
titleis still used:Default setupDelayedHover
Shows above the target element, aligned to the top-left.
This top-left behavior originated from monaco.
Default setupDelayedHoverAtMouse
Shows just below and to the right of the cursor.
This aligns closest with the native
titlehover.Locking
Normally you can only mouse over the hover if it contains a link or action in the status bar.
Holding alt will "lock" the hover, adding a 2px border and making the hover not go away when the mouse is moved, regardless of the specific options used. This is an accessibility feature useful to all to select text or when we explicitly hideOnHover.
Options
There are many options that allow devs a lot of control on how these hovers are shown. The biggest one being showPointer which centers the hover and adds a pointer.
Some examples:
Activity bar
Terminal tab
Extension view item
This uses the simpler API meaning it must manage the groupId and delay logic itself:
Questions
showDelayedHover? Should we have ashowDelayedHoverWithPointer?hideOnKeyDown: truebe the default?compactis used inconsistently. When should we use this?forcePositionif we handled the small space case better?forcePositionas it's implied?Internal API for the VS Code devs: https://github.com/microsoft/vscode/blob/d81f6ad5b8fe26ed793a47e6911d75bafee7b3de/src/vs/base/browser/ui/hover/hover.ts#L12-L376
Action items
hideOnKeyDown: trueshould be the default? Maybe we don't need it at all?compact: trueis a special case, we need clear guidelines to followhoverPosition: 'horizontal' | 'vertical'which should renderforcePositionmaybe obsolete completely and simplify usageshowHovertoshowInstantHover, andshowDelayedHover*toshowHover*?showDelayedHover->showHoverAtTextshowDelayedHoverAtMouse->showHoverAtMouseshowDelayedHoverwill defaultshowPointer: true?