-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix #10369: icons of custom tree view row are not visible on mouse hover #10375
Conversation
116c597
to
84b8445
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @EstherPerelman for taking care of this.
While this works on a surface level, I noticed some issues with debouncing the forced update here. Especially when swiftly moving over the tree nodes (the hover marker will lag behind a few frames). I tried the change below and it seems to fix the issue as well. Are there any issues with this approach that I didn't notice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EstherPerelman I still feel like debouncing here is not necessary and only leads to artifacts when swiftly moving the cursor over the tree nodes. Notice how the icon always lags behind the cursor, while the background highlighting correctly moves with the cursor:
2021-11-04.16-26-39.mp4
When removing the debounce, the feature continues to work as expected, without any of the artifacts, at least in my tests. What speaks in favor of debouncing the forced update?
@msujew I added the debounce because in my test(without the debounce) the vscode.Theia.Browser.Example.-.Google.Chrome.2021-11-05.00-54-23.mp4
I changed the debounce wait value to 1ms, It seems to be better WDYS? |
@EstherPerelman Alright, thank you for the explanation. That makes me believe that forcing an update here is the wrong direction. I have another idea:
.theia-TreeNode:not(:hover):not(.theia-mod-selected) .theia-tree-view-inline-action {
display: none;
}
That way we always render the inline commands to html, but don't display them if it's not necessary. What do you think about that? |
…use hover Signed-off-by: Esther Perelman <[email protected]>
6a376d3
to
69d58ef
Compare
@msujew, in the first time I looked at this code area I wondered why the |
@EstherPerelman Yeah, it seems to be some ancient code that's been there since the first version of the inline commands and has never been touched since. The new approach looks way better. @colin-grant-work @vince-fugnitto Any possible regressions that you might see due to the CSS approach compared to using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed that the behavior works well on hover 👍
@@ -40,3 +40,7 @@ | |||
margin-bottom: 10px; | |||
margin-left: 17px; | |||
} | |||
|
|||
.theia-TreeNode:not(:hover):not(.theia-mod-selected) .theia-tree-view-inline-action { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msujew should we prefix the entry with .theia-tree-view
as not to potentially affect other views and keep the styling specific to the plugin-system?
.theia-TreeNode:not(:hover):not(.theia-mod-selected) .theia-tree-view-inline-action { | |
.theia-tree-view .theia-TreeNode:not(:hover):not(.theia-mod-selected) .theia-tree-view-inline-action { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, sounds like a good idea 👍
Hi @vince-fugnitto @msujew I pushed the change, Can you merge it soonish? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I just reconfirmed that everything works as expected.
I will probably merge this tomorrow, if there are no objections.
Signed-off-by: Esther Perelman [email protected]
What it does
Fix #10369 by replacing
update
toforceUpdateGrid
call onmouseover
event since theupdate
request not activate the rendering of the grid by react (it doesn't pass the internal React.Grid_calculateChildrenToRender
function because of old caches)How to test (also for buggy result)
tree-view-sample
extension of vscode-extensions-samples on Theia (you can easily download my custom-view-sample.zip )View
->Open View
->Packege Explorer
Review checklist
Reminder for reviewers