Allow hiding the printed URL on guest signs

This commit is contained in:
2026-09-10 13:50:32 -04:00
parent 8544c4128b
commit 2c22ff550f
5 changed files with 24 additions and 4 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import { savedSignSchema } from "./sign";
test("text sizing survives saved design round trips and rejects invalid scales", () => {
const base = { title: "Event", headline: "Share", message: "Welcome", paper: "letter", ink: "indigo" };
expect(savedSignSchema.parse(base).headlineScale).toBeUndefined();
const sized = { ...base, headlineScale: 150, messageScale: 125, titleScale: 75 };
const sized = { ...base, headlineScale: 150, messageScale: 125, titleScale: 75, showUrl: false };
expect(savedSignSchema.parse(JSON.parse(JSON.stringify(sized)))).toEqual(sized);
for (const key of ["headlineScale", "messageScale", "titleScale"]) {
for (const value of [0, 74, 151, Infinity, NaN, "125"]) expect(savedSignSchema.safeParse({ ...base, [key]: value }).success).toBe(false);
+1
View File
@@ -39,6 +39,7 @@ export const savedSignSchema = z.object({
accent: z.string().regex(/^#[a-f0-9]{6}$/i).optional(), font: z.enum(["funnel", "inter", "geologica"]).optional(),
decoration: z.enum(["arch", "frame", "minimal"]).optional(), showBrand: z.boolean().optional(),
backgroundImage: image, logoImage: image,
showUrl: z.boolean().optional(),
}).strict().superRefine((design, ctx) => {
if (design.paper !== "custom") return;
const divisor = design.unit === "mm" ? 25.4 : 1;