From 42d83c8b627f2780ccc5c5d44d3503256fa5ec05 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Thu, 10 Sep 2026 11:37:41 -0600 Subject: [PATCH] Give builder fields persistent labels, treat description as optional, and validate save-progress email with a real form. Name stays required; description is a labelled optional textarea. Email uses native validity and form submit. Drop the dead workshop link and fix a few copy errors. Co-authored-by: Cursor --- app/(app)/create/CreateFlowLayoutClient.tsx | 40 +++++++-- .../CustomMethodCardWizard.view.tsx | 2 + ...CustomMethodCardWizardFieldBodies.view.tsx | 10 ++- .../FinalReviewCommunityContextEditModal.tsx | 10 ++- .../components/FinalReviewTitleEditModal.tsx | 3 + .../screens/createFlowScreenComponents.tsx | 2 + .../informational/InformationalScreen.tsx | 19 +--- .../text/CreateFlowTextFieldScreen.tsx | 89 +++++++++++++++---- app/(app)/create/utils/createFlowPaths.ts | 4 + .../InputWithCounter.view.tsx | 10 ++- .../controls/TextArea/TextArea.view.tsx | 54 ++++++----- .../TextInput/TextInput.container.tsx | 10 +++ .../controls/TextInput/TextInput.types.ts | 5 ++ .../controls/TextInput/TextInput.view.tsx | 70 ++++++++++----- lib/create/isValidCreateFlowSaveEmail.ts | 29 +++++- .../en/create/community/communityContext.json | 3 +- .../en/create/community/communityName.json | 3 +- .../en/create/community/communitySave.json | 1 + .../create/community/communityStructure.json | 2 +- .../en/create/community/communityUpload.json | 2 +- .../en/create/community/informational.json | 4 +- .../customRule/customMethodCardWizard.json | 2 +- stories/pages/TextPage.stories.js | 23 +++++ .../CommunityStructureSelectScreen.test.tsx | 3 + tests/components/FinalReviewPage.test.tsx | 12 +-- tests/components/InformationalPage.test.tsx | 6 +- tests/components/InputWithCounter.test.tsx | 22 ++++- tests/components/TextArea.test.tsx | 10 +++ tests/components/TextInput.test.tsx | 26 ++++++ tests/components/TextPage.test.tsx | 56 ++++++++++-- tests/components/UploadPage.test.tsx | 2 +- tests/unit/createFlowPaths.test.ts | 7 ++ tests/unit/isValidCreateFlowSaveEmail.test.ts | 21 +++++ 33 files changed, 437 insertions(+), 125 deletions(-) create mode 100644 tests/unit/isValidCreateFlowSaveEmail.test.ts diff --git a/app/(app)/create/CreateFlowLayoutClient.tsx b/app/(app)/create/CreateFlowLayoutClient.tsx index 74f3e58..85e38c4 100644 --- a/app/(app)/create/CreateFlowLayoutClient.tsx +++ b/app/(app)/create/CreateFlowLayoutClient.tsx @@ -33,6 +33,7 @@ import { TEMPLATE_REVIEW_FROM_CREATE_FLOW_VALUE, } from "./utils/flowSteps"; import { + CREATE_FLOW_COMMUNITY_SAVE_FORM_ID, CREATE_FLOW_SYNC_DRAFT_QUERY, CREATE_FLOW_SYNC_DRAFT_VALUE, CREATE_ROUTES, @@ -482,12 +483,28 @@ function CreateFlowLayoutContent({ return () => window.clearTimeout(timeoutId); }, [currentStep, sessionResolved, sessionUser, openLogin]); - const handleCommunitySaveMagicLinkSubmit = useCallback(async () => { + const handleCommunitySaveMagicLinkSubmit = useCallback(async ( + formEl?: HTMLFormElement | null, + ) => { setCommunitySaveMagicLinkError(null); setCommunitySaveMagicLinkSuccess(false); - const raw = state.communitySaveEmail; - const trimmed = typeof raw === "string" ? raw.trim().toLowerCase() : ""; - if (!isValidCreateFlowSaveEmail(trimmed)) return; + const namedEmail = formEl?.elements.namedItem("email"); + const emailField = + namedEmail instanceof HTMLInputElement + ? namedEmail + : typeof document === "undefined" + ? null + : document.querySelector( + `input[name="email"][form="${CREATE_FLOW_COMMUNITY_SAVE_FORM_ID}"]`, + ); + if (emailField != null && !emailField.checkValidity()) { + emailField.reportValidity(); + return; + } + const raw = + emailField != null ? emailField.value : state.communitySaveEmail; + if (typeof raw !== "string" || !isValidCreateFlowSaveEmail(raw)) return; + const trimmed = raw.trim().toLowerCase(); setCommunitySaveMagicLinkSubmitting(true); try { @@ -770,6 +787,16 @@ function CreateFlowLayoutContent({ isCompletedStep ? "!bg-[var(--color-teal-teal50,#c9fef9)]" : "" }`.trim()} /> + {currentStep === "community-save" ? ( +
{ + e.preventDefault(); + void handleCommunitySaveMagicLinkSubmit(e.currentTarget); + }} + /> + ) : null}
@@ -841,6 +868,8 @@ function CreateFlowLayoutContent({ {footer.saveLater}