Skip to content

Save configured exercises to the routine draft - #86

Merged
rd-code-23 merged 2 commits into
mainfrom
feature/save-routine-exercises
Sep 3, 2026
Merged

rd-code-23 merged 2 commits into
mainfrom
feature/save-routine-exercises

Conversation

@rd-code-23

Copy link
Copy Markdown
Owner

Summary

  • Save a configured exercise into the shared routine React Hook Form draft
  • Return to the routine editor after configuration and show the updated exercise count
  • Keep exercise defaults in the shared Zod contract instead of duplicating them in the UI
  • Report numeric control changes back to React Hook Form

How the form works

The configuration screen uses a small local React Hook Form for the exercise being edited. Clicking Done validates that exercise with the shared contract, appends the parsed result to the parent routine form, and navigates back to the routine editor.

The shared Zod defaults make fields optional on the schema's input side because omitted or undefined values can be replaced. After parsing, those fields are guaranteed. The routine form therefore uses separate z.input and z.output types so React Hook Form accurately represents both the editable values and validated submission values.

Validation

  • pnpm lint
  • pnpm typecheck
  • contract tests
  • focused exercise configuration and routine editor tests

@rd-code-23
rd-code-23 merged commit 5109f86 into main Sep 3, 2026
1 check passed
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.

1 participant