fix(plugins): give installed plugins the same enable toggle as bundled ones - #184
Merged
Conversation
…d ones Whether a plugin could be disabled depended on how it reached the disk, not on what it is. The toggle rendered only on rows built from getLoadedPlugins() minus installedMeta — bundled first-party plugins — so installing that same plugin from the catalogue moved it to the external list and it lost the control. Themes, which are only ever installed, therefore never had one. The rule is now a property of the plugin: a theme-only plugin contributes nothing but themes, so disabled and not-installed would mean the same thing and it gets no toggle; everything else gets one, bundled or installed. Both row types render the same EnableToggle so the two cannot drift apart. Installed rows now also dim when disabled, matching the bundled rows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Whether a plugin could be disabled depended on how it reached the disk, not on what it is.
The Installed tab builds its first list from
seededPluginManifests(externalPluginIds), which despite the name returns every loaded plugin that isn't ininstalledMeta— i.e. the app-bundled ones. Only those rows rendered a<Toggle>. Rows built frominstalledMeta— anything installed from a catalogue, a URL, or a local scan — rendered Update / Reload / Uninstall and no toggle.Consequences:
installedMeta, soloadSeededPluginsthen skipped it and it appeared in the external list — the same plugin, silently losing the toggle it had while bundled.The fix
The rule becomes a property of the plugin rather than of its provenance, in one place both row types call:
A theme-only plugin contributes nothing but themes, so "disabled" and "not installed" would mean the same thing to the user — it stays installed-or-not, which is the behaviour that was already there and worth keeping. Everything else can be turned off without losing it, bundled or installed.
Installed rows compute
enabledasisLoaded && isEnabled(meta.id, true), mirroringexternalPluginActivefrom #181, and now dim when disabled the way bundled rows already did.Tests
PluginsSection.enableToggle.test.tsx— five tests covering the matrix (non-theme installed / non-theme bundled / theme installed / theme bundled) plus one that the toggle actually deactivates the plugin and persists the override.Written first; three failed for the expected reasons: installed non-theme had no toggle, bundled theme had one it shouldn't, and there was nothing to click. 16 tests across the three
PluginsSectionfiles pass now,tsc --noEmitclean.Live verification
In the headless container on this branch, both installed from the live catalogue:
Toggling SSH Config Sync off flips
aria-checkedtofalse, dims the row toopacity: 0.7, and survives a restart — the override persists and #181's boot path honours it. Toggling back on restores it.Negative control: reverting just this commit's change to
PluginsSection.tsxin the same running build drops SSH Config Sync's toggle count from 1 to 0; restoring brings it back.Note
seededPluginManifestsis misleadingly named — it returns loaded-minus-installed, not "seeded". It misled me into an incorrect claim earlier in this work. Renaming it is not in this PR, but it should probably beunmanagedPluginManifestsor similar.