Skip to content
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

[Settings > PT Run] Plugin manager: Add plugin version and website #36580

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

htcfreek
Copy link
Collaborator

@htcfreek htcfreek commented Dec 26, 2024

Summary of the Pull Request

This PR implements a website link and the plugin version into the plugin metadata line visible in PT Run settings.

If the website uri in the plugin.json is badly formatted the link is not available in settings ui. This because we use a fallback uri in this case is to prevent a page crash.

image

Sample screenshot with a third-party plugin
image

PR Checklist

Detailed Description of the Pull Request / Additional comments

Open tasks

  • Get plugin metadata from PT Run into Settings app
    • Get version from assembly file
    • Update ViewModels
    • Implement ViewModel bindings into XAML code
  • Improve the XAML code for the items separating dot. (Optional.)
  • Add template selector to switch between layout with and without website (In case the website uri is not well formed.)
  • Add handling off invalid uri strings.
  • Update plugin metadata in PowerToys repository to have the correct website in the json files.
  • Update screenshot.

Validation Steps Performed

Manual tested with default plugins and different website uri strings.

@htcfreek htcfreek self-assigned this Dec 26, 2024
@htcfreek htcfreek added Product-Settings The standalone PowerToys Settings application Area-User Interface things that regard UX for PowerToys Run-Plugin Manager Issues with the PowerToys Run plugin manager labels Dec 26, 2024
@htcfreek
Copy link
Collaborator Author

@davidegiacometti
Currently I using the Product version and I saw some third-party plugins that have a strange formatted product version. Should we better use the file version instead? What do you think?

Example:
image

@crutkas
Copy link
Member

crutkas commented Dec 26, 2024

Nice!

@davidegiacometti
Copy link
Collaborator

@htcfreek nice work! 😃

Yeah, I think we should use file version since .NET 8 introduced a breaking change on how revision is handled in product version: https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/source-link

This comment has been minimized.

This comment has been minimized.

@htcfreek htcfreek marked this pull request as ready for review December 28, 2024 13:44
@htcfreek htcfreek added the Needs-Review This Pull Request awaits the review of a maintainer. label Dec 28, 2024
@htcfreek
Copy link
Collaborator Author

@davidegiacometti
Would be great if you can take a look. I am not 100% sure but it seems that the page is a bit slow now.

Copy link
Collaborator

@davidegiacometti davidegiacometti left a comment

Choose a reason for hiding this comment

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

Hi @htcfreek
I have tested it and it's working well! I left some comment, let me know what you think.

I haven't noticed any performance drop compared to 0.87 but I am on a new hardware and this could make a difference.

Personal preference and for consistency with the OS I will replace the dot separator with a vertical one.

Windows 11 settings
image
image

@htcfreek
Copy link
Collaborator Author

Personal preference and for consistency with the OS I will replace the dot separator with a vertical one.

@davidegiacometti
We can switch. I decided the current layout based on three things:

  1. The discussion and my question in the issue.
  2. The metadata control in the Toolkit has the same layout.
  3. I think the dot looks better.

@davidegiacometti
Copy link
Collaborator

Personal preference and for consistency with the OS I will replace the dot separator with a vertical one.

@davidegiacometti We can switch. I decided the current layout based on three things:

  1. The discussion and my question in the issue.
  2. The metadata control in the Toolkit has the same layout.
  3. I think the dot looks better.

I am fine with both. Just wanted to mention it because I like consistency with the OS.

@htcfreek
Copy link
Collaborator Author

@niels9001, @davidegiacometti
Suggestion:

  • Remove template an ViewModel code.
  • On invalid uri we fallback to https://aka.ms/PowerToys and hide the hyperlink button.
  • I will keep my own code for all the layout stuff because I like it and I like to show the tool tip to show users what link they open. ;-)
  • We switch to Win11 separator style.

I will try to do the changes within the next days.

@htcfreek
Copy link
Collaborator Author

@niels9001 , @davidegiacometti
I have implemented the requested changes:

image

I also tried the MetadataControl form the Toolkit. But I think it isn't an option because we get complexity in the ViewModel / csharp code for implementing a command interface and loose style flexibility.

@htcfreek htcfreek changed the title [Settings > PT Run] Plugin manager: Add plugins version and website [Settings > PT Run] Plugin manager: Add plugin version and website Dec 30, 2024
Copy link
Collaborator

@davidegiacometti davidegiacometti left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the feedback. Looking so much cleaner!
I have tested it again and it's working well, I also didn't experience any performance regression.

Approved! ✅

@htcfreek
Copy link
Collaborator Author

htcfreek commented Jan 3, 2025

@niels9001
Can you please approve and unblock the PR. Thank you.

<StackPanel
HorizontalAlignment="Right"
Orientation="Horizontal"
Spacing="5">
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Spacing="5">
Spacing="4">

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Any specific reason for this change? For me 4 feels to less and 6 feels to much. I like to keep 5.

(With 4 it looks more like a text character than a separator.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface things that regard UX for PowerToys Needs-Review This Pull Request awaits the review of a maintainer. Product-Settings The standalone PowerToys Settings application Run-Plugin Manager Issues with the PowerToys Run plugin manager
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants