refactor(web): migrate legacy forms to TanStack Form#30631
Conversation
…ndling and explicit submit functions, integrating `formContext` and `isSubmitting` check.
…cy-forms-to-tanstack
Summary of ChangesHello @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 Highlights
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
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-formwithzodResolverto TanStack Form with custom Zod validation inonSubmitvalidators - Replaced controlled form fields with TanStack Form's field rendering pattern using
form.AppFieldand 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.
There was a problem hiding this comment.
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:
- 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.
- I've identified a bug in
installForm.tsxwhere 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.
This comment was marked as resolved.
This comment was marked as resolved.
…ng the button and adding a guard clause.
| /gemini review |
There was a problem hiding this comment.
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.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Closes #30629
Summary
Migrated the remaining legacy forms (
installForm.tsxandForgotPasswordForm.tsx) fromreact-hook-formto@tanstack/react-form. This standardizes the form architecture across the application and allows for the removal of unused dependencies.Changes
installForm.tsxto useuseAppFormForgotPasswordForm.tsxto useuseAppFormreact-hook-formand@hookform/resolversfrompackage.jsonpnpm-lock.yamlVerification
pnpm type-checkpnpm lint