Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Jan 10, 2026

Implemented client-side form validation for the Auth page.

  • Added fieldErrors state to track and display individual field errors.
  • Implemented validateForm to check for required fields, email format, and password length.
  • Updated Input components to receive and display error messages inline.
  • Added noValidate to the form to suppress default browser validation bubbles.
  • Verified changes with Playwright and visually confirmed error states.
  • Updated tracking files (.Jules/todo.md, .Jules/changelog.md, .Jules/knowledge.md).

PR created automatically by Jules for task 9851474974045613348 started by @Devasy23

Summary by CodeRabbit

  • New Features

    • Inline form validation on the auth page with real-time per-field feedback for email, password, and name; submission blocked if errors remain.
    • Errors clear as you edit fields and when switching between login and signup.
  • Accessibility

    • Error messages are announced to assistive tech and inputs indicate invalid state.
  • Documentation

    • Added a Form Validation Pattern to docs.

✏️ Tip: You can customize this high-level summary in your review settings.

@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 10, 2026

Walkthrough

Adds client-side inline validation to the Auth page with per-field error state, on-change error clearing, and ARIA-linked error messages; updates documentation and todo metadata to record the completed validation task.

Changes

Cohort / File(s) Change Summary
Documentation & Configuration
./.Jules/changelog.md, ./.Jules/knowledge.md, ./.Jules/todo.md
Adds changelog entry, a "Form Validation Pattern" doc block showing validation and accessibility guidance, and moves the "[ux] Form validation with inline feedback" task to Completed with metadata.
Auth page (form logic & UI)
web/pages/Auth.tsx
Adds FormErrors type, fieldErrors state, validateForm and clearFieldError; integrates validation into handleSubmit, wires per-field error props and onChange clearing, uses noValidate, and clears errors on auth mode toggle.
Input component (accessibility)
web/components/ui/Input.tsx
Adds errorId and aria-describedby linkage, sets aria-invalid when errors exist, renders error element with id and role="alert" to improve screen-reader announcements.

Suggested reviewers

  • vrajpatelll
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change in the pull request, which is implementing inline form validation on the Auth page with comprehensive accessibility support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e9196a and 4f3b31f.

📒 Files selected for processing (1)
  • web/pages/Auth.tsx
🧰 Additional context used
📓 Path-based instructions (1)
web/pages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Web pages should be created as components in web/pages/ and added to routing configuration

Files:

  • web/pages/Auth.tsx
🧬 Code graph analysis (1)
web/pages/Auth.tsx (1)
web/components/ui/Input.tsx (1)
  • Input (11-63)
🔇 Additional comments (7)
web/pages/Auth.tsx (7)

19-24: LGTM!

The FormErrors type is well-defined with explicit optional fields, providing good type safety for the validation pattern.


40-61: LGTM!

The validation function correctly handles required fields, email format, and password length. The conditional name validation for signup mode and the clean return pattern using Object.keys(newErrors).length === 0 follow good practices.


96-104: LGTM!

The validation is correctly invoked before submission, with early return on failure. The loading state is appropriately set only after validation passes.


134-138: LGTM!

The helper function is well-typed and includes an optimization to avoid unnecessary state updates when no error exists for the field.


254-300: LGTM!

The form correctly uses noValidate to suppress browser validation in favor of custom validation. Per-field errors are properly passed to Input components, which handle accessibility attributes (aria-invalid, aria-describedby, role="alert") as shown in the component definition. The clearFieldError calls on change provide good UX by clearing errors as the user corrects their input.


302-311: LGTM!

The role="alert" attribute ensures server-side error messages are announced to screen readers, addressing the accessibility requirement.


323-336: LGTM!

Clearing both field-level and server errors when toggling between login and signup modes prevents stale error messages from appearing, providing a clean UX.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link

netlify bot commented Jan 10, 2026

Deploy Preview for split-but-wiser ready!

