feat(pr-files-changed): add search with case toggle and match highlights#1029
Closed
blinkeye-lcm wants to merge 2 commits into
Closed
feat(pr-files-changed): add search with case toggle and match highlights#1029blinkeye-lcm wants to merge 2 commits into
blinkeye-lcm wants to merge 2 commits into
Conversation
Contributor
|
Skipping in this review pass — no CI checks reported yet (workflow waiting for maintainer approval). Will revisit once CI runs. |
Contributor
|
Auto-skipping this pass: no CI checks have been reported on this branch (no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a search subsystem to the PR Files Changed view. The search input sits above the file tree, filters the tree to files with matches, highlights every match inline across both Split and Unified diff views (layered on top of the existing add/del/word-diff tints), and surfaces a per-file match count badge.
Behavior
Aatoggle inside the input switches to case-sensitive matching, with visible pressed/unpressed state.N matches in M files, shown only while a search is active.No matches for "X"when nothing matches.Implementation notes
SearchSpecobject ({ query, caseSensitive }) so the query and the matching mode cannot drift apart between props.FileSearchIndex) cache both raw and lowercased forms once per file load, so toggling case sensitivity does not re-lowercase patches on every keystroke.hitsByFilename,visibleFiles,fileTree,hitsByPath, in-line highlights) runs againstuseDeferredValue(searchQuery), so fast typing never blocks the input on large PRs.isFolder,sortTreeNodes,pluralize,splitByQuery,buildSearchIndex,buildHitsByPath) keep the parent component readable and eliminate duplicated logic at the call sites.ClearSearchAdornmentfromsrc/components/common/for the clear button so the search field matches the other table search inputs in the app.Related Issues
Fixes #1030
Type of Change
Screenshots
before:

after:
after.webm
Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpasses