fix(desktop): show the icon a plugin manifest names
Why
A plugin manifest can set extensions.superset.interface.icon, and the docs show it, but the Plugins page ignores it (#9425). The API already returns the value. The desktop catalog hook drops it, and PluginIcon only looks up artwork by plugin name. This is step 1 of the fix direction in the issue's triage.
What changed
toCatalogPluginkeepsicononCatalogPlugin.PluginIcontakes an optionalicon. When it names a key in the built-in icon maps, that key is used. Otherwise it falls back to the plugin name, then to the puzzle glyph, as before.- The Plugins page card and detail views pass the icon.
Scope
- Covers a manifest
iconthat names a built-in icon. First-party plugins look the same, because their icon equals their name. - Leaves out artwork shipped inside the plugin (
./assets/icon.png). That needs a maintainer decision on the security limits, so #9425 stays open. - Leaves out the
@-mention chips, which still use the plugin name.
Blast Radius
Renderer-only, on the Plugins page. An unknown or path value cannot hide a known name, so the worst case is today's behavior.
Verification
- A new
PluginCardtest renders a plugin namedacmewithicon: "linear". It fails without the fix (it gets the puzzle glyph) and passes with it. - Plugin, catalog hook, and
PluginIcontests pass (11). Desktop typecheck is clean. The full desktop suite has the same 38 failures on main and on this branch. They are git and process tests, none in plugin code.
Summary by cubic
Fixes the Plugins page so a plugin with extensions.superset.interface.icon in its manifest renders that icon instead of always looking up artwork by plugin name and falling back to the puzzle glyph. toCatalogPlugin, now extracted into its own util with a test, preserves the manifest icon; PluginIcon uses it as a key into the built-in icon maps, and the card and detail views pass it through. Unknown or path-style values fall back to the plugin-name lookup, so nothing can be hidden. The change only supports built-in icon names; plugin-shipped artwork like ./assets/icon.png is left out. Adds PluginCard tests for a plugin named acme with icon: "linear" and for a non-built-in icon value.
Summary by CodeRabbit
- New Features
- Plugin catalog cards and detail views now display each plugin’s configured icon when it is supported, including connector rows and connection dialogs.
- Missing or unsupported icon values continue to display the plugin’s standard icon, keeping plugin identification consistent across these views.