Name Link
🔨 Latest commit 4f3b31f
🔍 Latest deploy log https://app.netlify.com/projects/split-but-wiser/deploys/696474facc351e0008f4ab99
😎 Deploy Preview https://deploy-preview-234--split-but-wiser.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Devasy Devasy marked this pull request as ready for review January 11, 2026 12:39
@Devasy Devasy requested a review from vrajpatelll as a code owner January 11, 2026 12:39
@Devasy
Copy link
Owner

Devasy commented Jan 12, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In @.Jules/changelog.md:
- Line 10: The changelog claim about "accessibility support" is inaccurate
because web/pages/Auth.tsx and the Input component only pass errors via the
error prop and render messages in a plain div; either update .Jules/changelog.md
to remove or tone down the accessibility claim, or implement proper ARIA
support: modify the Input component to apply aria-invalid when an error exists,
render error elements with stable IDs and expose them via
aria-describedby/aria-errormessage on the input, and ensure the Auth page uses
an aria-live="assertive" or role="alert" live region for announcing validation
errors so screen readers receive immediate feedback.

In @.Jules/knowledge.md:
- Around line 152-169: The Form Validation pattern is incomplete: extend the
validate function (validate) to include concrete rules for email, password, and
conditional name checks and ensure it sets per-field errors in fieldErrors; add
a clearFieldError(field) helper and call it from each input's onChange so errors
clear as the user types; wrap inputs in a <form> with noValidate and wire
handleSubmit to call validate before submission; pass per-field error strings to
Input via the error prop and add accessibility props (aria-invalid,
aria-describedby) to the Input and render an associated error element with
role="alert" whose id matches aria-describedby.

In @web/pages/Auth.tsx:
- Around line 34-61: Extract the duplicated error shape into a shared type alias
(e.g., declare type FormErrors = { email?: string; password?: string; name?:
string } and use it both where state is declared and inside validateForm),
remove the redundant isValid boolean inside validateForm, build newErrors as
before, setFieldErrors(newErrors), and return Object.keys(newErrors).length ===
0 as the validation result (or !Object.values(newErrors).some(Boolean)) so the
function only computes and returns validity based on newErrors.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8432ff and 963d999.

📒 Files selected for processing (4)
  • .Jules/changelog.md
  • .Jules/knowledge.md
  • .Jules/todo.md
  • web/pages/Auth.tsx
🧰 Additional context used
📓 Path-based instructions (1)
web/pages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Web pages should be created as components in web/pages/ and added to routing configuration

Files:

  • web/pages/Auth.tsx
🧬 Code graph analysis (1)
web/pages/Auth.tsx (1)
web/components/ui/Input.tsx (1)
  • Input (11-60)
🔇 Additional comments (8)
.Jules/todo.md (1)

149-152: Align the completion note with changelog claims.

The changelog (.Jules/changelog.md line 10) claims "accessibility support" was added, but this completion note doesn't mention any accessibility improvements.

For consistency across documentation, either:

  1. Update this impact statement to include accessibility improvements if they were actually implemented, or
  2. Update the changelog to remove the "accessibility support" claim if it wasn't fully addressed

Based on learnings, documentation consistency is important for future reference.

web/pages/Auth.tsx (7)

96-102: LGTM!

Validation is correctly invoked before proceeding with the API call, and the early return prevents unnecessary loading states and network requests.


134-138: LGTM!

The conditional check before updating state is a good optimization to avoid unnecessary re-renders when the field has no existing error.


254-254: LGTM!

Adding noValidate is the correct approach to suppress native browser validation in favor of custom inline validation.


262-272: LGTM!

The error clearing on input change provides good UX by immediately dismissing errors as the user corrects their input.


277-288: LGTM!

Consistent error handling pattern applied to the email input.


289-300: LGTM!

Consistent error handling pattern applied to the password input.


322-334: LGTM!

Clearing both field-specific and general errors when toggling between login and signup is good UX, preventing stale validation messages from the other form mode.

@Devasy
Copy link
Owner

Devasy commented Jan 12, 2026

