Skip to content

Refine routine exercise editing and save routines - #89

Merged
rd-code-23 merged 2 commits into
mainfrom
feature/routine-creation
Sep 8, 2026
Merged

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

Conversation

@rd-code-23

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

Copy link
Copy Markdown
Owner

Summary

  • move the exercise table into a full-width row beneath Routine Name and Schedule
  • size the desktop table around its content while enforcing a maximum width
  • preserve the full-width mobile layout and right-align row actions
  • keep very large numeric values inside their assigned columns
  • add an opaque, reusable Radix-based dropdown menu
  • allow configured exercises to be edited without creating duplicates
  • allow configured exercises to be removed and renumber remaining positions
  • identify edited occurrences by draft position so duplicate exercises are handled correctly
  • connect Save to the create-routine API through a TanStack Query mutation
  • invalidate the cached routine list after a successful creation so it can refetch current server data
  • reset the draft and return to the routines page after a successful save
  • show pending and failure feedback while saving
  • map the UI draft to the shared API contract and remove the display-only exercise name at the API boundary
  • reuse the shared minimum-exercise validation so Save remains disabled when no exercises have been configured

Editing flow

The configuration route accepts an optional validated position search parameter. Without a position, configuration adds a new exercise. With a position, it loads and replaces that exact draft occurrence.

Save flow

React Hook Form owns the draft across the nested creation routes. Clicking Save validates the draft with the shared Zod contracts, maps it into the API request shape, and starts the create mutation. Exercise names remain in the form for display but are removed before the request because the API only needs exercise IDs and configuration values.

After the API accepts the routine, TanStack Query marks the cached routine list as stale. This ensures the routines page can refetch the latest server data. The local draft is then cleared and the user is returned to the routines page. A failed request leaves the draft in place and displays an inline error.

Scheduling remains optional, but the routine name and at least one exercise are required. In a follow-up PR, Save will remain clickable for incomplete drafts and display specific inline validation messages instead of being disabled.

Verification

  • web typecheck passes
  • all 49 web tests pass
  • web lint passes
  • production build passes
  • regression coverage confirms a valid name alone does not enable Save without an exercise

@rd-code-23 rd-code-23 changed the title Refine the responsive routine exercise table Refine routine exercise table and add row actions Sep 8, 2026
@rd-code-23
rd-code-23 merged commit 225567a into main Sep 8, 2026
1 check passed
@rd-code-23 rd-code-23 changed the title Refine routine exercise table and add row actions Refine routine exercise editing and save routines Sep 8, 2026
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