Skip to content

Conversation

@01Dri
Copy link
Contributor

@01Dri 01Dri commented Nov 3, 2025

CHANGES

  • Added new File and Folder action keywords

  • Added action keyword–based result filtering

  • Refactored the Search Manager

OBS: I've decided to refactor the Search Manager in Explorer because, with each new action keyword, it was necessary to add code in multiple places.
Now, it's much easier to understand how each action keyword works and how filters are applied.

@github-actions github-actions bot added this to the 2.1.0 milestone Nov 3, 2025
@gitstream-cm
Copy link

gitstream-cm bot commented Nov 3, 2025

🥷 Code experts: Jack251970, VictoriousRaptor

Jack251970, VictoriousRaptor have most 👩‍💻 activity in the files.
jjw24 has most 🧠 knowledge in the files.

See details

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Activity based on git-commit:

Jack251970 VictoriousRaptor
NOV
OCT
SEP 1 additions & 0 deletions
AUG
JUL 7 additions & 0 deletions 28 additions & 15 deletions
JUN 7 additions & 0 deletions

Knowledge based on git-blame:
jjw24: 20%

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

Activity based on git-commit:

Jack251970 VictoriousRaptor
NOV
OCT
SEP 2 additions & 2 deletions
AUG
JUL
JUN 12 additions & 0 deletions

Knowledge based on git-blame:
jjw24: 18%

Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs

Activity based on git-commit:

Jack251970 VictoriousRaptor
NOV
OCT
SEP 3 additions & 6 deletions
AUG
JUL 2 additions & 6 deletions
JUN 2 additions & 0 deletions

Knowledge based on git-blame:
jjw24: 8%

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs

Activity based on git-commit:

Jack251970 VictoriousRaptor
NOV
OCT
SEP 9 additions & 9 deletions
AUG
JUL 17 additions & 13 deletions 33 additions & 6 deletions
JUN 51 additions & 27 deletions

Knowledge based on git-blame:
jjw24: 5%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link

gitstream-cm bot commented Nov 3, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

@gitstream-cm
Copy link

gitstream-cm bot commented Nov 3, 2025

🥷 Code experts: Jack251970, VictoriousRaptor

Jack251970, VictoriousRaptor have most 👩‍💻 activity in the files.
jjw24 has most 🧠 knowledge in the files.

See details

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Activity based on git-commit:

Jack251970 VictoriousRaptor
NOV
OCT
SEP 1 additions & 0 deletions
AUG
JUL 7 additions & 0 deletions 28 additions & 15 deletions
JUN 7 additions & 0 deletions

Knowledge based on git-blame:
jjw24: 20%

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

Activity based on git-commit:

Jack251970 VictoriousRaptor
NOV
OCT
SEP 2 additions & 2 deletions
AUG
JUL
JUN 12 additions & 0 deletions

Knowledge based on git-blame:
jjw24: 18%

Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs

Activity based on git-commit:

Jack251970 VictoriousRaptor
NOV
OCT
SEP 3 additions & 6 deletions
AUG
JUL 2 additions & 6 deletions
JUN 2 additions & 0 deletions

Knowledge based on git-blame:
jjw24: 8%

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs

Activity based on git-commit:

Jack251970 VictoriousRaptor
NOV
OCT
SEP 9 additions & 9 deletions
AUG
JUL 17 additions & 13 deletions 33 additions & 6 deletions
JUN 51 additions & 27 deletions

Knowledge based on git-blame:
jjw24: 5%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

📝 Walkthrough

Walkthrough

The pull request extends the Explorer plugin with two new action keywords for folder and file search functionality. Changes span UI strings, settings configuration, search query logic, and view model initialization to support keyword-specific search behavior and filtering.

Changes

