Allow third-party plugins to expose their own settings namespaces to the Web plugin-configuration section #1183
HsiangNianian
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
The Web plugin-configuration section (
设置 → 插件配置, served bydsh-host-apiproxy) only exposes settings namespaces listed in the hardcodedWEB_SETTINGS_NAMESPACESallowlist. A third-party plugin can register a namespace viactx.settings.register(...)(it persists fine), but the browser half getssettings-not-exposedfromsettings.describe, so its settings card renders nothing and users cannot configure the plugin from the GUI.The code comment in
dsh-host-apiproxyalready acknowledges this:Proposal
Move the exposure decision into
settings.register()so a plugin can opt in:Keep the allowlist as the default for existing namespaces (backwards compatible), and let
exposedNamespaces()include every namespace registered withexpose: true(probably gated on the owner being an enabled entry, like the current explicit list). Arestart-applies namespace could be excluded from the exposed set if that is safer.Context
I maintain a third-party plugin (dsh-auto-continue) that registers an
auto-continuesettings namespace. Without this change, every installation needs a one-time vendor patch that appends the namespace toWEB_SETTINGS_NAMESPACESin the installed bundle (see scripts/patch-expose.mjs) — it works but is fragile across reinstalls (npx cache, global installs) and is exactly the kind of per-plugin core modification the seam was meant to avoid.Happy to adapt the proposal or submit a PR if that helps.
All reactions