Skip to content

Show configured exercises in routine drafts - #87

Merged
rd-code-23 merged 1 commit into
mainfrom
feature/show-routine-exercises
Sep 4, 2026
Merged

rd-code-23 merged 1 commit into
mainfrom
feature/show-routine-exercises

Conversation

@rd-code-23

Copy link
Copy Markdown
Owner

Summary

  • display configured exercises in the routine editor with responsive desktop and mobile layouts
  • keep the selected exercise name as UI-only React Hook Form draft data
  • strip the display-only name from Zod's parsed output so the eventual API payload retains the shared backend contract
  • avoid fetching the exercise catalog from the routine editor
  • reuse TanStack Query's exercise cache for two minutes when navigating through the exercise picker and configuration flow
  • add React Query Devtools in development for inspecting cached queries

Data flow

The exercise picker loads the exercise catalog through TanStack Query. When an exercise is configured, its ID and routine-specific values are saved to the shared React Hook Form draft. The exercise name is also retained in that draft strictly for rendering the routine editor.

The draft exercise schema extends the shared API schema with the display-only name. Its Zod transform removes that name from validated output, preventing duplicated catalog data from being sent when routine saving is implemented.

Testing

  • verifies the routine editor does not fetch the exercise catalog
  • verifies a configured exercise appears after returning from configuration
  • verifies returning to the picker within the stale window reuses the cached exercise query
  • web TypeScript check passes
  • focused routine tests pass
  • web lint passes

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