feat: add descriptions to plugin host enable toggles

This commit is contained in:
LukeGus committed 2026-09-27 14:14:51 -05:00
1 parent c7fd900732
commit 7b1e0294aa
18 files changed
+53 -6

No files matched your search

+9
View File
@@ -269,6 +269,7 @@ export interface PluginHostSettingsContribution {
/** Boolean field rendered first, gating the rest of the section. */
enableKey?: string;
enableLabelKey?: string;
enableDescriptionKey?: string;
/** What the enable switch reads before a host saves it. Off by default. */
enableDefault?: boolean;
/** Host editor strip the generated tab sits in. Defaults to "top". */
@@ -1143,6 +1144,7 @@ function validateSettings(settings: unknown, errors: string[]): void {
[
"enableKey",
"enableLabelKey",
"enableDescriptionKey",
"enableDefault",
"editorGroup",
"editorOrder",
@@ -1162,6 +1164,13 @@ function validateSettings(settings: unknown, errors: string[]): void {
// An enable switch with no label is a blank row in the host editor.
requireString(host.enableLabelKey, `${at}.enableLabelKey`, errors);
}
if ("enableDescriptionKey" in host) {
requireString(
host.enableDescriptionKey,
`${at}.enableDescriptionKey`,
errors,
);
}
if ("enableDefault" in host && typeof host.enableDefault !== "boolean") {
errors.push(`${at}.enableDefault must be a boolean`);
}