@jules In @.Jules/changelog.md: - Line 10: The changelog claim about "accessibility support" is inaccurate because web/pages/Auth.tsx and the Input component only pass errors via the error prop and render messages in a plain div; either update .Jules/changelog.md to remove or tone down the accessibility claim, or implement proper ARIA support: modify the Input component to apply aria-invalid when an error exists, render error elements with stable IDs and expose them via aria-describedby/aria-errormessage on the input, and ensure the Auth page uses an aria-live="assertive" or role="alert" live region for announcing validation errors so screen readers receive immediate feedback. In @.Jules/knowledge.md: - Around line 152-169: The Form Validation pattern is incomplete: extend the validate function (validate) to include concrete rules for email, password, and conditional name checks and ensure it sets per-field errors in fieldErrors; add a clearFieldError(field) helper and call it from each input's onChange so errors clear as the user types; wrap inputs in a

with noValidate and wire handleSubmit to call validate before submission; pass per-field error strings to Input via the error prop and add accessibility props (aria-invalid, aria-describedby) to the Input and render an associated error element with role="alert" whose id matches aria-describedby. In @web/pages/Auth.tsx: - Around line 34-61: Extract the duplicated error shape into a shared type alias (e.g., declare type FormErrors = { email?: string; password?: string; name?: string } and use it both where state is declared and inside validateForm), remove the redundant isValid boolean inside validateForm, build newErrors as before, setFieldErrors(newErrors), and return Object.keys(newErrors).length === 0 as the validation result (or !Object.values(newErrors).some(Boolean)) so the function only computes and returns validity based on newErrors.

@google-labs-jules
Copy link
Contributor Author

@jules In @.Jules/changelog.md: - Line 10: The changelog claim about "accessibility support" is inaccurate because web/pages/Auth.tsx and the Input component only pass errors via the error prop and render messages in a plain div; either update .Jules/changelog.md to remove or tone down the accessibility claim, or implement proper ARIA support: modify the Input component to apply aria-invalid when an error exists, render error elements with stable IDs and expose them via aria-describedby/aria-errormessage on the input, and ensure the Auth page uses an aria-live="assertive" or role="alert" live region for announcing validation errors so screen readers receive immediate feedback. In @.Jules/knowledge.md: - Around line 152-169: The Form Validation pattern is incomplete: extend the validate function (validate) to include concrete rules for email, password, and conditional name checks and ensure it sets per-field errors in fieldErrors; add a clearFieldError(field) helper and call it from each input's onChange so errors clear as the user types; wrap inputs in a

with noValidate and wire handleSubmit to call validate before submission; pass per-field error strings to Input via the error prop and add accessibility props (aria-invalid, aria-describedby) to the Input and render an associated error element with role="alert" whose id matches aria-describedby. In @web/pages/Auth.tsx: - Around line 34-61: Extract the duplicated error shape into a shared type alias (e.g., declare type FormErrors = { email?: string; password?: string; name?: string } and use it both where state is declared and inside validateForm), remove the redundant isValid boolean inside validateForm, build newErrors as before, setFieldErrors(newErrors), and return Object.keys(newErrors).length === 0 as the validation result (or !Object.values(newErrors).some(Boolean)) so the function only computes and returns validity based on newErrors.

Thank you for the detailed feedback. I have implemented the requested changes:

  1. Updated web/components/ui/Input.tsx: Added aria-invalid to the input and aria-describedby pointing to the error message. The error message now has a stable ID based on the input ID and role="alert".
  2. Refactored web/pages/Auth.tsx: Introduced a FormErrors type, simplified validateForm to check newErrors length, and removed the redundant isValid boolean.
  3. Updated Documentation: Corrected .Jules/changelog.md to accurately reflect the new ARIA support and updated the pattern in .Jules/knowledge.md to include these accessibility best practices.

@Devasy
Copy link
Owner

Devasy commented Jan 12, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/pages/Auth.tsx (1)

302-310: Add role="alert" to the server-side error container for accessibility.

Field-level errors are properly announced via Input.tsx, but server-side errors in this container won't be announced to screen reader users.

♿ Proposed fix
               <motion.div
                 initial={{ opacity: 0, y: -10 }}
                 animate={{ opacity: 1, y: 0 }}
-                className={`p-3 text-red-600 text-sm font-medium border border-red-100 ${isNeo ? 'bg-red-100 border-2 border-black rounded-none' : 'bg-red-50 rounded-lg'}`}
+                role="alert"
+                className={`p-3 text-red-600 text-sm font-medium border border-red-100 ${isNeo ? 'bg-red-100 border-2 border-black rounded-none' : 'bg-red-50 rounded-lg'}`}
               >
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 963d999 and 4e9196a.

📒 Files selected for processing (4)
  • .Jules/changelog.md
  • .Jules/knowledge.md
  • web/components/ui/Input.tsx
  • web/pages/Auth.tsx
🧰 Additional context used
📓 Path-based instructions (1)
web/pages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Web pages should be created as components in web/pages/ and added to routing configuration

Files:

  • web/pages/Auth.tsx
🧬 Code graph analysis (1)
web/pages/Auth.tsx (1)
web/components/ui/Input.tsx (1)
  • Input (11-63)
🔇 Additional comments (8)
.Jules/changelog.md (1)

10-10: Changelog entry accurately reflects the implementation.

The ARIA accessibility features (aria-invalid, aria-describedby, role="alert") mentioned here are correctly implemented in web/components/ui/Input.tsx.

.Jules/knowledge.md (1)

152-191: Good documentation of the validation pattern.

The documented pattern accurately reflects the implementation in Auth.tsx and Input.tsx. This will help maintain consistency across future forms.

web/components/ui/Input.tsx (1)

16-16: Well-implemented accessibility pattern.

The ARIA linkage is correctly implemented:

  • errorId is stable (derived from inputId)
  • aria-describedby is conditionally set only when error exists
  • role="alert" ensures screen readers announce errors immediately

Also applies to: 41-42, 60-60

web/pages/Auth.tsx (5)

19-23: Type definition is appropriate for the current use case.

The FormErrors type with optional string fields aligns well with the validation logic and Input component's error prop.


40-61: Clean validation logic.

The implementation is straightforward and correctly derives validity from the absence of error keys. The email regex is basic but acceptable for client-side UX—server-side validation should handle edge cases.


96-102: Good integration of validation into submission flow.

The early return on validation failure and the typed clearFieldError helper are well-implemented. Checking fieldErrors[field] before updating state avoids unnecessary re-renders.

Also applies to: 134-138


254-254: Good UX pattern with noValidate and inline error clearing.

Using noValidate to suppress browser validation bubbles combined with clearing errors on input change provides a polished user experience.

Also applies to: 262-272


324-328: Good UX: clearing errors on form mode toggle.

Resetting both fieldErrors and error when switching between login and signup prevents stale error messages from persisting.

@Devasy
Copy link
Owner

Devasy commented Jan 12, 2026

@jules web/pages/Auth.tsx (1)
302-310: Add role="alert" to the server-side error container for accessibility.

Field-level errors are properly announced via Input.tsx, but server-side errors in this container won't be announced to scree

@google-labs-jules
Copy link
Contributor Author

@jules web/pages/Auth.tsx (1)
302-310: Add role="alert" to the server-side error container for accessibility.

Field-level errors are properly announced via Input.tsx, but server-side errors in this container won't be announced to scree

Acknowledged. I have added role="alert" to the server-side error container to ensure screen readers announce these errors immediately.

@Devasy
Copy link
Owner

Devasy commented Jan 12, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Owner

@Devasy Devasy left a comment

Choose a reason for hiding this comment

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

LGTM

@Devasy Devasy merged commit 6d66c35 into main Jan 12, 2026
12 checks passed
@Devasy Devasy deleted the jules/enhance-auth-validation-9851474974045613348 branch January 12, 2026 18:07
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.

2 participants