Skip to content

Feature: Add Windows Shell search - #19

Closed
0x5bfa wants to merge 1 commit into
mainfrom
feature/windows-shell-search
Closed

Feature: Add Windows Shell search#19
0x5bfa wants to merge 1 commit into
mainfrom
feature/windows-shell-search

Conversation

@0x5bfa

@0x5bfa 0x5bfa commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Resolved / Related Issues

Summary

  • Add an Explorer-style search box with live query updates, Enter-to-focus-results behavior, Ctrl+E/Ctrl+F/F3 shortcuts, and search-aware navigation history.
  • Execute global and folder-scoped AQS queries through the Windows Structured Query and Shell search-folder APIs.
  • Stream results progressively and support cooperative Shell enumeration cancellation on an isolated STA search lane so blocked searches do not occupy normal Shell work.

Steps used to test these changes

  1. Built src/Files/Files.csproj for Debug x64 with restore using Visual Studio MSBuild.
  2. Built and ran Files.UnitTests.exe for Debug x64: 286 total, 283 succeeded, 3 opt-in global OLE clipboard tests skipped, 0 failed.
  3. Verified focused coverage for global/scoped Windows Shell search, query cancellation services, progressive first-result publication, search navigation replacement/restoration, and scheduler lane isolation.
  4. Ran the presentation navigation tests for canceled-generation handling and repeated-location operation sharing.

Copilot AI lite review requested due to automatic review settings September 5, 2026 09:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread src/Files/Views/NavigationToolbar.xaml.cs
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.

2 participants