Feature: Add Windows Shell search - #19
Closed
0x5bfa wants to merge 1 commit into
Closed
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
There is at least one concrete build-quality issue (an unused using directive) that should be fixed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds an Explorer-style Windows Shell search experience to ReFiles, spanning UI, command plumbing, navigation history semantics, and a Windows Structured Query/Shell search-folder implementation with progressive result streaming and cancellation support.
Changes:
- Adds a dedicated search omnibar with keyboard shortcuts (Ctrl+E/Ctrl+F/F3), live query updates, and Enter-to-focus-results behavior.
- Implements Windows Shell-backed search locations (global and folder-scoped) using Structured Query parsing and search-folder APIs, with cooperative enumeration cancellation and an isolated STA “search” lane.
- Extends navigation/history behavior to support “update search” and “exit search” semantics, with new unit test coverage.
File summaries
| File | Description |
|---|---|
| tests/Files.UnitTests/WindowsShellSearchTests.cs | Adds end-to-end tests for global/scoped Shell search and cancellation service behavior. |
| tests/Files.UnitTests/WindowsShellSchedulerTests.cs | Verifies blocked search work doesn’t occupy concurrent STA workers. |
| tests/Files.UnitTests/WindowsShellPreviewTests.cs | Updates test scheduler shim to include search-lane invocation. |
| tests/Files.UnitTests/SessionTests.cs | Adds tests for search-aware navigation history replace/restore semantics. |
| tests/Files.UnitTests/BrowseSessionTests.cs | Adds test ensuring first search result publishes before enumeration completes. |
| src/Files/Views/RootView.xaml.cs | Wires new keyboard-focus request from the toolbar to the active folder view. |
| src/Files/Views/PaneHost.xaml.cs | Extends folder view focus helper to support keyboard focus state. |
| src/Files/Views/NavigationToolbar.xaml.cs | Implements search omnibar event handling and keyboard accelerators. |
| src/Files/Views/NavigationToolbar.xaml | Adds search omnibar UI and keyboard accelerators; adjusts layout columns. |
| src/Files/Views/FolderBrowser.xaml | Makes empty-folder text search-aware via view-model binding. |
| src/Files/ViewModels/RootViewModel.cs | Exposes and injects SearchCommand into the navigation toolbar view model. |
| src/Files/ViewModels/NavigationToolbarViewModel.cs | Adds live-search state management and dispatch to the search command. |
| src/Files/ViewModels/FolderBrowserViewModel.cs | Adds CanSearch, SearchText, EmptyMessage, and search navigation behavior. |
| src/Files/Strings/en-US/Resources.resw | Adds localized strings for search UI and validation messaging. |
| src/Files/Commands/Handlers/NavigationCommandHandler.cs | Adds a Search command handler and updates state/concurrency behavior. |
| src/Files/Commands/CommandIds.cs | Introduces a new command id for navigation search. |
| src/Files/Commands/CommandContext.cs | Adds Query convenience accessor for string command parameters. |
| src/Files/Commands/AppCommandRegistration.cs | Registers the Search command in the app command registry. |
| src/Files/Adapters/BrowsePresentationAdapter.cs | Makes navigation task coalescing mode-aware; supports search-origin navigation; broadens column support to a new provider interface. |
| src/Files.Core/Windows/WindowsStorageSource.cs | Adds creation of Windows Shell search folders with scope validation. |
| src/Files.Core/Windows/WindowsFilesCoreBuilderExtensions.cs | Registers a browse location handler for Shell search locations. |
| src/Files.Core/Windows/Search/WindowsShellSearchFolderFactory.cs | Creates Shell search-folder items via Structured Query parsing and conditions. |
| src/Files.Core/Windows/Search/WindowsShellQueryContinue.cs | Implements IQueryContinue service to provide cooperative cancellation. |
| src/Files.Core/Windows/Search/WindowsShellEnumerationCancellationSite.cs | Attaches query-continuation services to Shell enumerators for cancellation. |
| src/Files.Core/Windows/Search/WindowsSearchBrowseLocationHandler.cs | Adds a Windows search location handler producing a search browse context. |
| src/Files.Core/Windows/Search/WindowsSearchBrowseLocationContext.cs | Implements a search browse context with parent resolution, sorting, columns, and interactive enumeration. |
| src/Files.Core/Windows/Scheduling/WindowsShellScheduler.cs | Adds a dedicated STA lane for search enumeration work and disposes it. |
| src/Files.Core/Windows/Scheduling/IWindowsShellScheduler.cs | Adds InvokeSearchAsync with a default fallback implementation. |
| src/Files.Core/Windows/Metadata/IWindowsShellColumnProvider.cs | Introduces a shared column-provider abstraction for Shell-backed contexts. |
| src/Files.Core/Windows/Items/WindowsStorableFactory.cs | Adds search-folder creation, search-lane enumeration, smaller initial batches, and cancellation-site wiring for search enumerators. |
| src/Files.Core/Windows/Items/WindowsStorableDescriptor.cs | Adds IsSearchFolder metadata to descriptors. |
| src/Files.Core/Windows/Items/WindowsShellItemResolver.cs | Adds resolver entrypoint for scheduling work on the search STA lane. |
| src/Files.Core/Windows/Interop/Extras.cs | Adds COM interface definitions needed for Structured Query parsing and query-continuation services. |
| src/Files.Core/Sessions/BrowsePaneSession.cs | Adds search-aware navigation history modes (UpdateSearch, ExitSearch). |
| src/Files.Core/NativeMethods.txt | Extends CsWin32 inputs for Structured Query and search-folder related COM types. |
| src/Files.Core/Browsing/FolderBrowseLocationContext.cs | Implements the new column-provider interface for regular folders. |
| src/Files.Core/Browsing/BrowseSession.cs | Tunes initial batch sizing to publish first search results earlier. |
| src/Files.Controls/Omnibar/OmnibarMode.Properties.cs | Fixes null-owner guard braces and routes mode text changes through a new API. |
| src/Files.Controls/Omnibar/Omnibar.cs | Adds a mode-driven programmatic text update path that preserves change-reason semantics. |
Review details
- Files reviewed: 39/39 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
45 tasks
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.
Resolved / Related Issues
Summary
Steps used to test these changes
src/Files/Files.csprojfor Debug x64 with restore using Visual Studio MSBuild.Files.UnitTests.exefor Debug x64: 286 total, 283 succeeded, 3 opt-in global OLE clipboard tests skipped, 0 failed.