Keep the review card’s fallback color on the draft so a reload does not pick a new one.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
56adcd59fd
commit
6d536880fe
8 files changed
+165
-8
No files matched your search
@@ -122,6 +122,14 @@ export function randomPreviewSurfaceColor(
|
||||
return `hsl(${hue}, ${saturation}%, ${lightness}%)`;
|
||||
}
|
||||
|
||||
const STORED_PREVIEW_SURFACE_COLOR =
|
||||
/^hsl\(\d{1,3}, \d{1,3}%, \d{1,3}%\)$/;
|
||||
|
||||
/** True when `value` is a draft-stored review-card fallback fill. */
|
||||
export function isPreviewSurfaceColor(value: string): boolean {
|
||||
return STORED_PREVIEW_SURFACE_COLOR.test(value);
|
||||
}
|
||||
|
||||
function imageNeedsCors(url: string): boolean {
|
||||
if (
|
||||
url.startsWith("/") ||
|
||||
|
||||
@@ -106,6 +106,11 @@ export const createFlowStateSchema = z
|
||||
communityContext: z.string().max(200).optional(),
|
||||
communitySaveEmail: z.string().max(320).optional(),
|
||||
communityAvatarUrl: z.string().max(512).optional(),
|
||||
previewSurfaceColor: z
|
||||
.string()
|
||||
.max(32)
|
||||
.regex(/^hsl\(\d{1,3}, \d{1,3}%, \d{1,3}%\)$/)
|
||||
.optional(),
|
||||
selectedCommunitySizeIds: z.array(z.string()).optional(),
|
||||
selectedOrganizationTypeIds: z.array(z.string()).optional(),
|
||||
selectedScaleIds: z.array(z.string()).optional(),
|
||||
|
||||
Reference in new issue
Block a user