SIGN IN SIGN UP

plugins: use manifest `name` for direct-install plugin labels (#315888)

* plugins: use manifest `name` for direct-install plugin labels

Direct-installed plugins (no marketplace metadata) were displaying their
filesystem basename (e.g. `sukumarp2022--slide-creator-plugin`) instead
of the human-readable `name` declared in their `plugin.json` manifest.

Pre-read the manifest at plugin construction time and extend the label
fallback chain to `fromMarketplace?.name ?? manifestName ?? basename(uri)`,
matching the pattern already used by `readSinglePluginManifest`. Also
introduces a tighter `IPluginManifest` interface to replace the loose
`Record<string, unknown>` type.

Fixes #315855

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* plugins: address PR review

- Guard `manifest.name` with `typeof === 'string'` to defend against
  untrusted JSON (e.g. `name: 123`), which TypeScript can't catch
  because the parsed manifest is cast from `unknown`.
- Add tests covering the manifest-name label fallback: one for the
  happy path (direct install with manifest `name`) and one for the
  fallback to basename when `name` is missing, blank, or non-string.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
J
Josh Spicer committed
e04aa9d81603fbe7c228839da6d6e5616caf9fb4
Parent: 80deaec
Committed by GitHub <noreply@github.com> on 5/12/2026, 6:36:20 PM