Skip to content

Return results when query is empty for Program #3796

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Jack251970
Copy link
Member

Check string.IsNullOrEmpty(query.Search) for Program plugin so that Flow can return results when query is empty for program

@coderabbitai coderabbitai bot added the enhancement New feature or request label Jul 4, 2025
Copy link

gitstream-cm bot commented Jul 4, 2025

🥷 Code experts: no user but you matched threshold 10

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

See details

Plugins/Flow.Launcher.Plugin.Program/Main.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR 187 additions & 139 deletions
MAR
FEB 96 additions & 14 deletions

Knowledge based on git-blame:
Jack251970: 59%
VictoriousRaptor: 7%

Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR 10 additions & 11 deletions
MAR
FEB

Knowledge based on git-blame:
Jack251970: 1%

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Activity based on git-commit:

Jack251970
JUL
JUN
MAY
APR 19 additions & 20 deletions
MAR
FEB

Knowledge based on git-blame:
VictoriousRaptor: 35%
Jack251970: 2%

To learn more about /:\ gitStream - Visit our Docs

Copy link

gitstream-cm bot commented Jul 4, 2025

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

@Jack251970 Jack251970 added this to the 2.0.0 milestone Jul 4, 2025
Copy link
Contributor

coderabbitai bot commented Jul 4, 2025

📝 Walkthrough

Walkthrough

The changes adjust filtering and matching logic in the plugin's program search functionality. Now, when the search query is empty, results are less strictly filtered by score or precision, allowing more results to be shown. When the query is non-empty, stricter filtering is applied. Some fallback matching logic is also restricted to non-empty queries.

Changes

File(s) Change Summary
Plugins/Flow.Launcher.Plugin.Program/Main.cs Modified result filtering: includes all results when query is empty, filters by positive score when not empty.
Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs Adjusted precision score check: allows results when query is empty even if precision not met; minor cleanup.
Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs Fallback candidate matching now only occurs if the query is non-empty.

Suggested labels

enhancement

Suggested reviewers

  • jjw24

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b440aaa and 80b7775.

📒 Files selected for processing (3)
  • Plugins/Flow.Launcher.Plugin.Program/Main.cs (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: jjw24
PR: Flow-Launcher/Flow.Launcher#2887
File: .cm/gitstream.cm:20-20
Timestamp: 2024-08-14T13:42:20.540Z
Learning: Ensure that search queries for GitHub PRs correctly match the available milestones and labels in the repository to avoid empty results.
Learnt from: jjw24
PR: Flow-Launcher/Flow.Launcher#2887
File: .cm/gitstream.cm:20-20
Timestamp: 2024-10-08T15:52:58.573Z
Learning: Ensure that search queries for GitHub PRs correctly match the available milestones and labels in the repository to avoid empty results.
Plugins/Flow.Launcher.Plugin.Program/Main.cs (1)
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#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.
Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs (2)
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#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.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#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.
Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs (1)
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#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.
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Report (PR)
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (3)
Plugins/Flow.Launcher.Plugin.Program/Main.cs (1)

107-107: LGTM! Correctly implements empty query handling.

The filtering logic now appropriately includes all results when the query is empty, allowing users to browse available programs without typing. When a query is provided, the original score-based filtering is maintained.

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs (1)

139-139: LGTM! Consistent with empty query strategy.

The fallback matching logic is correctly restricted to non-empty queries, ensuring that when users browse without typing, the additional matching overhead is avoided while still allowing alternative matches when needed.

Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs (1)

427-427: LGTM! Maintains consistency across program types.

The condition correctly ensures UWP apps are included in results when the query is empty, maintaining consistent behavior with Win32 programs and aligning with the overall empty query strategy.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Jack251970 Jack251970 enabled auto-merge July 4, 2025 02:54
@Jack251970 Jack251970 requested a review from jjw24 July 4, 2025 03:31
@jjw24
Copy link
Member

jjw24 commented Jul 4, 2025

How do I reproduce the issue this PR is resolving?

@Jack251970
Copy link
Member Author

How do I reproduce the issue this PR is resolving?

set an action keyword for program plugin and search it

@jjw24
Copy link
Member

jjw24 commented Jul 5, 2025

So this can then be improved to return a list of saved program results and also via the home page?

@Jack251970
Copy link
Member Author

Jack251970 commented Jul 5, 2025

So this can then be improved to return a list of saved program results and also via the home page?

Hmm, I have thought about this before. And I think we can open another PR for it.

My thinking is to add a new context menu item - Pin to home - so that some applications will be shown in home page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants