Repository: IgnisDa/ryot (language: rust)

Issue:
[Bug] When completing a set in a second exercise in a superset, screen scrolls back to the first exercise, instead of the next one
In general superset can contain more than two exercises.

Reproducible on container image: `ghcr.io/ignisda/ryot:sha-465fb16`

## Repro steps

1. Create new workout
2. Add **three or more** different exercises
3. Add two or more sets to each of the exercises
4. Remove timers from all sets
5. Create a superset from all the exercises
6. Complete first set in the first exercise
   * the screen scrolls to the second exercise 🆗 
7. Complete first set in the second exercise

## Actual result

Screen scrolls to the first exercise.

## Expected result

Screen scrolls down to the next exercise.


Discussion / hints:

Fix patch:
diff --git a/apps/frontend/app/components/fitness.tsx b/apps/frontend/app/components/fitness.tsx
index a53d89f06b..ee5c370946 100644
--- a/apps/frontend/app/components/fitness.tsx
+++ b/apps/frontend/app/components/fitness.tsx
@@ -264,7 +264,7 @@ export const ExerciseHistory = (props: {
 		<Paper
 			p="xs"
 			withBorder
-			id={props.exerciseIdx.toString()}
+			id={`exercise-history-${props.exerciseIdx}`}
 			style={{
 				borderLeftWidth: isInSuperset ? "3px" : undefined,
 				borderLeftColor: isInSuperset
@@ -293,7 +293,7 @@ export const ExerciseHistory = (props: {
 														entity: "workouts",
 														id: props.entityId,
 													}),
-													props.exerciseIdx.toString(),
+													`exercise-history-${props.exerciseIdx}`,
 												)
 											: getExerciseDetailsPath(exercise.id)
 									}
diff --git a/apps/frontend/app/routes/_dashboard.fitness.exercises.item.$id._index.tsx b/apps/frontend/app/routes/_dashboard.fitness.exercises.item.$id._index.tsx
index e45b8b5bb8..c5e0da9a59 100644
--- a/apps/frontend/app/routes/_dashboard.fitness.exercises.item.$id._index.tsx
+++ b/apps/frontend/app/routes/_dashboard.fitness.exercises.item.$id._index.tsx
@@ -763,7 +763,7 @@ const DisplayPersonalBest = (props: {
 							entity: "workouts",
 							id: props.set.workoutId,
 						}),
-						props.set.exerciseIdx.toString(),
+						`exercise-history-${props.set.exerciseIdx}`,
 					)}
 					fw="bold"
 				>


Test patch: