-
Notifications
You must be signed in to change notification settings - Fork 1
Add context menu #9
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
Comments
That's a great idea! I'll incorporate this for sure. Thanks for the example as well! |
@jjw24 I looked through the various API options and tried change query, requery, showmainwindow, but nothing worked. Appreciate any help/guidance! Thanks. |
The return back to query result from context menu is from this code, which is only triggered when the query search window is hidden after triggering the action. I am guessing in your code your context menu is set to not hide after selection? I don't see why we cannot add the same behaviour even when the query search window is not hidden after context menu result action and also create an API call for it. Could you please create an issue for this. In the meantime if it's possible, save your query string before the context menu so you can use the change query API to return/change back to the previous result via the original query. This API call should work, when I had a look it is re-query call that doesn't run if it's in the context menu. Let me know how this goes. |
Thanks @jjw24! Yes, since this is more of an item management plugin vs. typical fuzzy finder, I mostly avoid exiting the flowlauncher UI after command execution (some exceptions) so the user doesn't have to re-open each time. I noticed the code you sent is within the ViewModel class, forgive my ignorance, but when I leveraged the code you provided from the Explorer plugin, I removed the import of ViewModel because I wasn't sure of its significance and the code seemed to work without it. I searched the API reference docs but couldn't find a definition. Is there a doc or docstring in code that explains what this class does? In the meantime, I will do my best to incorporate it back in based on your link and also do as you say with caching the original query so I can then revert back. I can definitely put in an issue for adding the return back to query behavior when window is not hidden. Thanks for your help! |
@jjw24 Flow-Launcher/Flow.Launcher#3222 created! |
Plugins won't be able to access flow's ViewModel directly, they will only be able to do actions (some are originating in the ViewModel) via the API. Are you referring to Explorer's own ViewModel? Let know how you go with the ChangeQuery API. |
@jjw24 Thanks for claryifying that, I may have conflated the two because when I pulled some code from the original example you provided based on Explorer, I noticed it pulled in ViewModel but I wasn't exactly sure what this was doing and after removing it, it didn't seem to cause any issues (these lines). Then when you sent the code that triggers exiting the context menu, I noticed that happened to be in a class called ViewModel so I was thinking maybe that code I originally removed was actually required. At any rate, I tried to use the ChangeQuery api action (for testing purposes just hardcoded the query) which does run, however, it runs against the contextmenu result rather than exiting the contextmenu and requerying as expected. I pushed the dev branch for this feature if you want to see what I have thus far: FYI, I am an absolute noob when it comes to C#. In my day job, most of my time is spent in SQL and Python. I really like this plugin and since it seemed simple enough, saw it as a great opportunity to learn something new. Just some context in case you see anything egregious in there lol. |
@jjw24 FYI, Jack Ye commented on the recent issue I submitted (link to issue) for adding the go back API action and it appears this feature may have already been merged recently back in November 24 (link to pr). I am pretty sure this is exactly what I was hoping to accomplish but wanted to confirm with you first before cancelling the issue you requested me to put in. If this does meet the exact need, do you have an anticipated timeline for when the new version release of Flow.Launcher.Plugin would be available in the NuGet repo? |
I will take a look when I get free time, this does sound like the right behaviour. |
Apologies I forgot about that feature, that does address the issue. In terms of timeline, I had come across some issues when I tested the dev branch, so at the current stage I am not comfortable releasing it. I will take another look and test, and will get back to you on a timeline. |
Okay, fantastic, I will go ahead and cancel the issue I put in the other day. Appreciate your help on this and no rush. I will mark this issue as on-hold for the time being awaiting the next flow api release. |
@jjw24 Howdy, hope all is well! Just wanted to touch base to see if you anticipate the new api being released soon in Nuget. |
Hi @Or1g3n, all is well, hope you too. v1.20.0 has alot of new exciting things the guys have put together, will aim to complete testing and release it by end of this month. |
That's great to hear on both accounts! Sounds like an exciting release, appreciate the update! |
Maybe consider adding context menu so users can go to context menu on a todo for things like editing or completing that particular item. Otherwise need to re-type or edit the query.
See Explorer plugin as a code example https://github.com/Flow-Launcher/Flow.Launcher/blob/dev/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs.
The text was updated successfully, but these errors were encountered: