Route kebab Customize through the prefilled policy wizard so existing methods and values can be renamed, reordered, and kept in that field order on the card after Finalize.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-08-21 13:51:37 -06:00
co-authored by Cursor
parent e9951f260b
commit 4006fe5c6c
31 changed files with 3062 additions and 1530 deletions
+6 -4
View File
@@ -14,6 +14,9 @@ import { isCustomMethodCardId } from "./isCustomMethodCardId";
* stubs keep the facet's structured edit fields until the user adds blocks (then this
* returns true once persisted blocks are non-empty).
*
* Non-empty **draft** blocks also win, including catalog ids after Customize
* Finalize (facet editors ignore array order).
*
* **View mode** (`modalEditUnlocked` false): when the custom card still has facet copy
* that matches preset seeds only (see `./methodCardFacetMatchesPresetForId`), route to
* {@link CustomMethodCardModalBody} so meta-only wizard cards show policy copy instead
@@ -33,16 +36,15 @@ export function usesWizardFieldBlocksModalBody(args: {
if (Array.isArray(persisted) && persisted.length > 0) {
return true;
}
if (!isCustomMethodCardId(args.methodId, args.meta)) {
return false;
}
if (
args.modalEditUnlocked &&
args.draftFieldBlocks !== null &&
args.draftFieldBlocks.length > 0
) {
return true;
}
if (!isCustomMethodCardId(args.methodId, args.meta)) {
return false;
}
return (
!args.modalEditUnlocked && args.customFacetDetailsMatchPreset === true
);