microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.09k stars 28.81k forks source link

Treeview multiselect is flakey #208802

Open eamodio opened 6 months ago

eamodio commented 6 months ago

I've been adding multi-select support to GitLens treeview and noticed a few issues with tree views with canSelectMany enabled

Using shift-click, ctrl-click don't usually work correctly the "first" time, but seem to (usually) fix themselves on repeated attempts.

https://github.com/microsoft/vscode/assets/641685/3b90fb79-37db-49ed-9a88-1db52e0d3217

In the above, I've made a quick modification to the TreeView Sample to enabled canSelectMany and just added a few more nodes to make it easier to see. And then clicked the first node, and then shift-clicked the last, and you can see that it didn't fully select all the nodes in between. But when I repeated the shift-click it fixed it.

I am not sure what causes it to work/not work sometimes and not others -- but it always seems to not work the first time, but there are other cases when it is just flakey.

/cc @alexr00

alexr00 commented 5 months ago

I'm having trouble reproducing this issue, even on the "first" time. If you find some other way to get a good repro I'd like to take a look!

alexr00 commented 5 months ago

Possible repro steps: https://github.com/microsoft/vscode/assets/54879025/1052625a-aff6-49fc-bb07-8d8958b976ad

eamodio commented 5 months ago

Reproduces easily for me

https://github.com/microsoft/vscode/assets/641685/3ad87349-c5cc-4b28-bd0a-0a56686ac8f5

I'm on Windows if that matters

alexr00 commented 5 months ago

I can repro 👍