Repository navigation
Conversation
|
@CathyZaks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surface form-level Zod issues under
_formProblem
zodValidateonly mappedissue.path[0]and dropped empty-path issues (object-level.refine), andif (fieldName && ...)dropped falsy keys.settingsFormSchemahad no production consumer, anduseZodForm.test.tstesteduseForm.Solution
Empty-path issues are reported under reserved key
_form; a sharedFormErrorscomponent renders it. The unused settings schema and its misnamed test are removed; tests now live inzodValidate.test.ts.Changes
forms/zodValidate.ts:FORM_ERROR_KEY,FormErrorstype, empty path ->_form, no falsy-key drop.forms/useForm.ts: errors typed with_form;_formis kept when filtering by touched fields.forms/components/FormErrors.tsx: shared renderer (role="alert"); exported fromforms/index.ts.schemas/settingsFormSchema.tsanduseZodForm.test.ts.Regression Tests
_formzodValidate.test.ts,useForm.test.tsxcomponents/FormErrors.test.tsxzodValidate.test.tsreplacesuseZodForm.test.tszodValidate.test.ts(array schema)Testing
npx vitest run: Test Files 136 passed, Tests 1426 passed (before adding new tests);npx vitest run src/forms: 9 files, 108 tests passed.tscclean,npm run lint: 0 errors,npm run build: built.Notes for Reviewers
Removal chosen over wiring the schema into Settings.tsx (out of scope).
FormErrorsis not yet mounted in a production form since none uses object-level refines today.Closes #1623