Skip to content

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

Merged
Niels Laute (niels9001) merged 1 commit into
microsoft:mainfrom
AdamDuda1:main
Sep 11, 2026
Merged

Niels Laute (niels9001) merged 1 commit 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.

@niels9001

Copy link
Copy Markdown
Contributor

@jiripolasek

Jiří Polášek (jiripolasek) commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@niels9001

Copy link
Copy Markdown
Contributor

@w7rker

w7rker commented Sep 11, 2026

Copy link
Copy Markdown

W Adam Duda reputable source

@jiripolasek

Copy link
Copy Markdown
Contributor

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.

@jiripolasek

Copy link
Copy Markdown
Contributor

W Adam Duda reputable source

Just for this comment, I have a sudden urge to close this with extreme prejudice...

@w7rker

w7rker commented Sep 11, 2026

Copy link
Copy Markdown

please dont i was just joking hes not a reputable source and a chinese hacker if it makes you feel any better

@jiripolasek

Jiří Polášek (jiripolasek) commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Adam Duda (@AdamDuda1) That was fast, thanks for the update 🙇‍♂️

Niels Laute (@niels9001) LGTM

LGTM

@AdamDuda1

Copy link
Copy Markdown
Contributor Author

Thanks :) I'll add the detection to my extension in a separate PR.

@niels9001
Niels Laute (niels9001) merged commit e3c2504 into microsoft:main Sep 11, 2026
1 check passed
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.

4 participants