Keep catalog method section editors after a Customize title override so Core Principle and related copy are not replaced by an empty custom-policy body.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { CreateFlowState } from "../../app/(app)/create/types";
|
||||
import type { CustomMethodCardFieldBlock } from "./customMethodCardFieldBlocks";
|
||||
import { isCatalogMethodCardId } from "./customRuleFacets";
|
||||
import { isCustomMethodCardId } from "./isCustomMethodCardId";
|
||||
|
||||
/**
|
||||
@@ -17,11 +18,17 @@ import { isCustomMethodCardId } from "./isCustomMethodCardId";
|
||||
* 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
|
||||
* of empty preset section editors. Pass `customFacetDetailsMatchPreset: false` when the
|
||||
* caller knows facet details were edited or cloned from a filled preset.
|
||||
* Catalog slugs (`video-meetings`, `signal`, …) may also have a meta row after
|
||||
* Customize writes a title override. Those cards keep the facet section editors
|
||||
* unless field blocks exist — matching catalog copy must not hide Core Principle /
|
||||
* Logistics / etc.
|
||||
*
|
||||
* **View mode** (`modalEditUnlocked` false): when a **user-authored** card still has
|
||||
* facet copy that matches empty preset seeds only (see
|
||||
* `./methodCardFacetMatchesPresetForId`), route to {@link CustomMethodCardModalBody}
|
||||
* so meta-only wizard cards show policy copy instead of empty section editors.
|
||||
* Pass `customFacetDetailsMatchPreset: false` when the caller knows facet details
|
||||
* were edited or cloned from a filled preset.
|
||||
*/
|
||||
export function usesWizardFieldBlocksModalBody(args: {
|
||||
methodId: string;
|
||||
@@ -45,6 +52,9 @@ export function usesWizardFieldBlocksModalBody(args: {
|
||||
if (!isCustomMethodCardId(args.methodId, args.meta)) {
|
||||
return false;
|
||||
}
|
||||
if (isCatalogMethodCardId(args.methodId)) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
!args.modalEditUnlocked && args.customFacetDetailsMatchPreset === true
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user