Create flow cleanup: edit published rules, custom method cards, review polish, share/export & draft fixes #50
Reference in New Issue
Block a user
Delete Branch "adilallo/maintenance/CreateFlowCleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
This branch modernizes the create flow end-to-end: edit-rule from a published rule, custom method cards (wizard-style field blocks, customize/duplicate/remove via modal chrome), final review / core-values parity with other facets (kebab, read-only until customize), completed and published hydration so custom selections and field blocks show correctly after save and on the completed page, share & export on the completed shell, server uploads for create-flow assets, template facet routing and recommendation wiring, and profile draft behavior so managing a completed rule does not wipe unrelated in-progress server drafts. It also includes navigation/progress/registry cleanup, Storybook coverage for new UI, and expanded unit/integration tests across
lib/create, API routes, and screens.Primary goals:
Changes
CreateFlowLayoutClient,CreateFlowContext,flowSteps,createFlowPaths,createFlowScreenRegistry, progress proportion updates,prepareFreshCreateFlowEntry,runCompletedStepExit, top nav and screen shell composition.publishedDocumentToCreateFlowState,isPublishedRuleHydratePatchIncomplete), display merge frommethodSelectionsand custom field blocks (publishedDocumentToDisplaySections,ruleSectionsFromMethodSelections,buildPublishPayload);CompletedScreenand completed share/export hook.CustomMethodCardWizard(container/view), field block list with HTML5 reorder,CustomMethodCardModalBody, summary component,duplicateMethodCardModalDraft,methodCardCustomizeSession,usesWizardFieldBlocksModalBody,mergePresetMethodsWithCustom,removeMethodCardFromFacetSelection, kebab menu helper andMethodCardCustomizeModalHeader; method screens (communication, membership, decision, conflict) refactored for custom flows, deck ordering (useMethodCardDeckOrdering,methodCardDisplayOrder,methodCardSelectionOrder).FinalReviewChipEditModalexpansion,FinalReviewScreenwiring,applyFinalReviewChipEditPatch(incl. valueschipLabel),coreValueChipFacet,coreValueChipOptionsFromDraft,CoreValuesSelectScreenchip/edit/kebab behavior;FinalReviewCommunityContextEditModal.Create/ModalHeaderkebab triggers,ListItem,Popover,Sharemodal,AddCustomField,Verticalbutton,Rule/CardStackupdates, icons (custom, export formats, share assets).useCreateFlowExit(published save branch), avoid deleting the single serverruleDraftwhen exiting completed or after successful published update where inappropriate;ProfilePageClient/ profile copy.app/api/rules/[id]PATCH behavior, uploads routes (app/api/uploads/*), validation (createFlowSchemas,methodFacetsSchemas,templateFacetSchema),uploadToServer,saveCreateFlowUpload, template and recommendation helpers.TemplatesPageClient,useTemplatesFacetGridEntries,templateFacet.json,templateGridPresentation,governanceTemplateCatalog.docs/create-flow.md, backend/ops docs,.cursor/rules/create-flow.mdc,.env.example,CONTRIBUTING.md,.gitignore.vitest) for publish/hydrate/display, exit hooks, finalize, facet strings, wizard session, facet removal, Rule/CardStack, pages, Storybook additions.Screenshots
How to Test
.env.example, run migrations if needed (npm run migrate:*per CONTRIBUTING),npm install, then exercise create flow at/create./create/completed?ruleId=…where applicable.NEXT_PUBLIC_ENABLE_BACKEND_SYNCon if testing server drafts).useCompletedRuleShareExport(and Storybook Share if desired).npx tsc --noEmit --incremental falseif the incremental cache refers to stalecoverage/paths.Notes
ruleDraftper user; product behavior distinguishes “discard” vs “exit completed” vs “save published”; follow-up if multi-draft UX is desired.NEXT_PUBLIC_ENABLE_BACKEND_SYNCgates server draft PATCH/delete and related paths; verify both signed-in sync and anonymous flows when QAing.