-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix: phone input validation error should display red borders like email input #13275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR improves phone number input validation in the form system by adding visual error feedback and preventing the input from closing when invalid numbers are entered. The changes include:
- Adding red border styling for invalid phone numbers in
MultiItemBaseInput
- Implementing proper phone validation using
zod
andlibphonenumber-js
- Adding error state handling and propagation through the component hierarchy
- Creating a new
phoneSchema
validation module
The change aligns phone input validation behavior with email input validation, providing a more consistent user experience. Instead of silently failing and closing when invalid phone numbers are entered, the input now shows a red border and maintains the user's input.
Confidence score: 4/5
- This PR is very safe to merge as it improves UX without changing core functionality
- The score is 4 because while the changes are well-structured, the new phoneSchema.ts has minimal test coverage
- Files needing attention:
- packages/twenty-front/src/modules/object-record/record-field/validation-schemas/phoneSchema.ts - Consider adding test cases
3 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile
packages/twenty-front/src/modules/object-record/record-field/validation-schemas/phoneSchema.ts
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/object-record/record-field/validation-schemas/phoneSchema.ts
Outdated
Show resolved
Hide resolved
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:62052 This environment will automatically shut down when the PR is closed or after 5 hours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @Nabhag8848 for your contribution! |
ISSUE