Skip to content

Conversation

@01Dri
Copy link
Contributor

@01Dri 01Dri commented Oct 15, 2025

CHANGES

  • Union results with Quick Access Links only when it’s not a path search action.

@prlabeler prlabeler bot added the bug Something isn't working label Oct 15, 2025
@github-actions github-actions bot added this to the 2.1.0 milestone Oct 15, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

📝 Walkthrough

Walkthrough

Removed early quick-access population inside the action-keyword branch, added an early-return path when QuickAccessActionKeyword matches, and ensured quick-access results are merged at the end for non-early-return searches; minor whitespace and a clarifying comment were added.

Changes

Cohort / File(s) Summary of Changes
Search flow and quick access merging
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
Removed pre-emptive computation/UnionWith of QuickAccess.AccessLinkListMatched inside the action-keyword branch; added early-return when QuickAccessActionKeyword is matched to immediately return QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks); always merge quick-access results later with a final UnionWith for non-early-return paths; minor isPathSearch whitespace tweak and added explanatory comment.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant SearchManager
  participant PrimarySearch
  participant QuickAccess

  rect rgb(245,245,255)
  note over SearchManager: Old flow (before)
  User->>SearchManager: Query
  SearchManager->>PrimarySearch: Build main results
  alt ActionKeyword branch (old)
    SearchManager->>QuickAccess: AccessLinkListMatched(query, links)
    QuickAccess-->>SearchManager: Quick access results
    SearchManager->>SearchManager: UnionWith (early)
  end
  SearchManager-->>User: Final results
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant SearchManager
  participant PrimarySearch
  participant QuickAccess

  rect rgb(235,255,235)
  note over SearchManager: New flow (after)
  User->>SearchManager: Query
  SearchManager->>PrimarySearch: Build main results
  alt QuickAccessActionKeyword matched (early-return)
    SearchManager->>QuickAccess: AccessLinkListMatched(query, links)
    QuickAccess-->>SearchManager: Quick access results
    SearchManager-->>User: Return quick-access results (early)
  else Not early-return
    SearchManager->>PrimarySearch: Continue other search branches
    SearchManager->>QuickAccess: AccessLinkListMatched(query, links)
    QuickAccess-->>SearchManager: Quick access results
    SearchManager->>SearchManager: UnionWith (final step)
    SearchManager-->>User: Final results
  end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • taooceros
  • Jack251970

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "BUG: Explorer plugin navigate path should only show results in current path" directly aligns with the changeset's main objective. The changes modify the SearchManager to ensure Quick Access links are only merged into results when it's not a path search operation, which precisely implements the behavior described in the title. The title is specific, concise, and clearly communicates the bug fix being addressed without being vague or misleading.
Description Check ✅ Passed The PR description "Union results with Quick Access Links only when it's not a path search action" is directly related to the changeset. This accurately describes the core change implemented in SearchManager.cs where Quick Access results are now conditionally merged only for non-path searches, exactly as stated in the description. While brief, the description is specific enough to convey the intent and relates meaningfully to the actual code changes.
✨ 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.

@gitstream-cm
Copy link

gitstream-cm bot commented Oct 15, 2025

🥷 Code experts: Jack251970

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

See details

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

Activity based on git-commit:

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

Knowledge based on git-blame:
jjw24: 19%

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

@gitstream-cm
Copy link

gitstream-cm bot commented Oct 15, 2025

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

Copy link
Member

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

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

Thanks for your fix! But I am not sure if this change is correct. Please wait for jjw24's review

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: 0

🧹 Nitpick comments (2)
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (2)

112-113: Consider adding a clarifying comment.

This line is only reached for FileContentSearch and IndexSearch actions (both non-path searches), which might not be immediately obvious. Consider adding a comment to clarify when quick access links are merged.

+            // Merge quick access links for non-path searches (FileContentSearch and IndexSearch)
             results.UnionWith(QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks));

63-63: Optional: Comment could be slightly clearer.

The comment is technically correct but requires domain knowledge to fully understand. Consider rephrasing for clarity.

-                // 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.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dab56b1 and d35313f.

📒 Files selected for processing (1)
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (3)
Plugins/Flow.Launcher.Plugin.Explorer/Search/QuickAccessLinks/QuickAccess.cs (3)
  • List (11-28)
  • List (30-40)
  • QuickAccess (7-41)
Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs (1)
  • IsLocationPathString (246-265)
Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs (1)
  • Settings (13-205)
