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

Allow custom tree hovers to be markdown #100741

Closed
alexr00 opened this issue Jun 22, 2020 · 16 comments
Closed

Allow custom tree hovers to be markdown #100741

alexr00 opened this issue Jun 22, 2020 · 16 comments
Assignees
Labels
api api-finalization feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan tree-views Extension tree view issues
Milestone

Comments

@alexr00
Copy link
Member

alexr00 commented Jun 22, 2020

Currently, the tooltip for custom tree items can only be a string. We should also allow markdown.

@alexr00 alexr00 added api tree-views Extension tree view issues api-proposal labels Jun 22, 2020
@alexr00 alexr00 added this to the June 2020 milestone Jun 22, 2020
@alexr00 alexr00 self-assigned this Jun 22, 2020
alexr00 added a commit that referenced this issue Jun 22, 2020
alexr00 added a commit that referenced this issue Jun 23, 2020
alexr00 added a commit that referenced this issue Jun 24, 2020
@alexr00 alexr00 modified the milestones: June 2020, July 2020 Jun 24, 2020
@alexr00 alexr00 modified the milestones: July 2020, Backlog Jul 2, 2020
@mattacosta
Copy link
Contributor

So I was only able to get my tooltips containing markdown to work by implementing a do-nothing resolveTreeItem() method. Is that supposed to happen? My tree does not need to resolve any data.

@alexr00
Copy link
Member Author

alexr00 commented Jul 16, 2020

Not supposed to happen. I will take a look.

@alexr00
Copy link
Member Author

alexr00 commented Jul 16, 2020

However, if you tree is going to have many items it is better to set the markdown tooltip in resolveTreeItem so that you aren't creating all that markdown in advance.

alexr00 added a commit that referenced this issue Jul 16, 2020
@alexr00
Copy link
Member Author

alexr00 commented Jul 16, 2020

@mattacosta I pushed a fix that should be available in insiders tomorrow.

@mattacosta
Copy link
Contributor

More feedback: Not sure if anything can even be done about this, but I'm now noticing that it is significantly easier for the cursor to get into the new hovers compared to the native tooltips, thereby preventing them from going away. This makes it more difficult and/or frustrating to select the tree items that it covers.

@alexr00
Copy link
Member Author

alexr00 commented Jul 17, 2020

I think this is mostly because they are larger, but it would help if the hovers had one of their corners at your mouse, instead of starting where the tree html element starts.

@Tyriar would it be possible to do this?

@Tyriar
Copy link
Member

Tyriar commented Aug 4, 2020

@alexr00 use IHoverOptions.hideOnHover to make the hover go away when you hover over it, this is ignored if you provide actions though.

@alexr00
Copy link
Member Author

alexr00 commented Aug 4, 2020

@Tyriar would it be possible to have the corner of the hover at the mouse instead of in line with the html element it's attached to?

@Tyriar
Copy link
Member

Tyriar commented Aug 4, 2020

@alexr00 hideOnHover isn't a good enough solution? Is the hiding of tree items too disruptive? Can you show a gif of the issue as I'm not sure how to show it on the tree atm.

@alexr00
Copy link
Member Author

alexr00 commented Aug 4, 2020

@Tyriar There are things to click and select in the hover, so hideOnHover doesn't sound like something I want to use.
recording (10)

@Tyriar
Copy link
Member

Tyriar commented Aug 4, 2020

If it's at the mouse position though you would need to move the mouse to the right in order to hover it. Is this what you mean?

image

cc @misolori

@alexr00
Copy link
Member Author

alexr00 commented Aug 5, 2020

Yep, that's exactly what I mean! That way the behavior is more consistent with the default tooltip and it doesn't obscure all of the tree above it.

@Tyriar
Copy link
Member

Tyriar commented Aug 5, 2020

#104058

@usernamehw
Copy link
Contributor

Anything blocking this from moving to Stable?

@alexr00
Copy link
Member Author

alexr00 commented Oct 20, 2020

Yes, I need to get the hover working properly on resources (files and the like) when they are in the tree. Once that's good, we can move it to stable shortly after.

@jrieken
Copy link
Member

jrieken commented Nov 17, 2020

  • swap argument order
  • use ProviderResult

meganrogge pushed a commit that referenced this issue Nov 18, 2020
alexr00 added a commit that referenced this issue Nov 23, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api api-finalization feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan tree-views Extension tree view issues
Projects
None yet
Development

No branches or pull requests

6 participants
@mattacosta @jrieken @Tyriar @usernamehw @alexr00 and others