Skip to content

fix: persist edited regular hours when adding overtime in RRoP edit employee - #2758

Merged
serikjensen merged 3 commits into
mainfrom
early-bug-fixes
Sep 11, 2026
Merged

fix: persist edited regular hours when adding overtime in RRoP edit employee#2758
serikjensen merged 3 commits into
mainfrom
early-bug-fixes

Conversation

@serikjensen

@serikjensen serikjensen commented Sep 11, 2026

Copy link
Copy Markdown
Member

What

Fixes a bug in the RRoP UNSTABLE_PayrollEditEmployee flow (via usePayrollEditEmployeeForm): editing an hourly employee's regular hours and then clicking Add overtime reverted the edited value back to the server total (e.g. an edited 32 snapped back to 40).

Why

actions.addOvertime re-derived the form defaults from the prepared payroll (the API), then setValue'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 internal withOvertime flag recomputes resolvedDefaults, which feeds useForm's values prop and resets the form (keeping only dirty fields).

Fix

  • Overlay the live collapsed value onto the first workweek cell when revealing the split, instead of using the API total.
  • Mark the seeded values dirty (shouldDirty: true) so the values-prop reset preserves them via keepDirtyValues rather than reverting to the API value.

Tests

Added a regression test: edit collapsed Regular Hours to 32, call addOvertime, and assert the first workweek cell holds 32 (not the API total 40). All 28 hook tests pass.

Reviewer notes

  • Only affects the RRoP edit-employee hook, gated behind the payrollRegularRateOfPay unstable flag.
  • No API/wire-format changes.
Screen.Recording.2026-09-11.at.3.06.15.PM.mov

🤖 Generated with Claude Code

…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>
@serikjensen
serikjensen requested a review from a team as a code owner September 11, 2026 21:09
serikjensen and others added 2 commits September 11, 2026 15:10
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serikjensen
serikjensen added this pull request to the merge queue Sep 11, 2026
Merged via the queue into main with commit 8dbd8bb Sep 11, 2026
39 checks passed
@serikjensen
serikjensen deleted the early-bug-fixes branch September 11, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants