Skip to content

ref(forms): Migrate CreateTeamForm to TanStack form system#115991

Draft
priscilawebdev wants to merge 1 commit into
masterfrom
priscilawebdev/ref/de-1256-migrate-create-team-form
Draft

ref(forms): Migrate CreateTeamForm to TanStack form system#115991
priscilawebdev wants to merge 1 commit into
masterfrom
priscilawebdev/ref/de-1256-migrate-create-team-form

Conversation

@priscilawebdev
Copy link
Copy Markdown
Member

Migrate CreateTeamForm from the legacy Form / TextField to useScrapsForm with field.Input and form.SubmitButton. Validation moves to a zod schema, and the busy/disabled state is driven by the form rather than the legacy FormModel.

While here, simplify the onSubmit prop. The legacy (data, onSuccess, onError) => void signature exposed FormModel-internal completion hooks; the new form tracks submitting/error state itself, so the prop becomes a plain (data) => Promise<…>. createTeam already surfaces success/error toasts, so the modal just awaits and closes on success. The unused organization prop on CreateTeamForm drops out at the same time.

slugify still runs on every keystroke, just via onChange={value => field.handleChange(slugify(value))} instead of the legacy transformInput prop.

Refs DE-1256

Replace the legacy Form/TextField with useScrapsForm and field.Input.
The form now drives validation via a zod schema and the SubmitButton
handles busy/disabled state through the form context.

Simplify the onSubmit prop signature — the legacy (data, onSuccess,
onError) callbacks were FormModel-internal hooks for state tracking,
which the new form handles itself. The createTeam action creator
already surfaces success/error toasts, so the modal just awaits the
mutation and closes on success. The unused organization prop on
CreateTeamForm is dropped along with it.

Refs DE-1256
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 21, 2026

DE-1256

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.61%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant