-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Make sure back to query results from context menu before changing query #3240
base: dev
Are you sure you want to change the base?
Make sure back to query results from context menu before changing query #3240
Conversation
This comment has been minimized.
This comment has been minimized.
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughThis pull request adds calls to return to the query results view in various event handlers. Specifically, it introduces Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
What would be the current behavior of change query under context menu? Directly change the query text under the context menu search text? |
As described in #3087, this is used to make sure FL will be back to query results so that As for the current behavior, 2025-02-17.14-45-11.mp4 |
I feel like ChangeQuery now simply behave weird when not at result. Should we fix that behavior (like make sure it change to Results before changing query or something)? |
From my perspective, I believe we do not need to fix that behavior because, in most scenarios, |
@jjw24 Hello, what are your thoughts on the API function |
I think if change query works fluently on context menu (i.e. change the query text for context menu) then we can skip that. If it will make the behavior of flow weird then we should fix the change query directly. Backtoqueryresult can have other usage. |
Well, I will do that. |
This comment has been minimized.
This comment has been minimized.
I will take a look on how changequery work. We can proceed this first. |
@@ -146,6 +146,7 @@ private void OpenSourceCodeLink() | |||
[RelayCommand] | |||
private void OpenDeletePluginWindow() | |||
{ | |||
PluginManager.API.BackToQueryResults(); |
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.
Should we make it consistent to App.API? Similar to the following.
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.
I use PluginManager.API here because OpenDeletePluginWindow use it to get the api instance.
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
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: 0
🧹 Nitpick comments (1)
Plugins/Flow.Launcher.Plugin.Shell/Main.cs (1)
381-381
: Consider handling task exceptions.The task result is explicitly discarded with
_
, but unhandled exceptions in the task could be silently swallowed. Consider wrapping the task body with try-catch or using proper error handling.- _ = Task.Run(() => + _ = Task.Run(async () => + { + try + { + context.API.ShowMainWindow(); + context.API.BackToQueryResults(); + context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeparator}"); + } + catch (Exception ex) + { + Log.Exception("Error in OnWinRPressed", ex); + } + });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
Flow.Launcher/CustomQueryHotkeySetting.xaml.cs
(1 hunks)Flow.Launcher/CustomShortcutSetting.xaml.cs
(1 hunks)Flow.Launcher/ResultListBox.xaml.cs
(1 hunks)Flow.Launcher/ViewModel/MainViewModel.cs
(2 hunks)Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs
(1 hunks)Flow.Launcher/ViewModel/PluginViewModel.cs
(1 hunks)Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs
(0 hunks)Plugins/Flow.Launcher.Plugin.Shell/Main.cs
(1 hunks)
💤 Files with no reviewable changes (1)
- Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs
✅ Files skipped from review due to trivial changes (1)
- Flow.Launcher/ViewModel/MainViewModel.cs
🚧 Files skipped from review as they are similar to previous changes (5)
- Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs
- Flow.Launcher/CustomQueryHotkeySetting.xaml.cs
- Flow.Launcher/CustomShortcutSetting.xaml.cs
- Flow.Launcher/ResultListBox.xaml.cs
- Flow.Launcher/ViewModel/PluginViewModel.cs
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: gitStream.cm
🔇 Additional comments (1)
Plugins/Flow.Launcher.Plugin.Shell/Main.cs (1)
383-386
: LGTM! Good addition of BackToQueryResults.The addition of
BackToQueryResults()
beforeChangeQuery
ensures consistent behavior when items are selected from the context menu, aligning with the PR objectives.
🥷 Code experts: jjw24 Jack251970 has 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:
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: To learn more about /:\ gitStream - Visit our Docs |
The
ChangeQuery
function fails to work when the selected item is from the context menu or history. To address this, we need to useBackToQueryResults
(#3087) to ensure the function works correctly in such scenarios.