ref(billing): Migrate spend notifications form to new form system#114303
Merged
ref(billing): Migrate spend notifications form to new form system#114303
Conversation
Collaborator
Author
|
bugbot run |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f042ae9. Configure here.
JonasBa
approved these changes
Apr 30, 2026
# Conflicts: # static/gsApp/views/subscriptionPage/notifications.tsx
cleptric
pushed a commit
that referenced
this pull request
May 5, 2026
…14303) Migrates the spend notifications threshold management page (`/settings/billing/notifications/`) from manual `useState`/`useEffect` state management with a raw `<Select>` and legacy `FieldGroup` to the new TanStack-based form system. The page had two multi-select fields (subscription consumption thresholds and on-demand consumption thresholds) with Save/Reset buttons in the page header. The migration: - Replaces manual state management with `useScrapsForm` and `fetchMutation` - Replaces the raw `<Select>` + styled legacy `FieldGroup` with `field.Select` inside `field.Layout.Row` within a new-system `FieldGroup` - Moves Save/Reset buttons from the `SettingsPageHeader` action slot into the form body, using `form.Subscribe` for reactive dirty/valid state - Adds `onChange` validation with `.min(1)` on `reservedPercent` to prevent saving with no thresholds selected - Migrates data fetching from `useApiQuery` to `apiOptions` with `useQuery` - Removes the responsive breakpoint logic that duplicated the buttons — they now live in one place inside the form The `NotificationButtons`, `ThresholdInputs`, and `GenericConsumptionGroup` components are collapsed into a single `ThresholdsForm` component since the separation was only needed when buttons lived in the header. refs DE-1190
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Migrates the spend notifications threshold management page (
/settings/billing/notifications/) from manualuseState/useEffectstate management with a raw<Select>and legacyFieldGroupto the new TanStack-based form system.The page had two multi-select fields (subscription consumption thresholds and on-demand consumption thresholds) with Save/Reset buttons in the page header. The migration:
useScrapsFormandfetchMutation<Select>+ styled legacyFieldGroupwithfield.Selectinsidefield.Layout.Rowwithin a new-systemFieldGroupSettingsPageHeaderaction slot into the form body, usingform.Subscribefor reactive dirty/valid stateonChangevalidation with.min(1)onreservedPercentto prevent saving with no thresholds selecteduseApiQuerytoapiOptionswithuseQueryThe
NotificationButtons,ThresholdInputs, andGenericConsumptionGroupcomponents are collapsed into a singleThresholdsFormcomponent since the separation was only needed when buttons lived in the header.refs DE-1190