Skip to content

refactor(web): migrate legacy forms to TanStack Form#30631

Merged
crazywoola merged 8 commits intomainfrom
refactor/migrate-legacy-forms-to-tanstack
Jan 6, 2026
Merged

refactor(web): migrate legacy forms to TanStack Form#30631
crazywoola merged 8 commits intomainfrom
refactor/migrate-legacy-forms-to-tanstack

Conversation

@lyzno1
Copy link
Member

@lyzno1 lyzno1 commented Jan 6, 2026

Closes #30629

Summary

Migrated the remaining legacy forms (installForm.tsx and ForgotPasswordForm.tsx) from react-hook-form to @tanstack/react-form. This standardizes the form architecture across the application and allows for the removal of unused dependencies.

Changes

  • Migrated installForm.tsx to use useAppForm
  • Migrated ForgotPasswordForm.tsx to use useAppForm
  • Removed react-hook-form and @hookform/resolvers from package.json
  • Updated pnpm-lock.yaml

Verification

  • Verified form validation and submission locally
  • Passed pnpm type-check
  • Passed pnpm lint
Copilot AI review requested due to automatic review settings January 6, 2026 09:08
@lyzno1 lyzno1 requested review from douxc and iamjoel as code owners January 6, 2026 09:08
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 6, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lyzno1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request completes the migration of legacy forms within the application, specifically installForm.tsx and ForgotPasswordForm.tsx, to utilize the @tanstack/react-form library. This effort aims to standardize the application's form architecture, ensuring consistency in form handling and validation, and allows for the removal of previously used react-hook-form dependencies.

Highlights

  • Form Library Migration: Migrated installForm.tsx and ForgotPasswordForm.tsx from react-hook-form to @tanstack/react-form using a custom useAppForm hook.
  • Dependency Removal: Removed react-hook-form and @hookform/resolvers from the project dependencies, along with updating pnpm-lock.yaml.
  • Standardized Form Architecture: Standardized the form architecture across the application by consolidating form handling to @tanstack/react-form.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the remaining legacy forms (installForm.tsx and ForgotPasswordForm.tsx) from react-hook-form to @tanstack/react-form, standardizing the form architecture across the application.

Key Changes

  • Migrated form validation from react-hook-form with zodResolver to TanStack Form with custom Zod validation in onSubmit validators
  • Replaced controlled form fields with TanStack Form's field rendering pattern using form.AppField and render props
  • Removed debounced keyboard handling in favor of built-in form submission with isSubmitting guards

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
web/package.json Removed react-hook-form and @hookform/resolvers dependencies that are no longer used
web/pnpm-lock.yaml Updated lock file to reflect dependency removals including transitive dependencies
web/app/install/installForm.tsx Migrated from react-hook-form to TanStack Form, replaced controlled inputs with field render props, removed debounced keyboard handling
web/app/forgot-password/ForgotPasswordForm.tsx Migrated from react-hook-form to TanStack Form, replaced controlled inputs with field render props
Files not reviewed (1)
  • web/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully migrates the remaining legacy forms from react-hook-form to @tanstack/react-form, standardizing the form architecture and removing unused dependencies. The changes in ForgotPasswordForm.tsx and installForm.tsx are well-executed.

I have two main suggestions:

  1. There's an opportunity to reduce code duplication by creating a reusable Zod validator utility for TanStack Form, as the validation logic is repeated in both forms.
  2. I've identified a bug in installForm.tsx where the password field does not display the correct validation error message, which could confuse users.

Addressing these points will improve the maintainability and correctness of the new form implementations. Overall, this is a great refactoring effort.

@lyzno1

This comment was marked as resolved.

@lyzno1
Copy link
Member Author

lyzno1 commented Jan 6, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the ForgotPasswordForm and InstallForm components from react-hook-form to a custom form solution built around @tanstack/react-form, involving updates to form initialization, submission logic, input field rendering, and error display. Review comments suggest improving the password validation message specificity in InstallForm.tsx, replacing console.error with a dedicated logging service in ForgotPasswordForm.tsx for production error tracking, and extracting duplicated Zod validation logic into a reusable utility function to enhance maintainability across both forms.

@lyzno1
Copy link
Member Author

lyzno1 commented Jan 6, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@lyzno1 lyzno1 requested a review from zxhlyh as a code owner January 6, 2026 09:51
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 6, 2026
@lyzno1 lyzno1 changed the title refactor: migrate legacy forms to TanStack Form refactor(web): migrate legacy forms to TanStack Form Jan 6, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 6, 2026
@crazywoola crazywoola merged commit 7beed12 into main Jan 6, 2026
17 checks passed
@crazywoola crazywoola deleted the refactor/migrate-legacy-forms-to-tanstack branch January 6, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

3 participants