Skip to content

Conversation

@sibber5
Copy link
Contributor

@sibber5 sibber5 commented Dec 7, 2021

Summary of the Pull Request

image

What is this about:
Perform a web search from PowerToys Run. For example: typing ?? foo would query foo in the default search engine in the default browser.
Most of the code was taken from Microsoft.plugin.uri, since its extremely similar to this plugin.

What is included in the PR:

  • The new plugin
  • Plugin docs
  • Upated PowerToys.sln
  • Updated YML and WXS

How does someone test / validate:
Open PowerToys Run and test (e.g. ?? foo).

Quality Checklist

  • Linked issue: Resolves [Run][New Plugin] Web search  #3245
  • Communication: I've discussed this with core contributors in the issue.
  • Tests: Added/updated and all pass (Appears to work in all chromium browsers + opera + firefox + internet explorer)
  • Installer: Added/updated and all pass
  • Localization: All end user facing strings can be localized (They are read from a resource file, but have not been localized/translated yet)
  • Docs: Added/ updated
  • Binaries: Any new files are added to WXS / YML

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA. (Signed)

@htcfreek
Copy link
Collaborator

htcfreek commented Dec 7, 2021

@cyberrex5
I am interested in how it works/looks for our users. Maybe you can upload a screenshot.

@franky920920
Copy link
Contributor

Maybe we can use something like this:
https://user-images.githubusercontent.com/11349917/145028237-cc9c48e0-92b9-498b-9f75-9f40e2600e7c.png

Use what is the meaning of life - Search the web
instead of Search the web for: "what is the meaning of life"

This would align the results. :D

@microsoft microsoft deleted a comment from github-actions bot Dec 7, 2021
@microsoft microsoft deleted a comment from github-actions bot Dec 7, 2021
Copy link
Contributor

@franky920920 franky920920 left a comment

Choose a reason for hiding this comment

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

Please change websearch into webSearch or WebSearch in filenames to pass spellcheck. ;)

@microsoft microsoft deleted a comment from github-actions bot Dec 8, 2021
@microsoft microsoft deleted a comment from github-actions bot Dec 8, 2021
@microsoft microsoft deleted a comment from github-actions bot Dec 8, 2021
@sibber5
Copy link
Contributor Author

sibber5 commented Dec 9, 2021

Please change websearch into webSearch or WebSearch in filenames to pass spellcheck. ;)

still didn't pass, and it doesn't say where the incorrect word is

@noraa-junker
Copy link
Collaborator

Please change websearch into webSearch or WebSearch in filenames to pass spellcheck. ;)

still didn't pass, and it doesn't say where the incorrect word is

It does pass. The only word left is cyberrex

@crutkas
Copy link
Member

crutkas commented Dec 9, 2021

I can go in and tweak the needed spell cehck file in your branch @cyberrex5

@sibber5
Copy link
Contributor Author

sibber5 commented Dec 9, 2021

great thank you

@sibber5 sibber5 marked this pull request as ready for review December 11, 2021 19:41
@crutkas
Copy link
Member

crutkas commented Dec 21, 2021

@cyberrex5, I did a small tweak to the SLN so it builds when you F5 launcher. do you feel you're in a good state to check in?

What other things do you feel you need to do.

@sibber5
Copy link
Contributor Author

sibber5 commented Dec 22, 2021

I'll just change the json parser and the way to get the browser name

@crutkas
Copy link
Member

crutkas commented Dec 22, 2021

Tell me when we want to take one last pass here.

@sibber5
Copy link
Contributor Author

sibber5 commented Dec 22, 2021

You can now, I'm done :)

@noraa-junker
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@crutkas
Copy link
Member

crutkas commented Dec 22, 2021

@stefansjfw can you do one more quick pass? I can add this in to release.yml in a diff PR

@crutkas
Copy link
Member

crutkas commented Dec 23, 2021

actually, just added it into the json file for signing in their branch

Copy link
Contributor

@stefansjfw stefansjfw left a comment

Choose a reason for hiding this comment

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

LGTM

