fix: persist edited regular hours when adding overtime in RRoP edit employee - #2758
Merged
Conversation
…mployee addOvertime rebuilt each line's first workweek cell from the prepared payroll (API) total, overwriting a value the user had just typed into the collapsed input (e.g. reverting an edited 32 back to 40). Overlay the live collapsed value onto the first workweek cell and mark the seeded values dirty so the values-prop reset keeps them instead of reverting to the API total. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
serikjensen
enabled auto-merge
September 11, 2026 21:39
krisxcrash
approved these changes
Sep 11, 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
Fixes a bug in the RRoP
UNSTABLE_PayrollEditEmployeeflow (viausePayrollEditEmployeeForm): editing an hourly employee's regular hours and then clicking Add overtime reverted the edited value back to the server total (e.g. an edited32snapped back to40).Why
actions.addOvertimere-derived the form defaults from the prepared payroll (the API), thensetValue'd each line's first workweek cell to that API total, clobbering whatever the user had just typed into the collapsed input. On top of that, flipping the internalwithOvertimeflag recomputesresolvedDefaults, which feedsuseForm'svaluesprop and resets the form (keeping only dirty fields).Fix
shouldDirty: true) so thevalues-prop reset preserves them viakeepDirtyValuesrather than reverting to the API value.Tests
Added a regression test: edit collapsed Regular Hours to
32, calladdOvertime, and assert the first workweek cell holds32(not the API total40). All 28 hook tests pass.Reviewer notes
payrollRegularRateOfPayunstable flag.Screen.Recording.2026-09-11.at.3.06.15.PM.mov
🤖 Generated with Claude Code