Skip to content

ref(tempest): migrate configForm to AutoSaveField#109363

Merged
JonasBa merged 8 commits into
masterfrom
worktree-agent-adeb85b3
Feb 26, 2026
Merged

ref(tempest): migrate configForm to AutoSaveField#109363
JonasBa merged 8 commits into
masterfrom
worktree-agent-adeb85b3

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented Feb 25, 2026

Migrates static/app/views/settings/project/tempest/configForm.tsx from the legacy Form/JsonForm system to the new AutoSaveField from @sentry/scraps/form.

The legacy form used saveOnBlur on a <Form> wrapper with a <JsonForm> field config array. The new implementation uses AutoSaveField with a Zod schema, a mutationFn calling fetchMutation, and a FormSearch wrapper so the field is indexed by settings search.

Changes:

  • Replace Form/JsonForm with AutoSaveField + FieldGroup + FormSearch
  • Map helphintText on field.Layout.Row
  • Add onSuccess: response => ProjectsStore.onUpdateSuccess(response) to keep the global project store fresh after save (matching the pattern used in other project settings forms like projectReplays.tsx)
  • Add FormSearch wrapper with route /settings/:orgId/projects/:projectId/playstation/ so the "Attach Screenshots" toggle is discoverable via settings search
  • Run extract-form-fields to register the field in generatedFieldRegistry.ts
  • Add configForm.spec.tsx with 6 tests covering label/hint rendering, initial switch state, API call data shape, ProjectsStore update on success, and graceful handling of undefined initial value

Replaces the legacy JsonForm/Form system with AutoSaveField from
@sentry/scraps/form. Adds a collocated test file covering label
rendering, initial state, toggle API call, and undefined value handling.
Add ProjectsStore.onUpdateSuccess in the mutationOptions.onSuccess
callback so that the global project store is updated after a successful
PUT, matching the behaviour of the legacy Form component's
onSubmitSuccess handler used across other project settings pages.

Also update the spec to import ConfigForm via relative path (so the
worktree module is resolved correctly in the shared Jest root) and add a
test verifying the ProjectsStore.onUpdateSuccess call on success.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 25, 2026
@JonasBa JonasBa marked this pull request as ready for review February 25, 2026 23:31
@JonasBa JonasBa requested a review from a team as a code owner February 25, 2026 23:31
Comment thread static/app/components/core/form/generatedFieldRegistry.ts Outdated
@JonasBa JonasBa enabled auto-merge (squash) February 26, 2026 18:21
@JonasBa JonasBa requested review from a team as code owners February 26, 2026 18:28
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 26, 2026
@JonasBa JonasBa force-pushed the worktree-agent-adeb85b3 branch from cbea679 to abc5643 Compare February 26, 2026 18:29
@JonasBa JonasBa removed the Scope: Backend Automatically applied to PRs that change backend components label Feb 26, 2026
@JonasBa JonasBa removed request for a team February 26, 2026 18:30
@getsentry getsentry deleted a comment from github-actions Bot Feb 26, 2026
@JonasBa JonasBa merged commit 3a5b3f2 into master Feb 26, 2026
60 checks passed
@JonasBa JonasBa deleted the worktree-agent-adeb85b3 branch February 26, 2026 18:38
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants