fix(gp): merge initialValues with saved step values in admin steps#1172
Merged
Conversation
Mirror the employee-flow fix: an empty {} saved by useStepState after advancing
without edits is truthy and would win over initialValues via ||, blanking the
form on revisit. Merge instead — initialValues as base, saved edits override.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (381 total)
✅ Bundle size check passed |
Contributor
📊 Coverage Report✅ Coverage increased! 🎉
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
gabrielseco
approved these changes
Jul 17, 2026
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.
What
Follow-up flagged during the employee-flow review (#1168): the admin flow's step components used
stepState.values?.<step> || initialValues?.<step>fordefaultValues.useStepStatestores an empty{}when the user advances without editing prefilled data (sinceuseJSONSchemaFormonly syncs on watch-detected changes), and{}is truthy — so it won overinitialValuesand blanked the form on revisit.Fix
Switched
SelectCountryStep,ContractDetailsStep, andAdministrativeDetailsStepto a merge:{ ...initialValues[step], ...stepState.values[step] }—initialValuesis the base, genuine edits override. Same fix already applied to the employee flow in #1168.Verification
type-check ✅ · oxfmt ✅ · oxlint ✅
🤖 Generated with Claude Code
Note
Low Risk
Localized form default-value logic in three admin onboarding step components; no auth, API, or data-model changes.
Overview
Fixes payroll admin onboarding steps that blanked prefilled fields when users navigated back after advancing without editing.
defaultValuesno longer usesstepState.values?.<step> || initialValues?.<step>. Advancing without edits can persist an empty{}in step state, which is truthy and previously replaced realinitialValues. The three affected steps now spread-merge prefills first and saved step values on top:SelectCountryStep,ContractDetailsStep, andAdministrativeDetailsStep(same pattern as the employee flow in #1168).Reviewed by Cursor Bugbot for commit 3e6ecdf. Bugbot is set up for automated code reviews on this repo. Configure here.