feat: improve form error message handling#77
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 3 minutes and 1 second. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR improves client-side form validation feedback by rendering field-level validation messages inline for the HireUs and JoinUs forms, and by clarifying at least one schema error message.
Changes:
- Adds
FormMessageunder form controls inHireUsandJoinUsto show validation errors next to the relevant fields. - Updates the
hireUsFormSchema.descriptionminimum-length error message for clearer guidance. - Removes the “(required)” suffix rendering from
FormLabelin favor of dedicated field messages.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/lib/validation.ts |
Improves clarity of the description validation message for the Hire Us form. |
src/components/ui/form.tsx |
Removes required-error suffix from labels, relying on FormMessage for errors. |
src/components/JoinUs.tsx |
Displays the email field’s validation error below the input via FormMessage. |
src/components/HireUs.tsx |
Adds FormMessage across Hire Us fields to show inline validation errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request enhances form validation feedback for the
HireUsandJoinUscomponents by displaying error messages directly beneath form fields and improving the clarity of validation messages. The main changes focus on improving user experience and form accessibility.Form validation and user feedback improvements:
FormMessagecomponent after each form field in theHireUsandJoinUsforms to display validation error messages to users, ensuring errors are visible and contextually placed. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]FormMessagecomponent where necessary in bothHireUs.tsxandJoinUs.tsx. [1] [2]Validation message clarity:
hireUsFormSchemato be more descriptive, guiding users to provide at least 10 characters.Code cleanup:
FormLabelcomponent, as error messages are now consistently shown usingFormMessage.