Skip to content

feat(dashboard): schema-driven plugin config form#303

Merged
rmyndharis merged 1 commit into
rmyndharis:mainfrom
dallascyclist:feat/plugin-config-form
Jun 18, 2026
Merged

feat(dashboard): schema-driven plugin config form#303
rmyndharis merged 1 commit into
rmyndharis:mainfrom
dallascyclist:feat/plugin-config-form

Conversation

@dallascyclist

Copy link
Copy Markdown
Contributor

Summary

Renders an editable config form in the Plugins config modal for any plugin that exposes a configSchema. The backend already returns configSchema (and current config) from GET /plugins, and PUT /plugins/:id/config already persists changes — but the dashboard modal only had fields for the engine plugin; every other plugin showed "No configuration options available." This wires the existing schema through to a real form.

What it does

For a plugin with a configSchema, the ⚙️ modal renders one field per property, by type:

  • string → text input
  • string + secret: truemasked password input
  • number → number input
  • boolean → toggle
  • string + enum → select

…using each field's title/description as the label/help text and default as the placeholder. Saving calls the existing PUT /plugins/:id/config.

Reuses the existing modal/form styles and i18n keys — no new locale strings (i18n parity unaffected).

Why

The plugin system already supports per-plugin configSchema, but it could only be set via the API. This makes any plugin's settings editable from the dashboard. Concretely, it lets the Group Auto-Translation plugin (#300) be pointed at a local or hosted LibreTranslate — URL + optional (masked) API key — from the UI.

Testing

  • Dashboard tsc -b && vite build, eslint, and i18n:check (parity) all pass; no new locale keys.
  • Verified live against a running instance: the form rendered the URL + masked API-key (+ timeout/prefix/length/toggle) fields and saved/persisted via PUT /plugins/:id/config for both a local URL and a hosted URL+key.

Note

Built-in plugins register their manifest programmatically, so for the form to show a built-in plugin's fields, that plugin's registered manifest must include its configSchema. (The translation plugin in #300 will expose its schema; this PR is the generic UI and is independent of it.)

Render an editable config form in the Plugins config modal for any plugin that exposes a configSchema (the backend already returns it). Each field maps to an input by type: string->text, secret->password (masked), number->number, boolean->toggle, enum->select; with title/description labels and defaults as placeholders. Saves via the existing PUT /plugins/:id/config. Reuses the existing modal/form styles and i18n keys (no new locale strings). Makes the libretranslate URL + API key (and any future plugin config) editable from the dashboard.
dallascyclist added a commit to dallascyclist/OpenWA that referenced this pull request Jun 17, 2026
… live

- Add the configSchema to the translation plugin's registered manifest so GET /plugins exposes it and the dashboard config form (rmyndharis#303) can render the LibreTranslate URL + API key (and other) fields. The schema was previously only in manifest.json, which built-in registration does not read.
- Implement onConfigChange to rebuild the coordinator from the updated config, so a URL/key change saved from the dashboard takes effect immediately without a disable/enable cycle. Extracted buildCoordinator() shared by onEnable/onConfigChange.
@rmyndharis rmyndharis merged commit 7c38abe into rmyndharis:main Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants