feat: plugin install/uninstall lifecycle + UI buttons

- AppConfig: add InstalledPlugins []string
- Manager.Discover(): no config dependency, all plugins start inactive
- Manager.SyncConfig(): apply installed/enabled state from AppConfig
- Manager.Enable(): works for plugins without on_install hook
- Manager.Install/Uninstall(): run on_install/on_uninstall hooks
- ActivatePlugin: skip if HasInstall && !Installed
- ReloadPlugins: Discover → SyncConfig → InitRuntimes
- Bindings: InstallPlugin, UninstallPlugin
- SettingsPlugins: install/uninstall buttons, toggle only after install
- Calendar: migration moved from on_init to on_install, on_uninstall drops tables
- Tests: all 12 pass (manager + runtime + calendar)
This commit is contained in:
2026-06-07 15:28:37 +08:00
parent b80941f908
commit e99ff984b1
10 changed files with 1358 additions and 161 deletions
+1
View File
@@ -21,6 +21,7 @@ type AppConfig struct {
Language string `json:"language"`
EnabledTemplates []string `json:"enabled_templates"`
EnabledPlugins []string `json:"enabled_plugins"`
InstalledPlugins []string `json:"installed_plugins"`
FirstRunCompleted bool `json:"first_run_completed"`
Window WindowConfig `json:"window,omitempty"`
Vault VaultAppConfig `json:"vault,omitempty"`