Skip to content

ux: preview the selected file when navigating file search results - #2654

Closed
weiningwei wants to merge 1 commit into
sourcegit-scm:developfrom
weiningwei:feature/file-search-live-preview
Closed

ux: preview the selected file when navigating file search results#2654
weiningwei wants to merge 1 commit into
sourcegit-scm:developfrom
weiningwei:feature/file-search-live-preview

Conversation

@weiningwei

Copy link
Copy Markdown
Contributor

Summary

Improves the file search experience in the commit details Files tab. Previously, picking a result from the search dropdown only wrote the full path back into the search box and filtered the file tree down to a single file — but the tree node was not selected, so the file content was not shown until the user clicked the file again in the tree.

With this change:

  • Navigating the search dropdown with the arrow keys previews the selected file directly in the file tree and the content viewer (the tree node is now selected automatically).
  • The search keyword is no longer overwritten when picking a suggestion, so multiple similarly-named files can be reviewed without re-searching.

Related issues

I'm aware of the earlier discussions in #730, #775, and especially #962 ("Searching file view does not filter view directly"). The main concern raised there was performance / lazy-loading when filtering the whole tree. This PR deliberately keeps the existing dropdown approach and only ever renders a single file in the tree, so it does not introduce the large-repository / UI-freeze concern discussed in those issues.

Changes

  • Views/RevisionFileTreeView.axaml(.cs): select the matched node after rebuilding the tree so the content viewer loads it.
  • Views/RevisionFiles.axaml(.cs): hook the dropdown SelectionChanged to live-preview the selected item; stop overwriting the search filter; close the dropdown and return focus to the search box on click/Enter.
  • ViewModels/CommitDetail.cs: drop the exact-path exclusion in the matcher (it was only needed for the old overwrite-the-filter behavior).

5 files changed, 37 insertions(+), 11 deletions(-).

@love-linger

Copy link
Copy Markdown
Collaborator

I do not want to add the preview feature when selection changed in suggestion dropdown. I've pushed a commit that only auto-select the file node in tree after picking someone in the suggestion dropdown.

@love-linger love-linger self-assigned this Aug 27, 2026
@love-linger love-linger added the not-planned It's not planned in the future label Aug 27, 2026
@weiningwei

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback. I'll close this PR.

@weiningwei weiningwei closed this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not-planned It's not planned in the future

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants