From 844e7a6be0e932397cadaa37babf9570be94e6d6 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Tue, 14 Oct 2025 19:35:29 -0300 Subject: [PATCH 1/9] first test --- .../Search/SearchManager.cs | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index f9d8963e6a9..c0348a4d5ef 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -1,13 +1,14 @@ -using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo; -using Flow.Launcher.Plugin.Explorer.Search.Everything; -using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; -using Flow.Launcher.Plugin.SharedCommands; -using System; +using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using Flow.Launcher.Plugin.Explorer.Exceptions; +using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo; +using Flow.Launcher.Plugin.Explorer.Search.Everything; +using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; +using Flow.Launcher.Plugin.SharedCommands; using Path = System.IO.Path; namespace Flow.Launcher.Plugin.Explorer.Search @@ -47,6 +48,9 @@ public int GetHashCode(Result obj) internal async Task> SearchAsync(Query query, CancellationToken token) { var results = new HashSet(PathEqualityComparator.Instance); + bool isPathSearch = query.Search.IsLocationPathString() + || EnvironmentVariables.IsEnvironmentVariableSearch(query.Search) + || EnvironmentVariables.HasEnvironmentVar(query.Search); // This allows the user to type the below action keywords and see/search the list of quick folder links if (ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword) @@ -58,9 +62,13 @@ internal async Task> SearchAsync(Query query, CancellationToken tok if (string.IsNullOrEmpty(query.Search) && ActionKeywordMatch(query, Settings.ActionKeyword.QuickAccessActionKeyword)) return QuickAccess.AccessLinkListAll(query, Settings.QuickAccessLinks); - var quickAccessLinks = QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks); - results.UnionWith(quickAccessLinks); + if (!isPathSearch) + { + var quickAccessLinks = QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks); + results.UnionWith(quickAccessLinks); + + } } else { @@ -69,10 +77,6 @@ internal async Task> SearchAsync(Query query, CancellationToken tok IAsyncEnumerable searchResults; - bool isPathSearch = query.Search.IsLocationPathString() - || EnvironmentVariables.IsEnvironmentVariableSearch(query.Search) - || EnvironmentVariables.HasEnvironmentVar(query.Search); - string engineName; switch (isPathSearch) @@ -103,6 +107,9 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword) searchResults = Settings.IndexProvider.SearchAsync(query.Search, token); engineName = Enum.GetName(Settings.IndexSearchEngine); break; + + + default: return results.ToList(); } @@ -240,7 +247,6 @@ private async Task> PathSearchAsync(Query query, CancellationToken throw new SearchException(Enum.GetName(Settings.PathEnumerationEngine), e.Message, e); } - return results.ToList(); } From 59288d7de78814bbe4281d8d5b67cc6d72c71413 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Wed, 15 Oct 2025 20:06:03 -0300 Subject: [PATCH 2/9] QuickAccess union --- .../Search/SearchManager.cs | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index c0348a4d5ef..a92676cb338 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -47,10 +47,6 @@ public int GetHashCode(Result obj) internal async Task> SearchAsync(Query query, CancellationToken token) { - var results = new HashSet(PathEqualityComparator.Instance); - bool isPathSearch = query.Search.IsLocationPathString() - || EnvironmentVariables.IsEnvironmentVariableSearch(query.Search) - || EnvironmentVariables.HasEnvironmentVar(query.Search); // This allows the user to type the below action keywords and see/search the list of quick folder links if (ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword) @@ -62,18 +58,16 @@ internal async Task> SearchAsync(Query query, CancellationToken tok if (string.IsNullOrEmpty(query.Search) && ActionKeywordMatch(query, Settings.ActionKeyword.QuickAccessActionKeyword)) return QuickAccess.AccessLinkListAll(query, Settings.QuickAccessLinks); - - if (!isPathSearch) - { - var quickAccessLinks = QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks); - results.UnionWith(quickAccessLinks); - - } } else { return new List(); + } + var results = new HashSet(PathEqualityComparator.Instance); + bool isPathSearch = query.Search.IsLocationPathString() + || EnvironmentVariables.IsEnvironmentVariableSearch(query.Search) + || EnvironmentVariables.HasEnvironmentVar(query.Search); IAsyncEnumerable searchResults; @@ -86,7 +80,6 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.PathSearchActionKeyword) || ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword): results.UnionWith(await PathSearchAsync(query, token).ConfigureAwait(false)); - return results.ToList(); case false @@ -108,12 +101,12 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword) engineName = Enum.GetName(Settings.IndexSearchEngine); break; - - default: return results.ToList(); } + results.UnionWith(QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks)); + try { await foreach (var search in searchResults.WithCancellation(token).ConfigureAwait(false)) From 60319546e9bedfa1e660f2094fc245adcecbc6de Mon Sep 17 00:00:00 2001 From: 01Dri Date: Wed, 15 Oct 2025 20:11:09 -0300 Subject: [PATCH 3/9] Code quality --- Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index a92676cb338..74f02e0834c 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -47,6 +47,7 @@ public int GetHashCode(Result obj) internal async Task> SearchAsync(Query query, CancellationToken token) { + var results = new HashSet(PathEqualityComparator.Instance); // This allows the user to type the below action keywords and see/search the list of quick folder links if (ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword) @@ -64,7 +65,6 @@ internal async Task> SearchAsync(Query query, CancellationToken tok return new List(); } - var results = new HashSet(PathEqualityComparator.Instance); bool isPathSearch = query.Search.IsLocationPathString() || EnvironmentVariables.IsEnvironmentVariableSearch(query.Search) || EnvironmentVariables.HasEnvironmentVar(query.Search); From b34cd93ff6c9c8dea75ef1a10a8151af6545a109 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Wed, 15 Oct 2025 20:11:42 -0300 Subject: [PATCH 4/9] Code quality --- Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 74f02e0834c..3994aa9c87d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading; From 995b7248c6ceddbd8820be5e3b2f7630a784bfe5 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Wed, 15 Oct 2025 20:14:18 -0300 Subject: [PATCH 5/9] Code quality --- .../Search/SearchManager.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 3994aa9c87d..1c87b73c7ce 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -62,14 +62,14 @@ internal async Task> SearchAsync(Query query, CancellationToken tok else { return new List(); - } + + IAsyncEnumerable searchResults; + bool isPathSearch = query.Search.IsLocationPathString() || EnvironmentVariables.IsEnvironmentVariableSearch(query.Search) || EnvironmentVariables.HasEnvironmentVar(query.Search); - IAsyncEnumerable searchResults; - string engineName; switch (isPathSearch) @@ -80,7 +80,6 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.PathSearchActionKeyword) results.UnionWith(await PathSearchAsync(query, token).ConfigureAwait(false)); return results.ToList(); - case false when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKeyword): @@ -91,7 +90,6 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKey searchResults = Settings.ContentIndexProvider.ContentSearchAsync("", query.Search, token); engineName = Enum.GetName(Settings.ContentSearchEngine); break; - case false when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword) || ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword): @@ -99,7 +97,6 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword) searchResults = Settings.IndexProvider.SearchAsync(query.Search, token); engineName = Enum.GetName(Settings.IndexSearchEngine); break; - default: return results.ToList(); } @@ -239,6 +236,7 @@ private async Task> PathSearchAsync(Query query, CancellationToken throw new SearchException(Enum.GetName(Settings.PathEnumerationEngine), e.Message, e); } + return results.ToList(); } From ebfa125d5bf932ef5b198a3384c729b56538b936 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Wed, 15 Oct 2025 20:15:41 -0300 Subject: [PATCH 6/9] Up --- .../Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 1c87b73c7ce..dfc6a5ea8b8 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -67,8 +67,8 @@ internal async Task> SearchAsync(Query query, CancellationToken tok IAsyncEnumerable searchResults; bool isPathSearch = query.Search.IsLocationPathString() - || EnvironmentVariables.IsEnvironmentVariableSearch(query.Search) - || EnvironmentVariables.HasEnvironmentVar(query.Search); + || EnvironmentVariables.IsEnvironmentVariableSearch(query.Search) + || EnvironmentVariables.HasEnvironmentVar(query.Search); string engineName; @@ -79,7 +79,9 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.PathSearchActionKeyword) || ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword): results.UnionWith(await PathSearchAsync(query, token).ConfigureAwait(false)); + return results.ToList(); + case false when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKeyword): @@ -90,6 +92,7 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKey searchResults = Settings.ContentIndexProvider.ContentSearchAsync("", query.Search, token); engineName = Enum.GetName(Settings.ContentSearchEngine); break; + case false when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword) || ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword): From dab56b199e7f276bb37a2bc00d4e8c6e0c698466 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Wed, 15 Oct 2025 20:22:31 -0300 Subject: [PATCH 7/9] Adjust usings --- .../Search/SearchManager.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index dfc6a5ea8b8..a884bb0e7ca 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -1,13 +1,13 @@ -using System; +using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo; +using Flow.Launcher.Plugin.Explorer.Search.Everything; +using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; +using Flow.Launcher.Plugin.SharedCommands; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using Flow.Launcher.Plugin.Explorer.Exceptions; -using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo; -using Flow.Launcher.Plugin.Explorer.Search.Everything; -using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; -using Flow.Launcher.Plugin.SharedCommands; using Path = System.IO.Path; namespace Flow.Launcher.Plugin.Explorer.Search From d35313ff9ecb57519ba8465a9339070c268fecd2 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 20 Oct 2025 23:50:24 +1100 Subject: [PATCH 8/9] add handling of searching with Quick Access action keyword --- .../Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index a884bb0e7ca..e09e510ba70 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -57,10 +57,10 @@ internal async Task> SearchAsync(Query query, CancellationToken tok { if (string.IsNullOrEmpty(query.Search) && ActionKeywordMatch(query, Settings.ActionKeyword.QuickAccessActionKeyword)) return QuickAccess.AccessLinkListAll(query, Settings.QuickAccessLinks); - } else { + // Handle scenario where all search options have action keyword set, return to avoid running further search logic. return new List(); } @@ -100,6 +100,11 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword) searchResults = Settings.IndexProvider.SearchAsync(query.Search, token); engineName = Enum.GetName(Settings.IndexSearchEngine); break; + + case true or false + when ActionKeywordMatch(query, Settings.ActionKeyword.QuickAccessActionKeyword): + return QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks); + default: return results.ToList(); } From e308d538c0658be5b365f7f58e993b3e4447c6af Mon Sep 17 00:00:00 2001 From: Jeremy Date: Tue, 21 Oct 2025 00:14:30 +1100 Subject: [PATCH 9/9] update clarifying comments --- Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index e09e510ba70..d7b0690828a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -60,7 +60,7 @@ internal async Task> SearchAsync(Query query, CancellationToken tok } else { - // Handle scenario where all search options have action keyword set, return to avoid running further search logic. + // No action keyword matched- plugin should not handle this query, return empty results. return new List(); } @@ -109,6 +109,7 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.QuickAccessActionKeyword): return results.ToList(); } + // Merge Quick Access Link results for non-path searches. results.UnionWith(QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks)); try