Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Conversation

@babakks
Copy link
Contributor

@babakks babakks commented Apr 2, 2022

Closes microsoft/vscode#146085

Now the tooltip for call items is like this:

screenshot

@babakks
Copy link
Contributor Author

babakks commented Apr 2, 2022

@jrieken Could you please review this PR?


const item = new vscode.TreeItem(element.item.name);
item.description = element.item.detail;
item.tooltip = element.item.detail;
Copy link
Member

Choose a reason for hiding this comment

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

@alexr00 Any guidance? Looks like the custom tree defaults to the tree item's label as tooltip. Should this be the detail instead or maybe a combination of label and detail?

Copy link
Member

Choose a reason for hiding this comment

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

Given that browser default for a tooltip/title is to essentially make tooltip/title the same as the text that is being hovered over, I would keep the default tooltip as the label. It's not perfect, but this is why there's a tooltip property: extensions know best what their tooltip should be.

I could be convinced to do a combination of label and detail, but we've had it as just the label for a long time so I'd be hesitant to change it out from under everyone.

Copy link
Member

Choose a reason for hiding this comment

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

I see. For this PR I believe a combination makes sense. @babkks can you make changes to use label - detail when both are available and detail otherwise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jrieken Of course. I'm on it.

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

Please make changes to use "label - detail" when both are available and detail otherwise?

@jrieken jrieken self-requested a review April 4, 2022 09:04
Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

see comments

@babakks
Copy link
Contributor Author

babakks commented Apr 4, 2022

@jrieken I've pushed a new commit.

However, since we're assigning label with the name of the call item, it's always not null/empty. So, the check seems a little unnecessary to me.

@babakks babakks requested a review from jrieken April 4, 2022 09:23
Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

lgtm

@jrieken jrieken merged commit d3e77df into microsoft:main Apr 5, 2022
@babakks babakks deleted the add-tooltip branch April 11, 2022 09:47
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.

Improve hover in Call Hierarchy UI

3 participants