Repository navigation
Add find all button - #7559
Add find all button#7559Yisi (yisibl) wants to merge 2 commits into
Conversation
|
By analyzing the blame information on this pull request, we identified Asuka (@Inori) and alexandrudima to be potential reviewers |
|
Hi Yisi (@yisibl), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
|
Yisi (@yisibl), Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
| "label.nextMatchButton": "下一个匹配", | ||
| "label.noResults": "无结果", | ||
| "label.previousMatchButton": "上一个匹配", | ||
| "label".allMatchButton": "选中所有匹配", |
There was a problem hiding this comment.
I think we don't modify locaization files ourselves, only touch the English version.
There was a problem hiding this comment.
Peng Lyu (@rebornix) Do you mean that do not modify the localization file? Should I submit a PR to increase localization translation?
There was a problem hiding this comment.
yup, just leave it there, it will be handled by the localization team.
There was a problem hiding this comment.
yup, just leave it there, it will be handled by the localization team.
There was a problem hiding this comment.
Done!
By the way, how do I open a localized UI to vscode after the source code is compiled?
There was a problem hiding this comment.
I removed the localized changes.
|
alexandrudima This can be merge? |
|
I would like to bring in our UX folks on this, rather than just merging it in and get their advice on how we can add functionality to the find widget without overdoing it. Steven Clarke (@stevencl) Brad Gashler (@bgashler1) Can I please get your opinion on this proposal? |
|
alexandrudima Thanks! |
|
I really like the idea. We might consider doing something similar to Visual Studio. Instead of three separate buttons for find next, find previous and find all, VS has a button with a drop down that allows you to select the specific action you want to use. So it would look something like this mockup (showing what the user sees when they click the drop down):
Brad Gashler (@bgashler1) might have some other, better ideas. I haven't spoken with him about this today. |
|
I am more inclined to the 100% width of the search box, and the height is adaptive. Now the search box is too short, and the preparation of the code when you may often need to search for a relatively long code fragment. If it is a 100% width search box, then there is no need to fold(drop down) the buttons. Sublime Text: By the way, usually the focus of our vision is on the left, especially when full screen writing code, usually we will set up more than 80 characters automatically wrap. So now the search box aligned to the right, I think the user experience is not good. Anyway I expect the next version can be added to Thanks! |
|
Thanks Yisi (@yisibl). I understand the points you are making about the current find experience. As you've pointed out, Sublime has a very different user experience for find and find in files. We use the small box for find and a viewlet for find in files so that we minimise the extent to which we interfere with the code that the user is browsing. In order to accommodate richer find interactions such as the one you are proposing here we need to ensure that we minimise the amount of code we obscure when we draw the find UI. Hence my suggestion above (and the reason why we align the find UI to the right). So without any major modifications to the current find UI, I would recommend the drop down button to expose the Find All command. That way we incorporate the new functionality without requiring major changes to the overall find UX. |
|
I'll review this PR in next iteration when I do full width find widget. |
|
Peng Lyu (@rebornix) Where's the plan for "full width find widget"? |
|
Steven Clarke (@stevencl) use for all (∀) symbol. |
|
Best to design another codicon for it |
|
I have logged a issue for adding a bespoke icon specifically for this pull and other uses of "select all" in the UI |
4f8b579
|
It's embarrassing that this is 6 years old! |
|
Find all button in other places is usually for show list of them, not select! Just an idea: Also, there is an extension currently do this but main problem there is no way to back previous state of search panel. (it could solve with using search editor) |
|
I personally think the caption should be "Select All Matches" like the exploration done in #14836. |
ZM (zm-cttae)
left a comment
There was a problem hiding this comment.
Yisi (@yisibl) This conflicts with the new orthogonal "Find all" new window button implemented #128915 and the naming is internally inconsistent.
As some context, the #14836 issue split into two feature requests:
1. "Find all" `new-file` icon to launch a new search editor file
2. "Select all matches" `expand-all` icon
I'll try and make some suggestions ... this review should hopefully get us a working "select all" button.
|
Nvm I will make a PR to your fork branch and see if I can reup this. yisibl#1 |
|
hi, Peng Lyu (@rebornix) , could you please take a look |
|
Is this still relevant? |
|
👍 |
|
can't believe pull request from 2016 is still open. |
|
This is supported today by pressing Alt Enter in the Find Widget. Do we really need a button for this? |
|
I would be OK with having this shortcut only, but usually, keyboard shortcuts are esoteric to me. |
|
What would resonate with me, instead of having a dedicated button visible all the time: while holding Alt, the user can either press Enter (supported today) or find that the two arrows suddenly transform into a single Holding Alt to show alternative actions is a pattern we already have in a lot of places around the workbench. Screen.Recording.2025-11-05.at.16.51.16.mov |
|
Orb Code Review (powered by GLM-4.7 on Orb Cloud) SummaryThis PR adds a "Find All" button (labeled "Select all matches") to VS Code's find widget. The button appears to allow users to select all matches of the search term in the editor. The implementation adds the UI button, styling, and calls a new Architecturesrc/vs/editor/contrib/find/findWidget.css (lines 19-23) New button styling: .monaco-editor .find-widget .find-all {
width: auto;
padding: 0 .5em;
text-align: center;
}
src/vs/editor/contrib/find/findWidget.ts Interface extension (line 36):
Localization strings (lines 42-43): const NLS_ALL_MATCH_BTN_LABEL = nls.localize('label.allMatchButton', "Select all matches");
const NLS_FIND_ALL = nls.localize('label.findAll', "Find All");
Button declaration (line 51):
Button state management (line 59): this._allMatchBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount);
Button creation (lines 68-76): this._allMatchBtn = this._register(new SimpleButton({
label: NLS_ALL_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.SelectAllMatchesAction),
className: 'find-all',
onTrigger: () => {
this._controller.selectAllMatches();
},
onKeyDown: (e) => {}
}));
UI insertion (lines 85-87): actionsContainer.appendChild(this._allMatchBtn.domNode);
this._allMatchBtn.domNode.appendChild(document.createTextNode(NLS_FIND_ALL));
IssuesfindWidget.ts:73 — critical — Missing implementation of The PR adds the UI button and calls onTrigger: () => {
this._controller.selectAllMatches(); // Method implementation not shown
},Problems:
Recommendations:
findWidget.ts:87 — style — Direct DOM manipulation The code directly manipulates the DOM to add text to the button: this._allMatchBtn.domNode.appendChild(document.createTextNode(NLS_FIND_ALL));Issues:
Suggestion: Either:
this._allMatchBtn = this._register(new SimpleButton({
label: NLS_FIND_ALL,
className: 'find-all',
onTrigger: () => {
this._controller.selectAllMatches();
},
onKeyDown: (e) => {}
}));
findWidget.ts:75 — style — Empty keyboard handler The onKeyDown: (e) => {}Question: Should this handle keyboard events like the other buttons? If not, why not? If yes, what should it do? Suggestion: Either:
this._allMatchBtn = this._register(new SimpleButton({
label: NLS_ALL_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.SelectAllMatchesAction),
className: 'find-all',
onTrigger: () => {
this._controller.selectAllMatches();
}
}));
findWidget.css:19-23 — style — Specificity could be improved The CSS selector uses high specificity: .monaco-editor .find-widget .find-all {
width: auto;
padding: 0 .5em;
text-align: center;
}Suggestion: Consider if this is necessary or if a simpler selector would work: .find-widget .find-all {
width: auto;
padding: 0 0.5em;
text-align: center;
}However, if the higher specificity is needed to override other styles, keep it as is. findWidget.ts:59 — logic — Button enable/disable logic The button is enabled only when: this._allMatchBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount);Question: Is this the correct behavior? Should the button be enabled even if there are no matches (0 matches found)? Consideration:
Recommendation: Document the intended behavior in a comment: // Enable the button only when there are matches to select
this._allMatchBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount);Cross-file Impact
Assessment❌ Request changes This PR is incomplete and cannot be merged in its current state. Critical issues:
Required changes before merging:
The PR shows good structure for the UI changes, but the core functionality is missing. Once the implementation is complete, this would be a valuable addition to VS Code's find widget. |




Fixed #14836