⏰ 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). (2)
  • GitHub Check: build
  • GitHub Check: Check Spelling
🔇 Additional comments (3)
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (3)

77-83: LGTM! Path searches correctly exclude quick access links.

The early return here ensures that path searches (with PathSearchActionKeyword or SearchActionKeyword) do not merge quick access links, which correctly implements the PR objective.


104-106: LGTM! QuickAccessActionKeyword correctly returns only filtered quick access results.

This new case properly handles the QuickAccessActionKeyword for both path-like and non-path queries, ensuring users see only quick access links when using this specific keyword.


52-140: Excellent fix! Logic correctly prevents quick access links in path searches.

The changes properly implement the PR objective:

  • Path searches (lines 77-83) return early without merging quick access links ✓
  • Non-path searches (FileContentSearch and IndexSearch) merge quick access links at line 112 ✓
  • QuickAccessActionKeyword (lines 104-106) returns only quick access results ✓

All execution paths have been verified to behave correctly.

@jjw24
Copy link
Member

jjw24 commented Oct 20, 2025

@01Dri the change is good, just needed to handle one more scenario where users may search through Quick Access list using path query. I have added the change, please have a look and let me know if it's ok.

@jjw24 jjw24 enabled auto-merge (squash) October 20, 2025 13:17
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: 0

🧹 Nitpick comments (2)
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (2)

69-72: Minor: cache query.Search and short‑circuit empty input.

Small readability/perf win and avoids repeating property calls.

-            bool isPathSearch = query.Search.IsLocationPathString()
-                || EnvironmentVariables.IsEnvironmentVariableSearch(query.Search)
-                || EnvironmentVariables.HasEnvironmentVar(query.Search);
+            var search = query.Search;
+            bool isPathSearch = !string.IsNullOrEmpty(search) && (
+                search.IsLocationPathString()
+                || EnvironmentVariables.IsEnvironmentVariableSearch(search)
+                || EnvironmentVariables.HasEnvironmentVar(search));

112-114: Quick Access union for non‑path flows looks right; two tiny nits.

  • Behavior: When File Content Search is selected and Everything content search is disabled, the early return at Lines 88‑91 bypasses this union. Confirm that you don’t want Quick Access mixed into that “enable content search” prompt.
  • Micro‑opt: skip the call on empty search.
-            // Merge Quick Access Link results for non-path searches.
-            results.UnionWith(QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks));
+            // Merge Quick Access Link results for non-path flows (Index/FileContent searches).
+            if (!string.IsNullOrEmpty(query.Search))
+                results.UnionWith(QuickAccess.AccessLinkListMatched(query, Settings.QuickAccessLinks));

If intended to include Quick Access with the “enable content search” result, move this union before the early return at Lines 88‑91 or append a second union just before that return.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d35313f and e308d53.

📒 Files selected for processing (1)
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (3)
Plugins/Flow.Launcher.Plugin.Explorer/Search/QuickAccessLinks/QuickAccess.cs (3)
  • List (11-28)
  • List (30-40)
  • QuickAccess (7-41)
Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs (1)
  • IsLocationPathString (246-265)
Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs (1)
  • Settings (13-205)
⏰ 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
🔇 Additional comments (2)
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (2)

63-65: Good guard and clear intent.

Early return on unmatched action keyword is correct for scoping the plugin. Comment reads well.


104-107: Early return for Quick Access action (path or not) — nice.

This cleanly handles “search Quick Access by path‑looking queries” and matches the reviewer’s scenario.

Please sanity‑check:

  • qa + empty search → full Quick Access list.
  • qa + “C:\” → filtered Quick Access items only.
  • search/path keywords + “C:\” → only filesystem results, no Quick Access.

@01Dri
Copy link
Contributor Author

01Dri commented Oct 20, 2025

@01Dri the change is good, just needed to handle one more scenario where users may search through Quick Access list using path query. I have added the change, please have a look and let me know if it's ok.

I tested the new scenario and it worked correctly. Everything looks good

@jjw24 jjw24 merged commit 1bfd147 into Flow-Launcher:dev Oct 21, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Explorer plugin navigate path should only show results in current path

3 participants