Skip to content

ref(replays): migrate projectReplays settings to AutoSaveField#109364

Merged
JonasBa merged 9 commits intomasterfrom
worktree-agent-af4252fb
Feb 26, 2026
Merged

ref(replays): migrate projectReplays settings to AutoSaveField#109364
JonasBa merged 9 commits intomasterfrom
worktree-agent-af4252fb

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Feb 25, 2026

Migrates static/app/views/settings/project/projectReplays.tsx from the legacy Form/JsonForm system to the new AutoSaveField-based approach from @sentry/scraps/form.

The page had two boolean fields (sentry:replay_rage_click_issues and sentry:replay_hydration_error_issues) wrapped in a <Form saveOnBlur> + <JsonForm>. These are straightforward auto-save toggles with no confirmation dialogs or custom error handling, making them a clean migration target.

What changed:

  • Replace Form/JsonForm with two AutoSaveField components inside a FieldGroup
  • getData: data => ({options: data}) is handled in mutationFn via data: {options: data}
  • help text migrated to hintText on field.Layout.Row; the JSX help text for the hydration field is passed as tct(...) directly to hintText
  • onSubmitSuccessonSuccess in mutationOptions, calling ProjectsStore.onUpdateSuccess(response) with a typed fetchMutation<Project> to keep the project store consistent
  • Wrapped the return in <FormSearch route="/settings/:orgId/projects/:projectId/replays/"> so both fields are discoverable via settings search
  • Re-ran pnpm run extract-form-fields to register both fields in generatedFieldRegistry.ts under formId: 'project-replays'
  • Updated projectReplays.spec.tsx: use ProjectFixture with explicit options, add waitFor for async assertions, add a second test for the hydration error toggle, add a render test for both labels

Replaces the legacy Form/JsonForm pattern with AutoSaveField from
@sentry/scraps/form. Both boolean fields share a single mutationFn
that wraps the data in {options: data} as required by the project
settings endpoint.
Restore the ProjectsStore.onUpdateSuccess(response) call in the
mutationOptions onSuccess handler, which was lost in the initial
migration. The old Form had onSubmitSuccess that updated the project
store; this preserves that behavior using typed fetchMutation<Project>.
Wrap the component return in <FormSearch route="/settings/:orgId/projects/:projectId/replays/">
so both AutoSaveFields are discoverable by settings search. Re-run
extract-form-fields to register the two replay fields in generatedFieldRegistry.ts.
@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:30
@JonasBa JonasBa requested a review from a team as a code owner February 25, 2026 23:30
Co-authored-by: Dominik Dorfmeister <dominik.dorfmeister@sentry.io>
@JonasBa JonasBa merged commit a3b50e2 into master Feb 26, 2026
60 checks passed
@JonasBa JonasBa deleted the worktree-agent-af4252fb branch February 26, 2026 18:31
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.

2 participants