Summary
The report page shows recommended exercises with a + button. Currently the button navigates to Bibliotek, which closes the analysis and forces the user to re-upload photos to get recommendations again. The + button should instead save the exercise directly to the exercise library in the background, with inline confirmation, so the user never leaves the report page.
Priority
Medium
UI spec (Carbon g100)
- Pressing
+ on a recommendation row calls the existing addLibraryExercise (or equivalent) Supabase insert in the background
- On success: button changes to a checkmark icon (
Checkmark from @carbon/icons-react), disabled, for ~2 s then stays as checkmark (grayed out) to signal already saved
- On duplicate (exercise name already exists in library): show the checkmark immediately — treat as success, not error
- On error: show a brief inline
InlineNotification kind="error" at the top of the recommendation section; button returns to +
- No navigation away from the report page
- No modal or confirmation dialog — one-tap save
Data model
No schema changes. Uses the existing exercise_library table and addLibraryExercise function in db.js.
The saved exercise should use the recommended exercise name and its primary/secondary muscle arrays. default_sets and default_reps can be left null (user can fill in Bibliotek later).
Acceptance criteria
Out of scope
- Editing sets/reps inline before saving
- Saving all recommendations at once
- Navigating to Bibliotek after save
Summary
The report page shows recommended exercises with a
+button. Currently the button navigates to Bibliotek, which closes the analysis and forces the user to re-upload photos to get recommendations again. The+button should instead save the exercise directly to the exercise library in the background, with inline confirmation, so the user never leaves the report page.Priority
Medium
UI spec (Carbon g100)
+on a recommendation row calls the existingaddLibraryExercise(or equivalent) Supabase insert in the backgroundCheckmarkfrom@carbon/icons-react), disabled, for ~2 s then stays as checkmark (grayed out) to signal already savedInlineNotificationkind="error" at the top of the recommendation section; button returns to+Data model
No schema changes. Uses the existing
exercise_librarytable andaddLibraryExercisefunction indb.js.The saved exercise should use the recommended exercise name and its
primary/secondarymuscle arrays.default_setsanddefault_repscan be left null (user can fill in Bibliotek later).Acceptance criteria
+on a recommendation row saves the exercise toexercise_librarywithout navigating away+on an already-saved exercise shows checkmark immediately (no duplicate insert, no error)Out of scope