-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Make search tree context menu multiselect-aware #154847
Conversation
I noticed that right-clicking on a multiselection clears the selection so that just the item I clicked on is selected. This also needs to work with the context menu |
Maybe a difference between using the native (on mac) vs custom (on windows) context menus. You can test with the native context menu by modifying this code: vscode/src/vs/workbench/services/contextmenu/electron-sandbox/contextmenuService.ts Line 49 in 6c6d447
|
29a1c71
to
fd216f3
Compare
Any chance we can take this opportunity and align Search will all other tree views? Ie. all other tree views open on select, but allow the user to move focus around with, for example, the keyboard. Search doesn't, as pressing DownArrow will both focus and select. |
We did this on purpose, and I think this is good in the search tree. You generally are in the search tree because you want to preview search results in the editor. Reading code in the tree view is not good, you want it in the editor. If you have to arrow, then press cmd+down to open, that's a less good experience. Actually I don't even know of a way in other trees to trigger open with the keyboard but keep the focus in the tree, so then you would have to move focus back to the tree to get to the next result. (F4 is better but a slightly different scenario, and most people don't know about it) |
And I notice that when I have a multiselection, then move focus around, the focused item is not revealed in an editor. I think I would probably want that same behavior here so I can still browse results while also building a selection. |
@roblourens does this still happen? |
I think this is because the selection moves with focus usually, but not when you've multiselected. Do you want the editor reveal to occur with focus? |
I think that it's handled here
|
I think so |
Yes |
Hmm, I can't replicate with the mac context menu. Do you know what else could be causing it? |
That issue seems to be something weird that is happening in all trees, in OSS only, so don't worry about it |
@andreamah @roblourens Sorry for taking my time here. This is expected behavior, and unrelated to multiple selection. You can have N elements selected and right click on another element not part of selection. When doing so, the context actions should apply to the element which was right-clicked on, not the selection. The difference between Windows and macOS is the fact that we use native menus on macOS, which steal OS focus away from the workbench window. That combined with the fact that we don't render tree focus when the workbench window doesn't have OS focus or the list itself doesn't have DOM focus, makes it appear that the element that the user has right-clicked on isn't focused which it indeed is. Does this match what you've observed? |
I think one thing to add here is that Rob mentioned that he only saw this in OSS. |
Fixes #47166
When multiple entries are selected, if someone removes/replaces on one selected item, it happens to everything.
Note: if a whole file (uses
Replace All
) and entry (just usesReplace
) are both selected at once and eitherReplace
orReplace All
is used, whatever replace action is valid for all selected item will run. For example, if a file and entry are all selected and theReplace
button is selected on the entry, thenReplace All
will be run on the file andReplace
will be run on the entry.