Skip to content

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

Merged
merged 3 commits into from
Jul 23, 2025

Conversation

Nabhag8848
Copy link
Contributor

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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:

  1. Adding red border styling for invalid phone numbers in MultiItemBaseInput
  2. Implementing proper phone validation using zod and libphonenumber-js
  3. Adding error state handling and propagation through the component hierarchy
  4. 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

  1. This PR is very safe to merge as it improves UX without changing core functionality
  2. The score is 4 because while the changes are well-structured, the new phoneSchema.ts has minimal test coverage
  3. 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

Copy link
Contributor

github-actions bot commented Jul 18, 2025

🚀 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.

@Nabhag8848 Nabhag8848 changed the title fix: phone input validation fix: phone input validation error should display red borders like email input Jul 21, 2025
@lucasbordeau lucasbordeau self-requested a review July 23, 2025 13:10
Copy link
Contributor

@lucasbordeau lucasbordeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lucasbordeau lucasbordeau merged commit 1e5d2f9 into twentyhq:main Jul 23, 2025
51 checks passed
Copy link
Contributor

Thanks @Nabhag8848 for your contribution!
This marks your 28th PR on the repo. You're top 2% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

prastoin pushed a commit that referenced this pull request Jul 24, 2025
…il input (#13275)

ISSUE 

- closes #13032

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Phone input validation error should display red borders like email input
2 participants