Add optional detection.packageFamilyName to the extension schema - #170
Conversation
|
Niels Laute (@niels9001) That's the part of my original spec: https://github.com/microsoft/PowerToys/blob/071c25e115e8097117e26f6fcfe9901301307f7a/src/modules/cmdpal/doc/extension-gallery.md And already enabled in code: |
So this PR is good to go? |
|
W Adam Duda reputable source |
|
Niels Laute (@niels9001) I'm not happy about the PR mixing the schema change with the extension metadata change, but other than that nit, I think it's good to go. |
Just for this comment, I have a sudden urge to close this with extreme prejudice... |
d3d5028 to
54e224d
Compare
|
please dont i was just joking hes not a reputable source and a chinese hacker if it makes you feel any better |
|
Adam Duda (@AdamDuda1) That was fast, thanks for the update 🙇♂️
|
|
Thanks :) I'll add the detection to my extension in a separate PR. |

Problem
Extensions distributed through the Microsoft Store can never show as Installed in the Command Palette gallery, even after the user installs them from the gallery itself.
There are two code paths in CmdPal that set
IsInstalled, and a Store-only extensions reaches none of them:ExtensionGalleryViewModelenumerates installed extensions and matches onPackageFamilyName, but the block never gets executed asPackageFamilyNameis not an allowed field forextension.json:(source: powertoys gh src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Gallery/ExtensionGalleryViewModel.cs:391)
IsInstalledflows fromApplyWinGetPackageInfo, which requires awingetinstall source.At the time of writing, over half of the 82 extensions in the gallery can never display as installed for the user.
Why this is a schema-only fix
The runtime already supports the field, but schema doesn't allow it:
Microsoft.CmdPal.Common/ExtensionGallery/Models/GalleryDetection.csdefinesPackageFamilyName.ExtensionGalleryItemViewModelexposes it viapublic string? PackageFamilyName => _entry.Detection?.PackageFamilyName;doc/extension-gallery.mddocumentsdetection.packageFamilyNameas a supported optional entry field, and notes it "lets the gallery recognise an already-installed packaged extension before WinGet metadata resolves."Because
extension.schema.jsonsetsadditionalProperties: falseand has nodetectionproperty, the CI rejects the field today.Changes
.github/schemas/extension.schema.json- added an optionaldetectionobject with a single requiredpackageFamilyNamestring.extensions/adamduda/tex-snippets/extension.json- added the block to my extension to demonstrate.