Skip to content

FindWidget/TerminalFindWidget: Provide random access to search matches via an inline "Nth Match" input field. #309109

Open
boborrob wants to merge 18 commits intomicrosoft:mainfrom
boborrob:findWidget_terminalFindWidget-arbitrary_access_to_matches
Open

FindWidget/TerminalFindWidget: Provide random access to search matches via an inline "Nth Match" input field. #309109
boborrob wants to merge 18 commits intomicrosoft:mainfrom
boborrob:findWidget_terminalFindWidget-arbitrary_access_to_matches

Conversation

@boborrob
Copy link
Copy Markdown

@boborrob boborrob commented Apr 10, 2026

Summary:

Allow users to access search results arbitrarily using an inline input field in the findWidget and terminalFindWidget components.

Motivation:

For large sets of search results, cycling through matches sequentially can be cumbersome and time-consuming, especially when the relative location of the desired match is already known with some certainty. An input allows the user to jump arbitrarily to the desired match or to at least get closer to it much faster.

The editor exhibits a similar behavior already, but the means for invoking it are buried in the quickInput service. With this change, the functionality is presented upfront with no real cost to the existing UX. The information presented to the user at the outset is the same. Except now, there's an an inline "knob" the user can turn for more granular control over the search experience.

The terminal editor benefits from this change too, and since it's an upstream dependency (xterm.js), the change is implemented there as well. See this PR for details.

Example Usages:

Screenshot_20260410_170551-1

Future Enhancements:

  • Jump to the last match when the matchesCount widget is clicked.
  • Move to the next/previous match on input scroll

Robert Dambreville and others added 13 commits April 2, 2026 11:11
- Proof-of-concept UI changes
- Add an editable numerical input field to the findWidget that allows the user to jump to matches a la  random access (jump functionality pending)
- Proof-of-concept API/functionality changes
- More compliance and alignment with existing data model and class hiearchy
- Misc bug fixes pending
- Cleanup pending
- Better file and class names
- Better alignment with findController and findModel APIs
- Register a new `MoveToEditableNthMatch ` EditorAction
- Add More key event handlers (not finished)
- Enforce width of the input box
- Don't recreate the input on every update.
- Consider adding scroll event listener for mouse-driven step functionality
- Cleanup still pending
- Restore 'No Results' error message when the input search string yields 0 matches.
- Fallback to default text input element behavior.
- Add up/down arrow key support for step behavior native to numerical input elements.
- Remove unnecessary comments and scar tissue.
…get .

- UI/API proof-of-concept.
- Build, link and troubleshoot a local build of @xterm node_module, modified to  support nth match.
- Before fixing focus-retention issue of NthMatchInput in terminal simpleFindWidget
 - Fix focus-retention issue
 - Use the incumbent dom.FocusTracker to handle focus and blur events
- Fix the focus-retention issue.
- Use the incumbent dom.FocusTracker to handle focus and blur events.
- Combine editor and terminal changes
- On input/change, update the width of  `nthMatchInput` to fit the length of its value
- Test the editor and terminal finders at their pre-defined `MATCHES_LIMIT` of `19999` matches.
@boborrob
Copy link
Copy Markdown
Author

@boborrob please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

- `findWidget`: Refer to `nthMatchInput`\'s `domNode` like the surrounding `focusTracker`s do with their respective controls.

- `terminalFindWidget`: Investigate coupling of `themeService.onDidthemeColorChange` events to the  `find(previous: boolean)` call . The normal `findWidget` has no such coupling. Is this intentional?
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering Bot commented Apr 14, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@kycutler

Matched files:

  • src/vs/workbench/contrib/browserView/electron-browser/features/browserEditorFindFeature.ts

@jruales

Matched files:

  • src/vs/workbench/contrib/browserView/electron-browser/features/browserEditorFindFeature.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants