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

Polish explorer tooltip rendering #174085

Merged
merged 9 commits into from
Feb 14, 2023
Merged

Polish explorer tooltip rendering #174085

merged 9 commits into from
Feb 14, 2023

Conversation

lramos15
Copy link
Member

@lramos15 lramos15 commented Feb 10, 2023

Fixes #173236

Polishes tooltip rendering to match more what windows does

@lramos15 lramos15 self-assigned this Feb 10, 2023
@lramos15 lramos15 enabled auto-merge (squash) February 10, 2023 18:05
@vscodenpa vscodenpa added this to the February 2023 milestone Feb 10, 2023
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

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

Do we need another setting for this? Would adopting the custom hover help to avoid it obscuring the other items? Obscuring other list items seems to be the main complaint.

image

Is the delay too short?

@lramos15
Copy link
Member Author

@Tyriar It sounds like there's two concerns here.

  1. It blocks items (which I don't see on my Mac personally, but the screenshots do show it).
  2. It provides little actual value to many due to them already knowing the full path which they have open. Breadcrumbs also provides this info.

@Tyriar
Copy link
Member

Tyriar commented Feb 10, 2023

It provides little actual value to many due to them already knowing the full path which they have open

It can provide value though, adding a setting to disable it outright feels like a cop-out. Will making it less intrusive solve the problem most of the way so we can avoid the extra setting?

Users could have problems with all sorts of hovers across the product, we shouldn't be adding individual settings to disable the hovers (I'm guilty of this too with terminal.integrated.showLinkHover which I somewhat regret adding).

@Tyriar
Copy link
Member

Tyriar commented Feb 10, 2023

And if it indeed does not provide value, should we remove the hover outright? We could then explore doing something like this on hover to help with truncated items:

image

@lramos15
Copy link
Member Author

And if it indeed does not provide value, should we remove the hover outright? We could then explore doing something like this on hover to help with truncated items:

image

This seems like the best future, but quite complicated. Maybe as a stop gap we switch to custom hovers that always render outside the explorer view?

@grantsimongrant
Copy link

grantsimongrant commented Feb 12, 2023

Fixes #173236

I utilized null as an explicit lack of value here to minimize the diff, but that may create confusion surrounding when null vs undefined is used as it's not as simple as just doing !value anymore. Let me know if you think I should instead add an explicit option for disabling the tooltip.

I wish it to be used for all hovers, not just explorer hovers. Two simple solutions, add an option to disable all hovers, or set a shortcut key for all hovers, both are acceptable for me.

@grantsimongrant
Copy link

And if it indeed does not provide value, should we remove the hover outright? We could then explore doing something like this on hover to help with truncated items:
image

This seems like the best future, but quite complicated. Maybe as a stop gap we switch to custom hovers that always render outside the explorer view?

It is easier to customize whether to enable all hovers than to delete all hovers. In addition, we can use this method to achieve custom effects, increasing the upper limit of the hover delay to a few minutes, or even an hour.

@Tyriar
Copy link
Member

Tyriar commented Feb 13, 2023

Two simple solutions, add an option to disable all hovers, or set a shortcut key for all hovers, both are acceptable for me.

Both of these are unfortunately not as easy as you might expect. At least until we move all hovers onto the custom hovers (as opposed to our current mix of title attribute and custom hovers)

@lramos15 lramos15 changed the title Place explorer tooltip rendering behind a setting Polish explorer tooltip rendering Feb 13, 2023
@lramos15 lramos15 requested a review from Tyriar February 13, 2023 21:02
src/vs/workbench/services/hover/browser/hoverService.ts Outdated Show resolved Hide resolved
...options,
target: indentGuideElement,
compact: true,
additionalClasses: ['explorer-item-hover'],
Copy link
Member

Choose a reason for hiding this comment

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

The icon would be a nice addition and I see you said we can defer that, but I think aligning the position and font exactly with underneath would be really good to go out with this release. It's one of the things that makes the Windows Explorer feature so nice imo.

image

Copy link
Member Author

@lramos15 lramos15 Feb 14, 2023

Choose a reason for hiding this comment

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

image

Hopefully this is close enough. Spent quite some time trying to get the icon to work, but even cloning the row doesn't make it work because it's a psuedo element with a psuedo style. I would have to figure out how to get that pseudo element created in the hover as well.

Copy link
Member

Choose a reason for hiding this comment

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

Looks better 👍

You could maybe align it easy via getComputedStyle and then applying all the relevant font values to the hover element?

@lramos15 lramos15 requested a review from Tyriar February 14, 2023 18:51
@lramos15 lramos15 merged commit 4119dea into main Feb 14, 2023
@lramos15 lramos15 deleted the lramos15/dead-chicken branch February 14, 2023 20:34
c-claeys pushed a commit to c-claeys/vscode that referenced this pull request Feb 16, 2023
* Place explorer tooltip rendering behind a setting

* Implement windows hover behavior

* Pass the actual mouse event rather than a synthetic click

* Remove explorer setting

* Remove more code that was added for the setting

* Fix bad merge

* Address PR comments
@gregdelozier
Copy link

I don't know how to make a screenshot of it, but the "Contains emphasized items" tooltip is so large that it interferes with mouse context menu operations. It is not fixed. Please consider a setting to disable these.

@lramos15
Copy link
Member Author

@gregdelozier That will be fixed for insiders and this tooltip will not go out in stable as there is still some polish to be done here.

@dersia
Copy link

dersia commented Feb 23, 2023

I'd like to add that this is super annoying, I can't even fast-scroll through the files, because the scroll gesture gets caught by the hover and it stops scrolling, I have to look for some empty space in the explorer so I can continue scrolling. Sometimes I wish for a tooltip, if I need to see the full filename and if it is too long, but I would expect for the tooltip to work the same way tooltips work anywhere else, by staying on the item for a few seconds.

I would rather turn this off and have no tooltips than to be interrupted in my work because of the tooltip. Is there a way to turn this feature off until it is fixed?

@nosnaj
Copy link

nosnaj commented Feb 25, 2023

I never noticed the original tooltip issue, until this supposed fix made me notice it in a worse way. Now I can't scroll quickly and pulling up the context menu becomes troublesome.

@lramos15
Copy link
Member Author

I'd like to add that this is super annoying, I can't even fast-scroll through the files, because the scroll gesture gets caught by the hover and it stops scrolling, I have to look for some empty space in the explorer so I can continue scrolling. Sometimes I wish for a tooltip, if I need to see the full filename and if it is too long, but I would expect for the tooltip to work the same way tooltips work anywhere else, by staying on the item for a few seconds.

I would rather turn this off and have no tooltips than to be interrupted in my work because of the tooltip. Is there a way to turn this feature off until it is fixed?

This should be off now, still working on improving it before looking to ship this.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 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.

A option which can turn off the path hover in vscode file explorer
7 participants