From a987bf9d49918eadb8a88907bc6baa9c06a93efb Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 10 Aug 2026 05:57:19 +0000 Subject: [PATCH] fix(policies): send the empty list when the picker is cleared Clearing the capability or level picker used to drop the key entirely, so the stored mask survived the save and the requirement could never be removed from the UI. Now that the parser folds an empty list to the zero mask, the picker passes the selection through as-is. --- .../policies/policy-config-form/dynamic-form-field.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/schema-builder/src/schema/schema-builder-policies/components/policies/policy-config-form/dynamic-form-field.tsx b/packages/schema-builder/src/schema/schema-builder-policies/components/policies/policy-config-form/dynamic-form-field.tsx index d96fce8..26a5bee 100644 --- a/packages/schema-builder/src/schema/schema-builder-policies/components/policies/policy-config-form/dynamic-form-field.tsx +++ b/packages/schema-builder/src/schema/schema-builder-policies/components/policies/policy-config-form/dynamic-form-field.tsx @@ -295,7 +295,9 @@ function CapabilitySelectField({ defaultValue={selected} onValueChange={(next) => { setIsTouched(true); - onChange(next.length > 0 ? next : undefined); + // An empty list is a real value: the parser folds it to the zero + // mask, so clearing the picker clears the stored requirement. + onChange(next); }} disabled={disabled} placeholder={isLoading ? 'Loading...' : `Select ${scope} ${noun}`}