Skip to content

feat: Updated forms validations to use mode: onTouched across all components#247

Merged
grandmaester merged 4 commits intomainfrom
feat/forms-validations-inconsistency-updates
Apr 13, 2026
Merged

feat: Updated forms validations to use mode: onTouched across all components#247
grandmaester merged 4 commits intomainfrom
feat/forms-validations-inconsistency-updates

Conversation

@grandmaester
Copy link
Copy Markdown
Contributor

@grandmaester grandmaester commented Apr 8, 2026

Summary

Inconsistencies in form validation across UI components

What

  1. Majority of forms (7 out of 15) use mode: ‘onSubmit’ to trigger validation, which delays feedback until form submission and the errors only appear after the users submits the form.
  2. The users are forced to backtrack and fix the errors in fields they’ve already mentally ‘checked off’. This is a poor user experience.
  3. This PR implements consistent validation across all forms using onTouched which standardize all forms to use onTouched mode for context aware, progressive validation and better UX.

Why

Current state: No consistent validation pattern across components as listed below

  1. 7 forms use onSubmit ❌
  2. 1 form uses onBlur 🆗
  3. 1 form uses onTouched ✅
  4. 4 form uses onChange ❌
  5. 1 form has no explicit validation mode (defaults to onSubmit) ❌

Testing

image image image image image image image image image
  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@grandmaester grandmaester self-assigned this Apr 8, 2026
@grandmaester grandmaester added the enhancement New feature or request label Apr 8, 2026
@grandmaester grandmaester marked this pull request as draft April 8, 2026 09:04
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 90.24390% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.65%. Comparing base (ac31ab4) to head (99ae2ad).

Files with missing lines Patch % Lines
...vider-configure/google-apps-sso-configure-form.tsx 33.33% 2 Missing ⚠️
...ate/provider-configure/okta-sso-configure-form.tsx 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #247      +/-   ##
==========================================
+ Coverage   88.64%   88.65%   +0.01%     
==========================================
  Files         154      155       +1     
  Lines       13129    13148      +19     
  Branches     1787     1401     -386     
==========================================
+ Hits        11638    11657      +19     
  Misses       1491     1491              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@grandmaester grandmaester marked this pull request as ready for review April 13, 2026 08:19
Comment thread packages/react/src/lib/constants/form-constants.ts
Comment thread packages/react/src/lib/constants/form-constants.ts
Copy link
Copy Markdown
Member

@SurajThotakura SurajThotakura left a comment

Choose a reason for hiding this comment

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

Looks good!

@grandmaester grandmaester merged commit 38ee2d9 into main Apr 13, 2026
6 checks passed
@grandmaester grandmaester deleted the feat/forms-validations-inconsistency-updates branch April 13, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants