From 72ccd397f9cee61782d68147b513194a9288a795 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 1 Feb 2026 11:48:05 -0600 Subject: [PATCH] apply hidden fields after ui schema --- web/src/components/config-form/ConfigForm.tsx | 16 ++++++++++++++++ .../config-form/section-configs/snapshots.ts | 3 +++ 2 files changed, 19 insertions(+) diff --git a/web/src/components/config-form/ConfigForm.tsx b/web/src/components/config-form/ConfigForm.tsx index c909dbefc..b457666bb 100644 --- a/web/src/components/config-form/ConfigForm.tsx +++ b/web/src/components/config-form/ConfigForm.tsx @@ -251,6 +251,21 @@ export function ConfigForm({ ? { norender: false } : { norender: true }; + // Ensure hiddenFields take precedence over any custom uiSchema overrides + // Build path-based overrides for hidden fields and apply them after merging + if (hiddenFields && hiddenFields.length > 0) { + const hiddenOverrides = hiddenFields.map((field) => ({ + path: field.split("."), + value: { "ui:widget": "hidden" } as UiSchema, + })); + + return applyUiSchemaPathOverrides( + merged, + transformedSchema, + hiddenOverrides, + ); + } + return merged; }, [ generatedUiSchema, @@ -259,6 +274,7 @@ export function ConfigForm({ baseUiSchema, showSubmit, fieldGroups, + hiddenFields, ]); // Create error transformer for user-friendly error messages diff --git a/web/src/components/config-form/section-configs/snapshots.ts b/web/src/components/config-form/section-configs/snapshots.ts index 6b496083b..0897d31f7 100644 --- a/web/src/components/config-form/section-configs/snapshots.ts +++ b/web/src/components/config-form/section-configs/snapshots.ts @@ -24,6 +24,9 @@ const snapshots: SectionConfigOverrides = { }, }, }, + global: { + hiddenFields: ["enabled_in_config", "required_zones"], + }, }; export default snapshots;