Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable a tooltip in quick pick #174417

Merged
merged 6 commits into from
Feb 15, 2023
Merged

Enable a tooltip in quick pick #174417

merged 6 commits into from
Feb 15, 2023

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Feb 15, 2023

image

This PR introduces an ability for a Core feature to provide a tooltip for a QuickPickItem.

  • ctrl+space to toggle the tooltip or hover over an item with your mouse to show the hover
  • The tooltip can be a string or markdown string
  • Tabbing over to the hover is doable in order to click on links

Fixes #174473

@TylerLeonhardt TylerLeonhardt self-assigned this Feb 15, 2023
@VSCodeTriageBot VSCodeTriageBot added this to the February 2023 milestone Feb 15, 2023
sandy081
sandy081 previously approved these changes Feb 15, 2023
Tyriar
Tyriar previously approved these changes Feb 15, 2023
if (!element.element || !element.saneTooltip) {
return;
}
this._lastHover = this.options.hoverDelegate.showHover({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IHoverOptions.id is available now on main

Comment on lines +73 to +78
return this.hoverService.showHover({
...options,
hideOnHover: false,
hideOnKeyDown: false,
skipFadeInAnimation: true,
}, focus);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also breaks the equality check, but id would fix it

@TylerLeonhardt TylerLeonhardt dismissed stale reviews from Tyriar and sandy081 via 4ffef40 February 15, 2023 16:20
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) February 15, 2023 16:33
@TylerLeonhardt TylerLeonhardt merged commit f861acb into main Feb 15, 2023
@TylerLeonhardt TylerLeonhardt deleted the tyler/varying-catfish branch February 15, 2023 16:35
c-claeys pushed a commit to c-claeys/vscode that referenced this pull request Feb 16, 2023
* hover in quickpick

* refactoring

* fix tests

* remove HTMLElement from API for now

* API proposal
Comment on lines +1421 to +1422
case KeyCode.Space:
if (event.ctrlKey) {
Copy link

@Chudesnov Chudesnov Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TylerLeonhardt there's a couple of potential issues with this solution regarding keyboard accessibility.

In order to be discoverable, this should either be conveyed to the user through markup (as in, "has tooltip, press [ .. ] to activate". or at least be a well-known key combination across users (such as Shift+F1).

Additionally note that Ctrl is actually the key that's commonly used to dismiss tooltips rather than summon them in many Windows applications and is preferred by many keyboard users due to that.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should be resolved somehow in #175662

@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow quick pick to show a tooltip
6 participants