Repository navigation
Save schedules to the routine draft - #85
Merged
rd-code-23 merged 2 commits intoAug 30, 2026
Merged
rd-code-23 merged 2 commits into
rd-code-23 merged 2 commits into
Conversation
rd-code-23
merged commit Aug 30, 2026
6f49f1e
into
feature/routine-schedule-shared-time
1 check passed
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.
Summary
Connects the schedule modal to the shared React Hook Form routine draft so confirmed schedules survive navigation and can later be submitted with the complete routine.
Behavior
State ownership
The reducer remains a temporary editing buffer for the open modal. RHF owns only schedules that the user has confirmed with Save Schedule. This separation means Cancel can discard edits without corrupting the saved routine draft.
React Hook Form details
useWatch subscribes to the schedules field through RHF control, which is RHF reference to this specific form instance. When setValue replaces schedules, watched components rerender with the confirmed values. shouldDirty marks the routine as changed and shouldValidate runs the shared Zod resolver immediately.
Tests
Dependency
This PR is stacked on PR #84, which adds the schedule reducer and shared-time behavior. Once #84 merges, this PR can be rebased or retargeted to main.