-
-
Notifications
You must be signed in to change notification settings - Fork 456
[FEATURE] Folder and File Action Keywords #4088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
🥷 Code experts: Jack251970, VictoriousRaptor Jack251970, VictoriousRaptor have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
|
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
|
🥷 Code experts: Jack251970, VictoriousRaptor Jack251970, VictoriousRaptor have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
📝 WalkthroughWalkthroughThe 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
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
📒 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.csPlugins/Flow.Launcher.Plugin.Explorer/Settings.csPlugins/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.csPlugins/Flow.Launcher.Plugin.Explorer/Settings.csPlugins/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.csPlugins/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.csPlugins/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.csPlugins/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.csPlugins/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.csPlugins/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.csPlugins/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
| MergeQuickAccessInResultsIfQueryMatch(results, query); | ||
| return results.ToList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.