Skip to content

feat: improve ui for exercises and support cardio and isometric types#1164

Merged
CodeWithCJ merged 1 commit intoCodeWithCJ:mainfrom
Sim-sat:feat-isometrics
Apr 20, 2026
Merged

feat: improve ui for exercises and support cardio and isometric types#1164
CodeWithCJ merged 1 commit intoCodeWithCJ:mainfrom
Sim-sat:feat-isometrics

Conversation

@Sim-sat
Copy link
Copy Markdown
Contributor

@Sim-sat Sim-sat commented Apr 20, 2026

Description

Description

What problem does this PR solve?

  1. Redundant column headers rendered above every individual set.
  2. No support isometric exercises (which measure holds instead of reps).
  3. No dedicated interface existed for cardio exercises, forcing them into a set-based format that doesn't make sense.
  4. The edit and log exercise dialogs were overloaded with inputs optimized exclusively for strength training.
  5. Drag and drop functionality was broken due to unstable array index keys.

How did you implement the solution?

  1. Created a standalone header component rendered once per exercise. Reduced the size of the weight input and set action buttons to display only on hover.
  2. Added an "isometric" exercise type that visually swaps "Reps" for "Hold (s)" on the frontend. Note: Since the backend does not natively support isometric holds, this value is still saved as reps.
  3. Built a new, dedicated cardio component from scratch to display only relevant metrics without a set structure.
  4. Relocated secondary input fields into a collapsible advanced section to clean up the default view.
  5. Implemented stable, unique identifiers (crypto.randomUUID()) for drag-and-drop element keys.

I also added the option to style the input element for the UnitInput component which was missing. We could think about adding a few more variations depending on the type in the future.

Linked Issue: #

How to Test

  1. Check out this branch and run ...
  2. Navigate to...
  3. Verify that...

PR Type

  • Issue (bug fix)
  • New Feature
  • Refactor
  • Documentation

Checklist

All PRs:

  • [MANDATORY - ALL] Integrity & License: I certify this is my own work, free of malicious code, and I agree to the License terms.

New features only:

  • [MANDATORY for new feature] Alignment: I have raised a GitHub issue and it was reviewed/approved by maintainers or it was approved on Discord.

Frontend changes (SparkyFitnessFrontend/ or src/):

  • [MANDATORY for Frontend changes] Quality: I have run pnpm run validate and it passes.
  • [MANDATORY for Frontend changes] Translations: I have only updated the English (en) translation file.

Backend changes (SparkyFitnessServer/):

  • [MANDATORY for Backend changes] Code Quality: I have run typecheck, lint, and tests. New files use TypeScript, new endpoints have Zod schemas, and new endpoints include tests.
  • [MANDATORY for Backend changes] Database Security: I have updated rls_policies.sql for any new user-specific tables.

UI changes (components, screens, pages):

  • [MANDATORY for UI changes] Screenshots: I have attached Before/After screenshots below.

Screenshots

Exercise Entries

Isometric (Extended Advanced Section) Cardio (Collapsed Advanced Section)
Isometric Cardio

Workout Preset

Before After
Preset Before Preset After

Colored Types

image

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly refactors the exercise logging system to support cardio and isometric exercise categories, introducing new components like CardioLog and SetHeader for specialized layouts. It also improves the drag-and-drop experience by transitioning to unique set identifiers (_dndId). Feedback focuses on a critical bug in the set duplication logic that causes ID collisions and provides suggestions to prevent 'undefined' strings from appearing in CSS classes when using the new optional inputClassName prop in UnitInput.

