Skip to content

Full parity between built-in and custom exercises - #259

Open
giulioleuci wants to merge 1 commit into
DuarteSantos8:mainfrom
giulioleuci:feat/parity-exercises-issue-199
Open

giulioleuci wants to merge 1 commit into
DuarteSantos8:mainfrom
giulioleuci:feat/parity-exercises-issue-199

Conversation

@giulioleuci

Copy link
Copy Markdown
Contributor

Summary

Closes #199.

Built-in exercises become user-overridable and hideable without copying the 1,324-entry catalogue into user state; custom exercises gain the structured fields built-ins already had (steps, media). Both kinds now share one editor and one safe hide/delete flow.

  • Central resolver (lib/exercises.js): two new state fields, exOverrides and deletedEx, overlay onto the pristine CATALOGUE/EXDB, which are never mutated. Every listing surface (library, pickers, search) resolves through this one place, so an edit or hide shows up everywhere at once. Search now indexes exercise steps; imgSrc/gifSrc pass through absolute URLs for custom media.
  • Unified editor (sheets.jsx): the existing custom-exercise form now edits either a custom exercise or a built-in override — identical fields for both (name, body part, equipment, primary/secondary muscles, description, steps, media), plus a per-field "reset to default" control shown only where a built-in's value has actually been overridden. Saving a built-in diffs against its catalogue row and persists only the touched fields, dropping the override entirely once it matches the catalogue again. Delete/Hide share the active-workout guard and routine/history cleanup — customs delete permanently, built-ins hide reversibly via deletedEx.
  • Settings: a "Manage hidden exercises" screen lists every hidden built-in with per-item Restore and Restore all.
  • Fixed along the way: hidden built-ins stay resolvable by id (with any override applied) so historical workouts, recovery, muscle balance and stats keep rendering them correctly instead of falling back to a raw id or placeholder; i18n instruction/name packs no longer silently shadow a user's override for non-English languages; the catalogue's own duplicate names no longer block editing a built-in whose name is untouched.

Test plan

  • cd frontend && npm test — 107 files / 1486 tests passing
  • cd frontend && npm run build — clean production build
  • Manual trace of cross-cutting scenarios: hide + override on the same built-in, restore preserving the override, active-workout guard on both exercise kinds, non-English steps/name override precedence over the generated i18n packs

🤖 Generated with Claude Code

@giulioleuci

Copy link
Copy Markdown
Contributor Author

Implement #199

@DuarteSantos8

Copy link
Copy Markdown
Owner

Thanks @giulioleuci. v1.3.9 took one part of this area: custom exercises can carry a photo, GIF or short video and a link, kept on the server and the device, outside the synced data. The override/hide model for built-in exercises (exOverrides/deletedEx) and media on built-ins wait for the catalogue milestone (v1.4.6), so they can be designed together.

When you get back to it, please rebase onto v1.3.9, reuse the new media store for custom media, and leave out the docs/superpowers files.

…8#199)

Built-in exercises become user-overridable and hideable without
copying the 1,324-entry catalogue into user state; custom exercises
gain the structured fields built-ins already had (steps, media). Both
kinds now share one editor and one safe hide/delete flow.

How:
- lib/exercises.js: a central resolver (effectiveCatalogue/isHidden/
  allows/registerExerciseState) overlays two new state fields,
  exOverrides and deletedEx, onto the pristine CATALOGUE/EXDB, which
  are never mutated. Every listing surface (library, pickers, search)
  resolves through this one place, so a hide or edit shows up
  everywhere at once. Search now indexes exercise steps; imgSrc/gifSrc
  pass through absolute URLs for custom media.
- sheets.jsx: the existing CustomExForm now edits either a custom
  exercise or a built-in override — same fields for both (name, body
  part, equipment, primary/secondary muscles, description, steps,
  media), with a per-field "reset to default" control shown only where
  a built-in's value has actually been overridden. Saving a built-in
  diffs against its catalogue row and persists only the touched
  fields, dropping the override entirely once it matches the
  catalogue again. deleteCustomEx now branches into Delete (customs,
  permanent) or Hide (built-ins, reversible via deletedEx), sharing
  the active-workout guard and routine/history cleanup.
- views/Settings.jsx: a "Manage hidden exercises" screen lists every
  hidden built-in with per-item Restore and Restore all.
- Fixed along the way: exOr and EXIDX now keep a hidden built-in
  resolvable by id (by name, with any override applied) so historical
  workouts, recovery, muscle balance and stats keep rendering it
  correctly instead of falling back to a raw id or placeholder; i18n
  instruction/name packs no longer silently shadow a user's override
  for non-English languages; the catalogue's own duplicate names no
  longer block editing a built-in whose name is untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F8rGFygKVhbat2PyfGR53v
@giulioleuci
giulioleuci force-pushed the feat/parity-exercises-issue-199 branch from d5d1a58 to e7b0199 Compare October 4, 2026 10:55

This branch has not been deployed

No deployments
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.

[FEATURE REQUEST] Full parity between default and custom exercises: editable/deletable built-ins and unified exercise schema

2 participants