microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
108.95k stars 6.43k forks source link

[Settings > PT Run > Plugins] Show version number #33846

Open htcfreek opened 1 month ago

htcfreek commented 1 month ago

Description of the new feature / enhancement

Showing the version of the installed plugins.

Scenario when this would be used?

To see if your third-party plugin is up to date.

Supporting information

No response

htcfreek commented 1 month ago

@niels9001 I like to combine this with #9921. Therefore I suggest to replace the currently shown Author name with a text line like this:

Version 0.82.0 • Authored by xyz • Website

(The text "Website" should be an clickable link with the address in a tool tip. The layout of bold name can be applied to version number too.)

What layout (character and color) do you suggest for the dot separator? Any other ideas?

htcfreek commented 1 month ago

@crutkas Can we add a script to our release pipeline that updates the version nunber in all plugin.json files based on the build properties with the new version number?

GitHub search query: path:src/modules/launcher/Plugins/*/plugin.json version

davidegiacometti commented 1 month ago

If we decide to go for this I think it's better to read the version from the assembly instead of the plugin.json.

The PluginMetadata version is currently never set:

https://github.com/microsoft/PowerToys/blob/8d2ee4a8d28903f84d23b7fd7e8eeeb139a9f0db/src/modules/launcher/Wox.Plugin/PluginMetadata.cs#L27

Assembly version is more reliable and already used to pick up the latest release of the plugin.

https://github.com/microsoft/PowerToys/blob/8d2ee4a8d28903f84d23b7fd7e8eeeb139a9f0db/src/modules/launcher/PowerLauncher/Plugin/PluginManager.cs#L66

htcfreek commented 1 month ago

@davidegiacometti

The PluginMetadata version is currently never set:

I am not sure what you mean with "never set" because it comes from the plugin.json.

Assembly version is more reliable and already used to pick up the latest release of the plugin.

I agree that this is the better solution for our built-in plugins. But can we be sure that third-party plugin developer set the DLL file version correctly? (The json is definitely easier to maintain.)

davidegiacometti commented 1 month ago

I am not sure what you mean with "never set" because it comes from the plugin.json.

My bad! This is set from the JSON but it's never used.

I agree that this is the better solution for our built-in plugins. But can we be sure that third-party plugin developer set the DLL file version correctly? (The json is definitely easier to maintain.)

Properly version a software that is being shipped is a best practice.

htcfreek commented 1 month ago

@davidegiacometti Do you think we should always show all 4 parts of the dll version or does it make sense to show the 4 part only if it is not 0?

[Regex]::Replace([version]::new(1,5,6,5), ".0$", "")
[Regex]::Replace([version]::new(1,5,6,0), ".0$", "")

# Output
# 1.5.6.5
# 1.5.6
davidegiacometti commented 1 month ago

That's a great question. I'll go for 4 parts since you can't know if the last .0 is unused or if it's just a .0 release.