@microsoft microsoft deleted a comment from github-actions bot Dec 23, 2021
@microsoft microsoft deleted a comment from github-actions bot Dec 23, 2021
@microsoft microsoft deleted a comment from github-actions bot Dec 23, 2021
@htcfreek
Copy link
Collaborator

htcfreek commented Dec 23, 2021

@jaimecbernardo , @cyberrex5 , @crutkas
image

My settings:

{"properties":{"search_result_preference":"most_recently_used","search_type_preference":"application_name","maximum_number_of_results":4,"open_powerlauncher":{"win":false,"ctrl":false,"alt":true,"shift":false,"code":32,"key":""},"open_file_location":{"win":false,"ctrl":false,"alt":false,"shift":false,"code":0,"key":""},"copy_path_location":{"win":false,"ctrl":false,"alt":false,"shift":false,"code":0,"key":""},"open_console":{"win":false,"ctrl":false,"alt":false,"shift":false,"code":0,"key":""},"override_win_r_key":false,"override_win_s_key":false,"ignore_hotkeys_in_fullscreen":false,"clear_input_on_launch":true,"theme":0,"startupPosition":0,"use_centralized_keyboard_hook":false},"plugins":[{"Id":"CEA0FDFC6D3B4085823D60DC76F28855","Name":"Calculator","Description":"Does mathematical calculations (e.g. 5*3-2).","Author":"cxfksword","Disabled":true,"IsGlobal":true,"ActionKeyword":"","IconPathDark":"Calculator\\Images\\calculator.dark.png","IconPathLight":"Calculator\\Images\\calculator.light.png","AdditionalOptions":[]},{"Id":"B4D3B69656E14D44865C8D818EAE47C4","Name":"Folder","Description":"Navigates folders starting from a drive letter \u0027C:\\\u0027 or from the user home \u0027~\u0027.","Author":"qianlifeng","Disabled":true,"IsGlobal":true,"ActionKeyword":"","IconPathDark":"Folder\\Images\\folder.dark.png","IconPathLight":"Folder\\Images\\folder.light.png","AdditionalOptions":[]},{"Id":"2140FC9819AD43A3A616E2735815C27C","Name":"Windows Search","Description":"Searches files and folders.","Author":"Microsoft","Disabled":true,"IsGlobal":false,"ActionKeyword":"","IconPathDark":"Indexer\\Images\\indexer.dark.png","IconPathLight":"Indexer\\Images\\indexer.light.png","AdditionalOptions":[{"Key":"DisableDriveDetectionWarning","DisplayLabel":"Disable non-indexed files warning","Value":false}]},{"Id":"791FC278BA414111B8D1886DFE447410","Name":"Program","Description":"Searches programs.","Author":"qianlifeng","Disabled":true,"IsGlobal":true,"ActionKeyword":".","IconPathDark":"Program\\Images\\app.dark.png","IconPathLight":"Program\\Images\\app.light.png","AdditionalOptions":[]},{"Id":"303417D927BF4C97BCFFC78A123BE0C8","Name":"Registry Plugin","Description":"Navigates inside the Windows Registry.","Author":"TobiasSekan","Disabled":false,"IsGlobal":false,"ActionKeyword":":","IconPathDark":"Registry\\Images\\reg.dark.png","IconPathLight":"Registry\\Images\\reg.light.png","AdditionalOptions":[]},{"Id":"11A6C36E4E91439CA69F702CBD364EF7","Name":"Service","Description":"Manages Windows services.","Author":"davidegiacometti","Disabled":true,"IsGlobal":false,"ActionKeyword":"!","IconPathDark":"Service\\Images\\service.dark.png","IconPathLight":"Service\\Images\\service.light.png","AdditionalOptions":[]},{"Id":"D409510CD0D2481F853690A07E6DC426","Name":"Shell","Description":"Executes commands (e.g \u0027ping\u0027, \u0027cmd\u0027).","Author":"qianlifeng","Disabled":false,"IsGlobal":false,"ActionKeyword":"\u003E","IconPathDark":"Shell\\Images\\shell.dark.png","IconPathLight":"Shell\\Images\\shell.light.png","AdditionalOptions":[]},{"Id":"CEA08895D2544B019B2E9C5009600DF4","Name":"Windows System Commands","Description":"Executes system commands (e.g. \u0027shutdown\u0027, \u0027lock\u0027, \u0027sleep\u0027).","Author":"Wox","Disabled":true,"IsGlobal":true,"ActionKeyword":"","IconPathDark":"System\\Images\\lock.dark.png","IconPathLight":"System\\Images\\lock.light.png","AdditionalOptions":[{"Key":"ConfirmSystemCommands","DisplayLabel":"Show a dialog to confirm system commands","Value":false},{"Key":"LocalizeSystemCommands","DisplayLabel":"Use localized system commands instead of English ones","Value":true}]},{"Id":"aa0ee9daff654fb7be452c2d77c471b9","Name":"Unit Converter","Description":"Provides unit conversion (e.g. 10 ft in m).","Author":"ThiefZero","Disabled":true,"IsGlobal":false,"ActionKeyword":"%%","IconPathDark":"UnitConverter\\Images\\unitconverter.dark.png","IconPathLight":"UnitConverter\\Images\\unitconverter.light.png","AdditionalOptions":[]},{"Id":"03276A39D4E9417C8FFD200B0EE5E871","Name":"URI Handler","Description":"Opens URLs and UNC network shares.","Author":"Microsoft","Disabled":false,"IsGlobal":true,"ActionKeyword":"//","IconPathDark":"Uri\\Images\\uri.dark.png","IconPathLight":"Uri\\Images\\uri.light.png","AdditionalOptions":[]},{"Id":"525995402BEF4A8CA860D92F6D108092","Name":"Visual Studio Code Workspaces","Description":"Opens workspaces, remote machines (SSH or Codespaces) and containers, previously opened in VS Code.","Author":"ricardosantos9521","Disabled":true,"IsGlobal":false,"ActionKeyword":"{","IconPathDark":"VSCodeWorkspaces\\Images\\code-dark.png","IconPathLight":"VSCodeWorkspaces\\Images\\code-light.png","AdditionalOptions":[]},{"Id":"9F1B49201C3F4BF781CAAD5CD88EA4DC","Name":"Web Search","Description":null,"Author":"cyberrex5","Disabled":false,"IsGlobal":true,"ActionKeyword":"??","IconPathDark":"WebSearch\\Images\\WebSearch.dark.png","IconPathLight":"WebSearch\\Images\\WebSearch.light.png","AdditionalOptions":[]},{"Id":"5043CECEE6A748679CBE02D27D83747A","Name":"Windows settings","Description":"Plugin to search for Windows settings","Author":"TobiasSekan","Disabled":false,"IsGlobal":false,"ActionKeyword":"$","IconPathDark":"WindowsSettings\\Images\\WindowsSettings.dark.png","IconPathLight":"WindowsSettings\\Images\\WindowsSettings.light.png","AdditionalOptions":[]},{"Id":"F59BA85006B14389A72A0EA756695F1D","Name":"Windows Terminal","Description":"Open Windows Terminal profiles.","Author":"davidegiacometti","Disabled":true,"IsGlobal":true,"ActionKeyword":"_","IconPathDark":"WindowsTerminal\\Images\\WindowsTerminal.dark.png","IconPathLight":"WindowsTerminal\\Images\\WindowsTerminal.light.png","AdditionalOptions":[{"Key":"OpenNewTab","DisplayLabel":"Open profiles in a new tab","Value":false},{"Key":"ShowHiddenProfiles","DisplayLabel":"Show hidden profiles","Value":false}]},{"Id":"F737A9223560B3C6833B5FFB8CDF78E5","Name":"Window Walker","Description":"Switches between open windows.","Author":"betadele","Disabled":true,"IsGlobal":true,"ActionKeyword":"\u003C","IconPathDark":"WindowWalker\\Images\\windowwalker.dark.png","IconPathLight":"WindowWalker\\Images\\windowwalker.light.png","AdditionalOptions":[]}],"name":"PowerToys Run","version":"1.0"}

