Stop treating login/save-progress as a 48-character email limit.

The overlay was failing Zod on preset method-card support text attached with the draft; raise that cap, allow RFC-length emails, and drop Back to home from the overlay.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-08-25 16:17:36 -06:00
co-authored by Cursor
parent 712437edc7
commit 8bdd5040c6
10 changed files with 122 additions and 30 deletions
@@ -2,7 +2,7 @@
export const CUSTOM_METHOD_CARD_WIZARD_MAX_FIELD_CHARS = 48;
/**
* Max length for the policy description. Wider than the title so Customize can
* seed existing card support text without blocking Next.
* Max length for persisted method-card `supportText`. Wider than the title so
* Customize can seed existing card copy and catalog blurbs without blocking Next.
*/
export const CUSTOM_METHOD_CARD_WIZARD_MAX_DESCRIPTION_CHARS = 200;
+2 -1
View File
@@ -1,4 +1,5 @@
const EMAIL_MAX_LEN = 254;
/** RFC 5321 max mailbox length (no angle brackets). */
export const EMAIL_MAX_LEN = 254;
/** Pragmatic check for the create-flow “save progress” email field (draft + footer enablement). */
export function isValidCreateFlowSaveEmail(value: unknown): boolean {
+8 -3
View File
@@ -1,6 +1,11 @@
import { z } from "zod";
import { FLOW_STEP_ORDER } from "../../../app/(app)/create/utils/flowSteps";
import { customMethodCardFieldBlocksByIdSchema } from "../../../lib/create/customMethodCardFieldBlocks";
import {
CUSTOM_METHOD_CARD_WIZARD_MAX_DESCRIPTION_CHARS,
CUSTOM_METHOD_CARD_WIZARD_MAX_FIELD_CHARS,
} from "../../../lib/create/customMethodCardWizardConstants";
import { EMAIL_MAX_LEN } from "../../../lib/create/isValidCreateFlowSaveEmail";
import { MAX_STAKEHOLDER_EMAILS } from "../../../lib/create/stakeholderLimits";
import { assertPlainJsonValue, DEFAULT_PLAIN_JSON_LIMITS } from "./plainJson";
@@ -62,8 +67,8 @@ const conflictManagementDetailEntrySchema = z.object({
});
const customMethodCardMetaEntrySchema = z.object({
label: z.string().max(48),
supportText: z.string().max(48),
label: z.string().max(CUSTOM_METHOD_CARD_WIZARD_MAX_FIELD_CHARS),
supportText: z.string().max(CUSTOM_METHOD_CARD_WIZARD_MAX_DESCRIPTION_CHARS),
});
/** Normalized (trim + lowercase) stakeholder email for drafts + publish. */
@@ -226,7 +231,7 @@ export const putDraftBodySchema = z.object({
export type CreateFlowStateValidated = z.infer<typeof createFlowStateSchema>;
export const magicLinkRequestBodySchema = z.object({
email: z.string(),
email: z.string().max(EMAIL_MAX_LEN),
next: z.string().optional(),
draft: createFlowStateSchema.optional(),
});