fix(plugins): activate externally installed plugins regardless of defaultEnabled - #181
Merged
Conversation
…aultEnabled A catalogue plugin whose manifest set "defaultEnabled": false loaded inactive, so its register() hit the isActive() guard and contributed nothing. Both marketplace themes ship that flag, so installing one added no theme to the Appearance list, and a restart recomputed the same inactive state. The enable toggle that would have fixed it renders only on seeded rows, so there was no way back short of the Reload button, which happened to hardcode active=true. defaultEnabled means "ships with the app, off until asked for" — a seeded concept. Installing from a catalogue is itself the opt-in, so the external paths now default to enabled and honour only an explicit stored override. That override is now also honoured by reload and local scan, which previously forced active=true and silently re-enabled a plugin the user had disabled.
This was referenced Aug 25, 2026
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
Installing a theme from the marketplace added no theme to Settings → Appearance, and restarting did not help.
Both marketplace themes ship
"defaultEnabled": falsein their manifest. Install and boot both computed activation asisEnabled(manifest.id, manifest.defaultEnabled ?? true), so with no stored override the plugin loaded inactive. Itsregister()opens withif (!api.isActive()) return;, so it contributed nothing, and boot recomputed the same inactive state — hence the restart doing nothing.There was no way to recover from the UI: the enable/disable toggle renders only on seeded rows (
PluginsSection.tsx:487), never on externally installed ones. The only escape was the Reload button, which happened to hardcodeactive = true.The fix
defaultEnabledmeans "ships with the app, off until asked for" — a seeded concept. A catalogue plugin is on disk because the user installed it, so the install is itself the opt-in and the manifest flag must not gate it.One helper replaces four call sites (install, boot, reload, local scan):
An explicit stored override still wins. That also fixes a second bug in passing: reload and local scan previously forced
active = true, silently re-enabling a plugin the user had disabled.Seeded plugins are untouched —
defaultEnabledstill means what it means for something that ships preinstalled.Tests
src/stores/marketplaceStore.externalActivation.test.ts— four tests. The fake bundle mirrors the real theme bundles'isActive()guard and asserts onpluginThemes, the store the Appearance list actually reads.Written first; three failed for the expected reason before the change (no theme registered on install, none after boot, and reload re-enabling a disabled plugin), the fourth is a guard that passed throughout.
tsc --noEmitcleanLive verification
Driven through the real app in the headless container, on this branch:
--t-bg-terminalto#141729, the bundle's ownbgTerminalNegative control: reverting just this commit's change to
marketplaceStore.tsin the same running build makes the theme vanish from the list and the terminal background fall back to#0b1220; restoring it brings both back.Follow-ups, deliberately not in this PR
"defaultEnabled": false. Harmless now that nothing reads it on this path, but misleading — a cleanup for the marketplace repo.