-
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
search-in-workspace: focus on next and previous search results #12703
Conversation
packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
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.
The implementation is starting to look good but there are a couple of things to address:
- the focus for previous and next results should only focus on actual results, not the file nodes themselves
- the focus for previous and next results should support the results being collapsed
Here's a quick video of what I mean:
siw-focus.mp4
packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
- Simplify the `isEnabled` command. - Add `when` context to the keybinding.
- Added a new mock tree model that contains selectable nodes Unit tests cover: - `getNextNode`, `getPrevNode` - `getNextSelectableNode`, `getPrevSelectableNode` - `selectNext`, `selectPrev` - `selectNextNode`, `selectPrevNode`
This commit simplifies the code by significantly reducing the repetition in the tests.
I'll perform a review of the pull-request tomorrow 👍 |
@vince-fugnitto ping :-) |
@msujew I helped Vlad a bit during the implementation, would you mind performing a review of the feature whenever you get a chance? There's no rush :) |
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'm happy with the changes in the PR. I have a misgiving in regards to the preview behavior for editors, but we can address this in a separate PR:
When focusing the next search result in the same file, the editor switches from the preview mode to the non-preview mode. Consequently the editor tabs stick in the main area, whereas in vscode these editors stay as preview editors.
What it does
Fixes: #12692
Adds
Search: Focus on Next Result
andSearch: Focus on Previous Result
commands to be able to quickly cycle through search results usingF4
andShift+F4
keybindings respectively. This allows the user to go through search results without having to focus on thesearch-in-workspace
view and needing to useup/down
keybindings.How to test
search-in-workspace
viewCtrl+Shift+P
) and search forSearch: Focus on Next Result
orSearch: Focus on Previous Result
search-in-workspace
view should appear and the next/previous search result should be focused and selected.OR
search-in-workspace
viewF4
andShift+F4
for theSearch: Focus on Next Result
andSearch: Focus on Previous Result
respectivelysearch-in-workspace
view should appear and the next/previous search result should be focused and selected.Review checklist
Reminder for reviewers