Skip to content

Add optional detection.packageFamilyName to the extension schema - #170

Open
Adam Duda (AdamDuda1) wants to merge 2 commits into
microsoft:mainfrom
AdamDuda1:main
Open

Add optional detection.packageFamilyName to the extension schema#170
Adam Duda (AdamDuda1) wants to merge 2 commits into
microsoft:mainfrom
AdamDuda1:main

Conversation

@AdamDuda1

@AdamDuda1 Adam Duda (AdamDuda1) commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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:

  1. ExtensionGalleryViewModel enumerates installed extensions and matches on PackageFamilyName, but the block never gets executed as PackageFamilyName is not an allowed field for extension.json:
foreach (var entry in snapshot)
{
    if (!string.IsNullOrEmpty(entry.PackageFamilyName))
    {
        entry.IsInstalled = installedPfns.Contains(entry.PackageFamilyName);
        entry.IsInstalledStateKnown = true;
    }
}

(source: powertoys gh src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Gallery/ExtensionGalleryViewModel.cs:391)

  1. Every other assignment to IsInstalled flows from ApplyWinGetPackageInfo, which requires a winget install 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.cs defines PackageFamilyName.
  • ExtensionGalleryItemViewModel exposes it via public string? PackageFamilyName => _entry.Detection?.PackageFamilyName;
  • doc/extension-gallery.md documents detection.packageFamilyName as a supported optional entry field, and notes it "lets the gallery recognise an already-installed packaged extension before WinGet metadata resolves."

Because extension.schema.json sets additionalProperties: false and has no detection property, the CI rejects the field today.

Changes

  1. .github/schemas/extension.schema.json - added an optional detection object with a single required packageFamilyName string.
  2. extensions/adamduda/tex-snippets/extension.json - added the block to my extension to demonstrate.

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.

1 participant