fix(signing): name the number field's range issues the zod 4 way

The number dialog adds too_small and too_big issues for a field's min and
max without a message of its own, so zod's words are the ones shown. zod 4
reads what was measured from `origin`; the dialog still said `type`, zod 3's
name, so the types refused the issue and the message read "Too small:
expected undefined to be >=5". With `origin: 'number'` it reads "Too small:
expected number to be >=5" and "Too big: expected number to be <=10". Before
the sweep zod 3 said "Number must be greater than or equal to 5".

No test here: the schema is built inside the dialog in apps/remix, which has
no test runner. The strings above were measured with zod 4.6.5 and, for the
last one, zod/v3.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-09-19 04:38:57 -07:00
co-authored by Hanzo Dev
parent fa58fe3519
commit 603926c2cd
@@ -72,7 +72,7 @@ export const SignFieldNumberDialog = createCallable<SignFieldNumberDialogProps,
code: z.ZodIssueCode.too_small,
minimum: minValue,
inclusive: true,
type: 'number',
origin: 'number',
});
return;
@@ -83,7 +83,7 @@ export const SignFieldNumberDialog = createCallable<SignFieldNumberDialogProps,
code: z.ZodIssueCode.too_big,
maximum: maxValue,
inclusive: true,
type: 'number',
origin: 'number',
});
return;