BUG: still cant reorder exercises on plan v1.18 playstore #190

Closed
opened 2023-11-12 17:31:23 +00:00 by nutpants · 4 comments

v1.18 play store ( since it updates a lot more often )
when ever i try to reorder the exercices on a plan it tries to go back to the orginal

i have about 10 exercises for a full body plan
i have no days checked
i move chest press to top and push save
i go out of plans and back into it and edit
and the order is alphabetical again
when i try to move two exercises, the first moved to top will jump down in the list sometimes over top another one

so the problems are.
it always goes back to alphabetical order each time trying to edit
cannot move two or more items ( the items jump around or overlap)

I was able to sort my list if i moved everything very very slowly and carefully.
if i wanted to change anything later it starts alphabetical and you have to start sorting scratch the next time.

v1.18 play store ( since it updates a lot more often ) when ever i try to reorder the exercices on a plan it tries to go back to the orginal i have about 10 exercises for a full body plan i have no days checked i move chest press to top and push save i go out of plans and back into it and edit and the order is alphabetical again when i try to move two exercises, the first moved to top will jump down in the list sometimes over top another one so the problems are. it always goes back to alphabetical order each time trying to edit cannot move two or more items ( the items jump around or overlap) I was able to sort my list if i moved everything very very slowly and carefully. if i wanted to change anything later it starts alphabetical and you have to start sorting scratch the next time.
nutpants changed title from BUG: still cant reorder exercises on plan to BUG: still cant reorder exercises on plan v1.8 playstore 2023-11-12 17:35:57 +00:00
nutpants changed title from BUG: still cant reorder exercises on plan v1.8 playstore to BUG: still cant reorder exercises on plan v1.18 playstore 2023-11-12 17:36:20 +00:00
brandon.presley added the
bug
label 2023-11-13 00:58:42 +00:00

It sounds silly but this feature is actually quite hard to accomplish.

  1. Exercises do end up being re-ordered in the StartPlan page just not the next time you open up EditPlan
  2. The exercise list when it is saved is a copy of the names of sets, which means we have to maintain this copy of names (in case of future changes)
  3. If we were to save this re-ordered list of exercises somewhere, that too would need to be maintained on future changes
  4. All of the above was done because I didn't want to make a proper one-to-many relationship with plans and gym sets, so i could easily filter on the exercises field with a simple LIKE clause

Every now and again I think about refactoring all of this to be a proper one-to-many relationship, but I find it to be quite tedious. Especially the database migrations where I have to loop through plan exercises and create these entities.

It sounds silly but this feature is actually quite hard to accomplish. 1. Exercises do end up being re-ordered in the StartPlan page just not the next time you open up EditPlan 2. The exercise list when it is saved is a copy of the names of sets, which means we have to maintain this copy of names (in case of future changes) 3. If we were to save this re-ordered list of exercises somewhere, that too would need to be maintained on future changes 4. All of the above was done because I didn't want to make a proper one-to-many relationship with plans and gym sets, so i could easily filter on the `exercises` field with a simple `LIKE` clause Every now and again I think about refactoring all of this to be a proper one-to-many relationship, but I find it to be quite tedious. Especially the database migrations where I have to loop through plan exercises and create these entities.

The plan entity code looks like this:

import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("plans")
export class Plan {
  @PrimaryGeneratedColumn()
  id: number;

  @Column("text")
  days: string;

  @Column("text")
  exercises: string;

  @Column("text")
  title: string | null;
}

Where an example entry would be like: days="Monday,Tuesday,Wednesday";exercises="Bench press,Bicep curls,Ab crunches"

The plan entity code looks like this: ```ts import { Column, Entity, PrimaryGeneratedColumn } from "typeorm"; @Entity("plans") export class Plan { @PrimaryGeneratedColumn() id: number; @Column("text") days: string; @Column("text") exercises: string; @Column("text") title: string | null; } ``` Where an example entry would be like: `days="Monday,Tuesday,Wednesday";exercises="Bench press,Bicep curls,Ab crunches"`
Author

I understand.
It does make it quite a night mare for anyone who changed their workout or even added an exercise. They would have to sort everything from scratch.

Would it be hard to link plans? Then you could build multiple plans for each body part (which would have less exercises each) and you could link multiple plans for each days total workout.

I understand. It does make it quite a night mare for anyone who changed their workout or even added an exercise. They would have to sort everything from scratch. Would it be hard to link plans? Then you could build multiple plans for each body part (which would have less exercises each) and you could link multiple plans for each days total workout.

Honestly I'm not sure it's worth trying to do this draggable re-ordering because every library I try (there aren't very many to begin with) are buggy. Maybe I should just have buttons to move things up and downwards

Honestly I'm not sure it's worth trying to do this draggable re-ordering because every library I try (there aren't very many to begin with) are buggy. Maybe I should just have buttons to move things up and downwards
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: brandon.presley/Massive#190
No description provided.