There aren't any logs that could help!

By the way there aren't any desciption and optional settings in settings ux:
image

Copy link
Collaborator

@htcfreek htcfreek left a comment

Choose a reason for hiding this comment

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

Plugin is crashing on start. See my comment before.

@stefansjfw
Copy link
Contributor

stefansjfw commented Dec 23, 2021

Plugin is crashing on start. See my comment before.

Plugin works for me, both when installing PT or running from VS studio. That error could happen if you have WebSearch plugin in your config file, but there are no WebSearch plugin assemblies (i.e. not built). Could you check that ?

@htcfreek
Copy link
Collaborator

htcfreek commented Dec 23, 2021

Plugin is crashing on start. See my comment before.

Plugin works for me, both when installing PT or running from VS studio. That error could happen if you have WebSearch plugin in your config file, but there are no WebSearch plugin assemblies (i.e. not built). Could you check that ?

I was a new rebuild in vs after running git pull:

PS D:\AppDev\Github\cyb\PT\RunWebsearch\x64\Debug\modules\launcher\Plugins\WebSearch> dir


    Directory: D:\AppDev\Github\cyb\PT\RunWebsearch\x64\Debug\modules\launcher\Plugins\WebSearch


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        23.12.2021     10:56                Images
-a----        23.12.2021     10:56          22685 Community.PowerToys.Run.Plugin.WebSearch.deps.json
-a----        23.12.2021     10:56          16896 Community.PowerToys.Run.Plugin.WebSearch.dll
-a----        23.12.2021     10:56          46592 Community.PowerToys.Run.Plugin.WebSearch.pdb
-a----        13.12.2021     18:55          10240 Microsoft.PowerToys.Common.UI.dll
-a----        13.12.2021     18:55          14172 Microsoft.PowerToys.Common.UI.pdb
-a----        13.12.2021     18:55         159744 Microsoft.PowerToys.Settings.UI.Lib.dll
-a----        13.12.2021     18:55         740864 Microsoft.PowerToys.Settings.UI.Lib.pdb
-a----        23.12.2021     10:49            404 plugin.json
-a----        23.12.2021     10:56          10240 PowerToys.Common.UI.dll
-a----        23.12.2021     10:56          14104 PowerToys.Common.UI.pdb
-a----        23.12.2021     10:56         682496 PowerToys.Interop.dll
-a----        23.12.2021     10:56        4796416 PowerToys.Interop.pdb
-a----        23.12.2021     10:56           6144 PowerToys.ManagedCommon.dll
-a----        23.12.2021     10:56           8328 PowerToys.ManagedCommon.pdb
-a----        23.12.2021     10:56           6656 PowerToys.ManagedTelemetry.dll
-a----        23.12.2021     10:56           8576 PowerToys.ManagedTelemetry.pdb
-a----        23.12.2021     10:56         159744 PowerToys.Settings.UI.Lib.dll
-a----        23.12.2021     10:56         728576 PowerToys.Settings.UI.Lib.pdb

@stefansjfw
Copy link
Contributor

hm.. I can't reproduce that. Even if I copy and use your config file, it gets rewritten on PT Run startup and everything works as expected. Can you try full clean build?

@htcfreek
Copy link
Collaborator

hm.. I can't reproduce that. Even if I copy and use your config file, it gets rewritten on PT Run startup and everything works as expected. Can you try full clean build?

Looking into it later this day or tomorrow.

Copy link
Contributor

@franky920920 franky920920 left a comment

Choose a reason for hiding this comment

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

LGTM
Tested and work as expected.

@crutkas crutkas merged commit bb88aff into microsoft:main Dec 24, 2021
@htcfreek
Copy link
Collaborator

hm.. I can't reproduce that. Even if I copy and use your config file, it gets rewritten on PT Run startup and everything works as expected. Can you try full clean build?

Looking into it later this day or tomorrow.

After doing a rebuild of the complete sln and not only the web-search project it's working. 👍

@sibber5 sibber5 deleted the feature/run_websearch branch December 24, 2021 09:49
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.

[Run][New Plugin] Web search

6 participants