Comment thread SparkyFitnessFrontend/src/pages/Diary/EditExerciseEntryDialog.tsx Outdated
Comment thread SparkyFitnessFrontend/src/components/ui/UnitInput.tsx
Comment thread SparkyFitnessFrontend/src/components/ui/UnitInput.tsx
Comment thread SparkyFitnessFrontend/src/components/ui/UnitInput.tsx
@CodeWithCJ CodeWithCJ merged commit 166453b into CodeWithCJ:main Apr 20, 2026
10 checks passed
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Apr 29, 2026
)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/codewithcj/sparkyfitness-frontend](https://github.com/CodeWithCJ/SparkyFitness) | patch | `v0.16.5.8` → `v0.16.5.9` |
| [ghcr.io/codewithcj/sparkyfitness-server](https://github.com/CodeWithCJ/SparkyFitness) | patch | `v0.16.5.8` → `v0.16.5.9` |

---

### Release Notes

<details>
<summary>CodeWithCJ/SparkyFitness (ghcr.io/codewithcj/sparkyfitness-frontend)</summary>

### [`v0.16.5.9`](https://github.com/CodeWithCJ/SparkyFitness/releases/tag/v0.16.5.9)

[Compare Source](CodeWithCJ/SparkyFitness@v0.16.5.8...v0.16.5.9)

⚠️ Backup before upgrading. If you don’t see the latest updates, please refresh or clear your browser cache.
⚠️ Android App – Google Play closed testing URL has changed. Refer to the updated link in the Wiki.
⚠️ Though you don't need to immediately upgrade, in the upcoming months the Postgres upgrade will be mandated.
Have caution. Below guide might have flaws. Research yourself before performing the upgrade.
<https://codewithcj.github.io/SparkyFitness/install/postgres-upgrade>

💙 Support SparkyFitness

Support development if you find SparkyFitness useful — Approximately $250 in remaining project expenses.

<!-- Release notes generated using configuration in .github/release.yml at v0.16.5.9 -->

##### What's Changed

##### Features

- feat(994): goal tracking reports by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1206](CodeWithCJ/SparkyFitness#1206)
- feat: imroved reports for nutrition data by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1212](CodeWithCJ/SparkyFitness#1212)

##### Fixes

- fix: auto labeling for mistakenly adds bug label by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1207](CodeWithCJ/SparkyFitness#1207)
- fix(1211): unused api endpoints by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1213](CodeWithCJ/SparkyFitness#1213)

##### Other Changes

- App Workout Timer by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1143](CodeWithCJ/SparkyFitness#1143)
- feat(781): meal calorie distribution for custom meals by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1145](CodeWithCJ/SparkyFitness#1145)
- fix: food unit conversion behavior for compatible and incompatible variants by [@&#8203;BryceKrispiess](https://github.com/BryceKrispiess) in [#&#8203;1148](CodeWithCJ/SparkyFitness#1148)
- feat(566): reorder nutrients by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1149](CodeWithCJ/SparkyFitness#1149)
- feat(839): add averages to reports by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1150](CodeWithCJ/SparkyFitness#1150)
- fix(1151, 1045): wger serch doesn't respect language and endpoints are deprecated by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1152](CodeWithCJ/SparkyFitness#1152)
- Smoother App Animations by [@&#8203;BryceKrispiess](https://github.com/BryceKrispiess) in [#&#8203;1155](CodeWithCJ/SparkyFitness#1155)
- feat: refresh dashboard and other tabs after sync automatically by [@&#8203;BryceKrispiess](https://github.com/BryceKrispiess) in [#&#8203;1159](CodeWithCJ/SparkyFitness#1159)
- Feat: Additional app haptics by [@&#8203;BryceKrispiess](https://github.com/BryceKrispiess) in [#&#8203;1161](CodeWithCJ/SparkyFitness#1161)
- fix(1156): secret file not working anymore by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1163](CodeWithCJ/SparkyFitness#1163)
- iOS Home Screen Widget by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1157](CodeWithCJ/SparkyFitness#1157)
- feat: improve ui for exercises and support cardio and isometric types by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1164](CodeWithCJ/SparkyFitness#1164)
- fix(1158): garmin activity sync fail by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1166](CodeWithCJ/SparkyFitness#1166)
- fix(1165): execute preflight checks before server startup by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1167](CodeWithCJ/SparkyFitness#1167)
- feat: app logs rework and expansion  by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1168](CodeWithCJ/SparkyFitness#1168)
- fix: exercises add from external and public workout presets by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1171](CodeWithCJ/SparkyFitness#1171)
- fix(1169): focus for input unit keeps resetting while typing by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1172](CodeWithCJ/SparkyFitness#1172)
- fix(1139): filter active calories from workout reports by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1175](CodeWithCJ/SparkyFitness#1175)
- feat(1080): add bundled postgresql resources to helm chart by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1178](CodeWithCJ/SparkyFitness#1178)
- feat(702): support for custom uploads and backup location by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1179](CodeWithCJ/SparkyFitness#1179)
- feat: improved ui for exercise entries by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1181](CodeWithCJ/SparkyFitness#1181)
- feat(1044): equivalent variants for foods by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1182](CodeWithCJ/SparkyFitness#1182)
- feat: app: change workouts tab to library by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1183](CodeWithCJ/SparkyFitness#1183)
- fix: add sheet spacing after modal sheet by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1189](CodeWithCJ/SparkyFitness#1189)
- fix(1180): recalc sleep after merge by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1190](CodeWithCJ/SparkyFitness#1190)
- App meal creation support by [@&#8203;BryceKrispiess](https://github.com/BryceKrispiess) in [#&#8203;1195](CodeWithCJ/SparkyFitness#1195)
- Fix(1187): misleading placement of height input by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1191](CodeWithCJ/SparkyFitness#1191)
- fix: backup doesn't work with 18.3 due to old image version by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1192](CodeWithCJ/SparkyFitness#1192)
- feat: standardize tables to allow universal filtering, pagination, bulk actions and match the UI by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1196](CodeWithCJ/SparkyFitness#1196)
- App Android Widget by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1198](CodeWithCJ/SparkyFitness#1198)
- App Meal Nutrition + UI Tweaks by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1194](CodeWithCJ/SparkyFitness#1194)
- feat: improve changelog creation and auto label pr's by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1146](CodeWithCJ/SparkyFitness#1146)
- feat: mobile nutrient display and entry details by [@&#8203;apedley](https://github.com/apedley) in [#&#8203;1205](CodeWithCJ/SparkyFitness#1205)
- feat: saving selected date to search parameters and improve calendar UI by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1209](CodeWithCJ/SparkyFitness#1209)
- fix: pr validation workflow duplicate variable by [@&#8203;Sim-sat](https://github.com/Sim-sat) in [#&#8203;1210](CodeWithCJ/SparkyFitness#1210)

**Full Changelog**: <CodeWithCJ/SparkyFitness@v0.16.5.8...v0.16.5.9>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/315
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.

2 participants