-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Add action keywords for each plugin #6129
Conversation
- Added keywords for each plug-in - Change window walker search to use Query, not RawQuery (to get rid of action keyword) - Make sure plug-ins that have action keywords as well as are in global list don't get added twice All tests passed that passed before I started Addressing issue microsoft#5823
Failed tests seem to be the rename - which looks like it is failing across many many tests not just mine. I am not sure how to mark as "ready for review" - but this does need input/help at the very least from maintainers. |
Note: Normally the corresponding issue and not an commit id is named here.
A PR is ready to review if it is not marked as draft. |
Thanks!
|
rerunning CI, failure was transient |
CI passed. We're getting toward end of our 0.21 release window. Lets target this for 0.22 release window as i want to have more time to try this |
Sounds great! Let me know what you need from me. |
Playing around with this, liking it but the indexer didn't want to work. On 0.22 it does work and on master. General rules, if a file can use it, i don't think it should a hot key, example & since & will pull up snip & sketch other apps. Like:
Unsure of hotkey:
Don't think we need:
|
@gordonwatts looking at your PR, really don't see why indexer wouldn't work |
I noticed this last night when I tried the indexer for the first time. I thought I'd tested it. I'll get all the commits from master and then have a go at it. Actually, I see there are now conflicts, so I need to do this anyway, I suppose. I'll take your advice on keyboard shortcuts as well when I do that. |
Note side effect: you will not not be able to search for things that start with one of the plug-in keywords.
This reverts commit e3b0ecd.
This is an update:
Need to investigate (mostly note to myself):
Your proposed keyboard shortcuts are fine. I'll update those when I've figured out what is going on above. Apologies - I have an early morning code review shift for my work so more tomorrow! |
@gordonwatts, bet you got some weird point in time where maybe something broke it and we fixed it in a later commit |
Why
|
I have adjusted the keywords in the last push, and I checked that they were all working. I also updated the top of this MR to reflect the new keywords (I hope that was appropriate in this project!) I think those are the updates you asked me for, @crutkas. Three points:
|
Didn't quite get the if statement right the first time I put it in.
Hello, I had this suggestion elsewhere in #6691 to have different dedicated key activation shortcuts for launching powertoys-run in different modes for searching.
Maybe this is what is already proposed above, it's not clear to me, so adding this suggestion here FWIW. |
I like some of these! The "currently active app" might be especially cool, if it could do tabs in chrome/edge (I see that the tabs will appear in the atl-tab display at some point for edge). I'd suggest those become separate requests, however, rather than adding to this PR (depending on the feelings of the project coordinators, of course). The one thing that might impact this is if it is better to have a different windows-level keyboard shortcut instead of the keys you enter here. In that case, this should be closed, and we should start from scratch. |
It would be significantly more efficient and quicker to be able to directly go into a specific search mode, than a 2 step process to first activate the app and then to go into a desired mode and then do the search. It may seem there's just one extra key stroke, but it's more than that practically speaking. |
In pure window switching mode, it would be even better to list the user-chosen n number of most recently used windows in MRU order, as opposed to the current approach where the search window pops up blank or with the last search string. All of this makes for a fast, efficient text based alt-tab switcher on steroids. Just another thought. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Playing with this, feels a lot more solid. I have two requests that i feel make this natural.
Thoughts? A lot is, what feels intutative and natural. I sync'ed with Craig from WSL and he felt they all seemed natural. @ryanbodrug-microsoft / @alekhyareddy28 / @enricogior would love your opinion. |
@crutkas |
i find & to be a stretch keystroke. happy to get more opinions. |
I like the |
@crutkas, I agree with the Program plugin. I think Regarding the PR, since we're not executing the global plugins once we see an action keyword, I wanted to point out that we should be mindful of adding action keywords which might be a part of a valid query in the future. We might not get a few results because of this. @gordonwatts I'll test out this PR and review it sometime today. Thank you for this! |
Ok. Just to make sure we are on the same page here. I should change:
For the testing, @alekhyareddy28, the thing that needs to be tested is how it handles the global plug-ins after dealing with the non-global plug-ins. That logic doesn't really come into play unless the global plug-in list is built, and that isn't something that is passed in as an argument - the routine pulls it from a global variable. I looked a little bit into the moq framework to see if it could do global variable injection, but it didn't look like it. However, my knowledge of this framework is pretty minimal, so it is quite possible I missed something. |
@gordonwatts yes, please change that. |
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 did try out the changes in this PR and they look good to me.
A few comments -
- @crutkas,
.
seems to be a valid regex character that is valid for the indexer and ww plugin. On adding.
as an action keyword we would not see those results anymore. I'm not sure if anyone is extensively using them but just wanted to point that out.
So previously .txt would show up all the txt files but they won't show up once we set the action keyword of the program plugin to .
- @gordonwatts It would be great to have a few tests to ensure that we don't break any functionality in the future as well.
We could analyze the plugin-query pairs that are returned by theBuild
function to see how the global plugins are handled. You could convert theBuild
function so as to take theGlobalPlugins
as an argument. This should fix the issue and it should be easy to add tests for the same. This would make it quite similar to how the non-global plugins are being handled right now.
Modify it to something like -
public static Dictionary<PluginPair, Query> Build(ref string text, Dictionary<string, PluginPair> nonGlobalPlugins, List<PluginPair> GlobalPlugins)
This way you can pass the GlobalPlugins and then analyze the plugin-query pairs to see how the global plugins were handled.
Once the tests are in and the action keywords are updated to // and . as suggested by crutkas the PR should be good to get in. Thank you!
Clarification regarding the above comment. I was wrong about the period being treated as a regex by the indexer plugin. Indexer does not treat the Period as a regex. Even ww seems to have it's own scoring mechanism which just compares characters.
|
Thanks, @alekhyareddy28, for the careful look!
|
Issue #7378 captures the remaining work related to unit testing this functionality. |
@@ -1,6 +1,6 @@ | |||
{ | |||
"ID":"B4D3B69656E14D44865C8D818EAE47C4", | |||
"ActionKeyword":"*", | |||
"ActionKeyword": "*", | |||
"Name":"Folder", | |||
"Description":"Searcn and open folders", |
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.
Typo: Searcn -> Search
@crutkas @gordonwatts Any considerations/thoughts on being able invoke specific modes with a direct keyboard shortcut as suggested/discussed above? Just curious. Thanks. |
@damnskippy, something discussed in #5273 |
Summary of the Pull Request
Added keywords for each plug-in the PowerToys Run module.
The keywords proposed are:
All the plug-ins that were a member of the global plug-in list (used "*" as an action keyword in the json configuration) retain that.
PR Checklist
Info on Pull Request
See discussion in issue #5823. Changes most
plugin.json
files in the PowerToys Runner plug in to useactionKeywords
rather thanactionKeyword
, and adds a non-global keyword as noted above.Other Changes:
Two things were needed to make action keywords work properly. Hopefully, they do not impact other operations of PowerToys!
RawQuery
instead ofQuery
to drive its searches.RawQuery
, of course, contains the action keyword (like ":"). Fixed by changingRawQuery
toQuery
.QueryBuilder
adds all global plug-ins to the dictionary of plug-in list for each query. When a plugin is a member of both global and nonglobal lists, it can be added twice to the plugin-pair dictionary. This behavior is protected with a simple if statement to prevent double insertion.Oustanding Issues:
Need advice: the current settings infrastructure stores the keywords in the user's settings file. This will override what changes are done here. Normally this is fine - however, there is no UI for altering the keywords. Someone who has already run
PowerToys
and wants to take advantage of this will have to edit the settings json file by hand.Validation Steps Performed
Ran the tests and also tested by hand