Cohort / File(s) Summary
Localization
Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
Adds two new string resources for folder search and file search action keyword labels
Settings infrastructure
Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
Expands ActionKeyword enum from internal to public with FolderSearchActionKeyword and FileSearchActionKeyword members; adds four new public properties for keyword strings and enable flags; implements GetActiveActionKeyword(string) method and updates existing keyword getter/setter methods
Search query logic
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
Refactors action keyword handling to use local variables (keywordStr, isPathSearch, activeActionKeyword) for conditional branching; adds path search vs. content/index search branching logic; introduces ShouldSkip filtering and MergeQuickAccessInResultsIfQueryMatch helper; updates result handling for each keyword type
Settings UI integration
Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs
Adds new action keyword model pairs for folder search and file search in InitializeActionKeywordModels method; minor whitespace change in PromptUserSelectPath

Sequence Diagram

sequenceDiagram
    actor User
    participant SearchManager
    participant Settings
    participant SearchLogic
    
    User->>SearchManager: Query with action keyword
    SearchManager->>Settings: GetActiveActionKeyword(keyword)
    Settings-->>SearchManager: ActionKeyword enum value (or null)
    
    alt Active keyword found and enabled
        SearchManager->>SearchLogic: Determine search type
        alt Path search
            SearchLogic->>SearchLogic: PathSearchAsync()
        else Folder search
            SearchLogic->>SearchLogic: Index/content search<br/>(filter non-folders)
        else File search
            SearchLogic->>SearchLogic: Index/content search<br/>(filter non-files)
        else Quick access
            SearchLogic->>SearchLogic: Return Quick Access links
        end
        SearchLogic-->>SearchManager: Filtered results
    else No active keyword
        SearchManager->>SearchLogic: Merge with Quick Access
        SearchLogic-->>SearchManager: Combined results
    end
    
    SearchManager-->>User: Final results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • SearchManager.cs: Review the refactored action keyword conditional flow, new filtering logic with ShouldSkip, and integration of MergeQuickAccessInResultsIfQueryMatch
  • Settings.cs: Verify the new public API surface, GetActiveActionKeyword resolution logic, and consistency of keyword/enable property mappings in getter/setter methods
  • Integration points: Ensure SearchManager correctly consumes the new Settings API and filters results per keyword type

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • onesounds
  • Jack251970
  • jjw24

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "[FEATURE] Folder and File Action Keywords" directly and clearly describes the primary change in the changeset. The modifications across all files—adding new UI strings for folder and file search keywords in en.xaml, expanding the ActionKeyword enum with FolderSearchActionKeyword and FileSearchActionKeyword in Settings.cs, refactoring SearchManager.cs to handle these new keywords, and updating SettingsViewModel.cs to wire them up—all coalesce around introducing these new action keywords. The title is concise, specific, and sufficient for a teammate to understand the main feature being delivered without scanning the full changeset.
Description Check ✅ Passed The pull request description is related to the changeset and provides meaningful context about the changes. It explicitly mentions adding new File and Folder action keywords, implementing action keyword-based result filtering, and refactoring the Search Manager, all of which are reflected in the code modifications. The author's note about the rationale for refactoring—centralizing keyword handling to avoid scattered code duplication—adds clarity and purpose. The description is sufficiently detailed to convey the scope of the changes without being vague or off-topic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Nov 3, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2ac321 and a4d3c80.

📒 Files selected for processing (4)
  • Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (4 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs (7 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs (2 hunks)
🧰 Additional context used
🧠 Learnings (10)
📚 Learning: 2025-09-05T11:56:27.267Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3593
File: Flow.Launcher/HotkeyControlDialog.xaml:6-6
Timestamp: 2025-09-05T11:56:27.267Z
Learning: In Flow.Launcher's migration to iNKORE.UI.WPF.Modern UI framework, dialog resource keys like PopuBGColor, PopupButtonAreaBGColor, PopupButtonAreaBorderColor, and PopupTextColor are provided by the iNKORE.UI.WPF.Modern framework itself, not defined locally in the codebase theme files.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
📚 Learning: 2025-07-21T09:19:19.012Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher.Core/Plugin/PluginManager.cs:280-292
Timestamp: 2025-07-21T09:19:19.012Z
Learning: In Flow Launcher's PluginManager.cs, the post-initialization operations (RegisterResultsUpdatedEvent, UpdatePluginMetadataTranslation, RegisterPluginActionKeywords, DialogJump.InitializeDialogJumpPlugin, and AddPluginToLists) are designed to be exception-safe and do not require additional try-catch error handling according to the maintainer Jack251970.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs
📚 Learning: 2025-10-16T10:48:30.573Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher/App.xaml.cs:252-275
Timestamp: 2025-10-16T10:48:30.573Z
Learning: In Flow Launcher's App.xaml.cs, the plugin initialization block (lines 252-275) that includes PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, _mainVM.QueryResults(), and API.SaveAppAllSettings() does not require additional Task.Run wrappers or Dispatcher.InvokeAsync calls according to maintainer Jack251970, as the threading model is already safe as designed.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs
📚 Learning: 2025-07-21T09:19:49.684Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher/App.xaml.cs:246-262
Timestamp: 2025-07-21T09:19:49.684Z
Learning: In Flow Launcher's App.xaml.cs, the asynchronous plugin initialization task (containing AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, and AutoPluginUpdates) does not require additional try-catch error handling according to maintainer Jack251970, as these operations are designed to handle exceptions internally.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
📚 Learning: 2025-06-24T19:06:48.344Z
Learnt from: Koisu-unavailable
Repo: Flow-Launcher/Flow.Launcher PR: 3770
File: Flow.Launcher/ViewModel/MainViewModel.cs:0-0
Timestamp: 2025-06-24T19:06:48.344Z
Learning: In Flow.Launcher's Explorer plugin results, the SubTitle property always contains the directory containing the file. For file results, Title contains the filename and SubTitle contains the parent directory. For directory results, SubTitle contains the directory path itself.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
📚 Learning: 2024-11-03T07:40:11.014Z
Learnt from: Yusyuriv
Repo: Flow-Launcher/Flow.Launcher PR: 3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
📚 Learning: 2025-10-16T09:29:19.653Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher.Core/Plugin/PluginManager.cs:519-523
Timestamp: 2025-10-16T09:29:19.653Z
Learning: In Flow Launcher's PluginManager.cs QueryDialogJumpForPluginAsync method, when a DialogJump plugin is still initializing, returning null is intentional behavior. This allows the query to fall through to the default Explorer plugin, which serves as a fallback handler. This is different from QueryForPluginAsync and QueryHomeForPluginAsync, which show "still initializing" messages because they don't have fallback mechanisms.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
📚 Learning: 2025-09-04T11:52:29.096Z
Learnt from: jjw24
Repo: Flow-Launcher/Flow.Launcher PR: 3932
File: Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs:48-55
Timestamp: 2025-09-04T11:52:29.096Z
Learning: In Flow Launcher's PluginsManifest.cs, when dealing with version parsing for the MinimumAppVersion feature, maintainer jjw24 prefers to keep the solution simple rather than implementing comprehensive helper methods for SemVer parsing normalization.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
📚 Learning: 2025-07-01T05:46:13.251Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
📚 Learning: 2025-07-06T12:21:37.947Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.

Applied to files:

  • Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
🧬 Code graph analysis (2)
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (7)
Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs (2)
  • Settings (14-240)
  • ActionKeyword (227-238)
Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs (1)
  • IsLocationPathString (246-265)
Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs (3)
  • EnvironmentVariables (10-109)
  • IsEnvironmentVariableSearch (25-31)
  • HasEnvironmentVar (33-41)
Plugins/Flow.Launcher.Plugin.Explorer/Search/QuickAccessLinks/QuickAccess.cs (1)
  • QuickAccess (7-41)
Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs (5)
  • IAsyncEnumerable (75-90)
  • IAsyncEnumerable (92-126)
  • IAsyncEnumerable (128-145)
  • EverythingSearchManager (12-146)
  • EverythingSearchManager (18-21)
Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndexSearchManager.cs (7)
  • IAsyncEnumerable (24-44)
  • IAsyncEnumerable (46-63)
  • IAsyncEnumerable (65-84)
  • IAsyncEnumerable (86-89)
  • IAsyncEnumerable (91-94)
  • IAsyncEnumerable (96-99)
  • IAsyncEnumerable (101-120)
Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs (8)
  • ResultManager (16-412)
  • Result (62-72)
  • Result (95-173)
  • Result (175-178)
  • Result (180-183)
  • Result (185-227)
  • Result (257-283)
  • Result (285-343)
Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs (1)
Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs (2)
  • Settings (14-240)
  • ActionKeyword (227-238)
🪛 GitHub Check: Check Spelling
Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs

[warning] 282-282:
actionkeywordview is not a recognized word. (unrecognized-spelling)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

Comment on lines +63 to +64
MergeQuickAccessInResultsIfQueryMatch(results, query);
return results.ToList();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Filter Quick Access results for type-specific keywords

Folder/File action keywords still surface Quick Access items of the opposite type because MergeQuickAccessInResultsIfQueryMatch doesn’t respect the active keyword. For example, add a Quick Access link to a .txt file and run the new folder-only keyword—its result still appears, defeating the filter. Extend the merge helper to accept the active keyword and drop mismatched Quick Access entries so the new feature behaves correctly.

-                MergeQuickAccessInResultsIfQueryMatch(results, query);
+                MergeQuickAccessInResultsIfQueryMatch(results, query, null);
@@
-            MergeQuickAccessInResultsIfQueryMatch(results, query);
+            MergeQuickAccessInResultsIfQueryMatch(results, query, activeActionKeyword);
@@
-        private void MergeQuickAccessInResultsIfQueryMatch(HashSet<Result> results, Query query)
+        private void MergeQuickAccessInResultsIfQueryMatch(HashSet<Result> results, Query query, ActionKeyword? activeActionKeyword)
         {
-            var quickAccessMatched = QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks);
-            if (quickAccessMatched != null && quickAccessMatched.Any()) results.UnionWith(quickAccessMatched);
+            var quickAccessMatched = QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks);
+            if (quickAccessMatched == null || quickAccessMatched.Count == 0)
+            {
+                return;
+            }
+
+            if (activeActionKeyword is ActionKeyword.FolderSearchActionKeyword)
+            {
+                quickAccessMatched = quickAccessMatched
+                    .Where(r => r.ResultType is ResultType.Folder or ResultType.Volume)
+                    .ToList();
+            }
+            else if (activeActionKeyword is ActionKeyword.FileSearchActionKeyword)
+            {
+                quickAccessMatched = quickAccessMatched
+                    .Where(r => r.ResultType is ResultType.File)
+                    .ToList();
+            }
+
+            if (quickAccessMatched.Count > 0)
+            {
+                results.UnionWith(quickAccessMatched);
+            }
         }

Also applies to: 107-109, 282-286

🤖 Prompt for AI Agents
In Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs around lines
63-64 (also update callers at 107-109 and 282-286), the
MergeQuickAccessInResultsIfQueryMatch helper is merging Quick Access entries
without considering the active keyword type, so folder-only or file-only
keywords still show opposite-type Quick Access items; change the helper
signature to accept the active keyword (or an enum/flag indicating folder vs
file) and, before merging, filter out Quick Access entries whose target type
does not match the active keyword, then update every call site (lines 63-64,
107-109, 282-286) to pass the current active keyword/flag so mismatched Quick
Access items are dropped during the merge.

@01Dri 01Dri closed this Nov 3, 2025
@jjw24 jjw24 removed this from the 2.1.0 milestone Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10 min review enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants