Feat/plugin instance actions (#2209)

* feat(shared): scope plugin action descriptors

* feat(plugin-sdk): instance-scoped settings actions

* feat(plugins): run instance-scoped actions from the admin settings dialog

* feat(admin): instance-scoped plugin actions in the settings dialog

* fix(plugins): surface instance actions without instance fields and harden the action gate

* docs(plugin-sdk): note that hosts before 4.2.0 ignore action scope

* fix(admin): open the dialog for instance actions, explain inactive 404s, guard the save window

* docs(wiki): plugin pages for instance actions and the admin panel changes
This commit is contained in:
jubnl
2026-09-02 23:06:03 +02:00
committed by GitHub
parent b1ce7c303d
commit b82962f95b
59 changed files with 1133 additions and 128 deletions
+10
View File
@@ -4226,6 +4226,16 @@ function runMigrations(db: Database.Database): void {
db.exec('ALTER TABLE plugin_settings_fields ADD COLUMN default_value TEXT');
}
},
// Settings-form actions gain a scope (#plugins): 'user' renders on the user Settings
// tab, 'instance' in the admin instance-settings dialog. Existing rows predate the
// column and were all user-tab buttons, so the default keeps them where they were.
() => {
const cols = db.prepare("SELECT name FROM pragma_table_info('plugin_actions')").all() as Array<{ name: string }>;
if (cols.length > 0 && !cols.some((c) => c.name === 'scope')) {
db.exec("ALTER TABLE plugin_actions ADD COLUMN scope TEXT NOT NULL DEFAULT 'user'");
}
},
];
if (currentVersion < migrations.length) {