Skip to content

FIX: Selecting a History result does not bump the result until Home Page result list is refreshed again - #4638

Open
01Dri wants to merge 2 commits into
Flow-Launcher:devfrom
01Dri:fix/issue-4379
Open

FIX: Selecting a History result does not bump the result until Home Page result list is refreshed again#4638
01Dri wants to merge 2 commits into
Flow-Launcher:devfrom
01Dri:fix/issue-4379

Conversation

@01Dri

@01Dri 01Dri commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary by cubic

Summary of changes

Fixes search results not refreshing when the query is empty after hiding and reopening the launcher.

  • ChangeQueryTextAsync in LastQueryMode.Empty now passes isReQuery: true so opening the launcher triggers a fresh search.
  • Added an empty-query check in LastQueryMode.Preserved and Selected that passes isReQuery: true.
  • LastQueryMode.ActionKeywordPreserved and ActionKeywordSelected now pass isReQuery: true when the action keyword query is rebuilt.
  • No existing behavior removed; only a boolean parameter and a conditional were added.
  • No memory usage impact; the change only passes a boolean and checks a string.
  • No security risks introduced.
  • No unit tests added for this change.

Release Note

Fixes search results not updating when the query is empty after closing and reopening the launcher.

Written for commit fba17f1. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added this to the 2.2.0 milestone Aug 31, 2026
@01Dri 01Dri changed the title fix: requery in results when query string is empty FIX: Selecting a History result does not bump the result until Home Page result list is refreshed agai Aug 31, 2026
@01Dri 01Dri changed the title FIX: Selecting a History result does not bump the result until Home Page result list is refreshed agai FIX: Selecting a History result does not bump the result until Home Page result list is refreshed again Aug 31, 2026
@01Dri

01Dri commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

ISSUE: #4379 (comment)

@01Dri
01Dri marked this pull request as ready for review August 31, 2026 18:23
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6ce9ee48-cb9f-4da0-9f98-5b48ce4a329e

📥 Commits

Reviewing files that changed from the base of the PR and between 9c1f74e and fba17f1.

📒 Files selected for processing (1)
  • Flow.Launcher/ViewModel/MainViewModel.cs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Hide now forces re-querying when it restores empty, preserved, selected, or action-keyword queries.

Changes

Last-query restoration

Layer / File(s) Summary
Restore and re-query last queries
Flow.Launcher/ViewModel/MainViewModel.cs
Hide passes isReQuery: true for empty and action-keyword restoration. Preserved and selected modes re-query when the current query is empty.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fba17

This change refreshes launcher results when restoring empty or previously selected queries by reusing the existing search path. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: davidgbrett, jack251970

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the search-result refresh bug addressed by the changes. It is specific and related to the main change, although the wording is slightly awkward.
Description check ✅ Passed The description accurately explains the empty-query refresh fix and identifies the affected last-query restoration modes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Flow.Launcher/ViewModel/MainViewModel.cs">

<violation number="1" location="Flow.Launcher/ViewModel/MainViewModel.cs:2388">
P2: In LastQueryMode.Empty (the default), this forces a fresh query on every Hide whenever the query text is already empty, since ChangeQueryTextAsync hits its isReQuery branch for an unchanged empty string. That means every dismissal of the launcher — including dismissals that never result in a reopen, dismissals right after executing a result (line 610), and plugin reloads (line 334) — now runs a full background search. Consider scoping the re-query (e.g., only when reopening on Show, or only when a stale-result condition holds) instead of unconditionally re-querying on every close.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

{
case LastQueryMode.Empty:
await ChangeQueryTextAsync(string.Empty);
await ChangeQueryTextAsync(string.Empty, isReQuery: true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: In LastQueryMode.Empty (the default), this forces a fresh query on every Hide whenever the query text is already empty, since ChangeQueryTextAsync hits its isReQuery branch for an unchanged empty string. That means every dismissal of the launcher — including dismissals that never result in a reopen, dismissals right after executing a result (line 610), and plugin reloads (line 334) — now runs a full background search. Consider scoping the re-query (e.g., only when reopening on Show, or only when a stale-result condition holds) instead of unconditionally re-querying on every close.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Flow.Launcher/ViewModel/MainViewModel.cs, line 2388:

<comment>In LastQueryMode.Empty (the default), this forces a fresh query on every Hide whenever the query text is already empty, since ChangeQueryTextAsync hits its isReQuery branch for an unchanged empty string. That means every dismissal of the launcher — including dismissals that never result in a reopen, dismissals right after executing a result (line 610), and plugin reloads (line 334) — now runs a full background search. Consider scoping the re-query (e.g., only when reopening on Show, or only when a stale-result condition holds) instead of unconditionally re-querying on every close.</comment>

<file context>
@@ -2385,19 +2385,23 @@ public async void Hide(bool reset = true)
                 {
                     case LastQueryMode.Empty:
-                        await ChangeQueryTextAsync(string.Empty);
+                        await ChangeQueryTextAsync(string.Empty, isReQuery: true);
                         break;
                     case LastQueryMode.Preserved:
</file context>

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