Skip to content

Create custom exercises from routine picker - #92

Merged
rd-code-23 merged 1 commit into
mainfrom
feat/custom-exercise-frontend
Sep 13, 2026
Merged

rd-code-23 merged 1 commit into
mainfrom
feat/custom-exercise-frontend

Conversation

@rd-code-23

@rd-code-23 rd-code-23 commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • create custom exercises directly from the routine exercise picker
  • validate custom-exercise forms with shared Zod contracts
  • add an ownership-protected endpoint for renaming custom exercises
  • allow custom exercise names to be edited from Configure Exercise while remaining on that page
  • update the TanStack Query cache after create and rename operations
  • keep exercise names out of the RHF routine draft and derive them reactively from the existing query cache
  • subscribe from the routine editor with enabled: false so it does not initiate exercise API requests
  • show inline validation and request-failure feedback

State ownership

TanStack Query owns server-derived exercise data such as names and descriptions. React Hook Form stores only routine-specific configuration plus exerciseId and draftExerciseId. This avoids keeping duplicate exercise names synchronized between the query cache and the routine draft.

The routine editor observes the existing exercise cache without fetching. Updating the cache after a rename therefore updates the displayed routine exercise name automatically.

Security

The update service matches both the exercise ID and authenticated owner ID. Built-in exercises and exercises owned by another user cannot be renamed through this endpoint.

Verification

  • complete repository test command passes
  • 13 contract tests pass
  • 69 API tests pass
  • 55 web tests pass
  • API and web typechecks pass
  • API and web lint pass

@rd-code-23
rd-code-23 merged commit 4a5f64c into main Sep 13, 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