Conversation
bba26bc to
3a7f67d
Compare
3a7f67d to
04c7c2a
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors multiple route components to use @tanstack/react-form instead of local useState for form state management. The changes introduce form validation with zod, auto-apply functionality for existing embeds, and better button states based on mutation status.
- Migrates state management from
useStateto@tanstack/react-formacross all route components - Adds form validation using zod schemas with custom refinement rules
- Implements auto-apply pattern that triggers mutations when form values change on existing embeds
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/routes/user.index.tsx | Replaced tab state management with form, added auto-apply on tab change |
| src/routes/support.index.tsx | Added minimal form integration for consistent submission handling |
| src/routes/lead-capture.index.tsx | Migrated uid state to form with validation, added auto-apply pattern |
| src/routes/email-list.index.tsx | Migrated uid state to form with validation, added auto-apply pattern |
| src/routes/auth.login.tsx | Added form integration for submission handling |
| src/routes/auth.index.tsx | Complex migration of multiple fields (preselect, familyUid, planUid, discountCode) to form with validation refinements |
Comments suppressed due to low confidence (2)
src/routes/email-list.index.tsx:59
- Unused variable cfg.
const cfg: EmailListEmbedConfig = { uid: value.uid };
src/routes/lead-capture.index.tsx:58
- Unused variable cfg.
const cfg: LeadCaptureEmbedConfig = { uid: value.uid };
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const cfg: LeadCaptureEmbedConfig = { uid: value.uid }; | ||
| switch (embedMode) { | ||
| case "embed": | ||
| await embedMutation.mutateAsync(); |
There was a problem hiding this comment.
The cfg variable is defined but never used. The embedMutation uses the config variable defined at line 76 instead. Either remove the unused cfg variable or pass it to the mutation if it was intended to use the form's submitted value.
| await embedMutation.mutateAsync(); | |
| await embedMutation.mutateAsync(cfg); |
| const cfg: EmailListEmbedConfig = { uid: value.uid }; | ||
| switch (embedMode) { | ||
| case "embed": | ||
| await embedMutation.mutateAsync(); |
There was a problem hiding this comment.
The cfg variable is defined but never used. The embedMutation uses the config variable defined at line 78 instead. Either remove the unused cfg variable or pass it to the mutation if it was intended to use the form's submitted value.
| await embedMutation.mutateAsync(); | |
| await embedMutation.mutateAsync(cfg); |
No description provided.