GideonNeedleman / 5x5

0 stars 0 forks source link

Refactor programData to not contain entire workout, just id reference #117

Closed GideonNeedleman closed 7 months ago

GideonNeedleman commented 7 months ago

Current programData contains entire workout and exercise data. Should only reference the workout. Smaller data size.

GideonNeedleman commented 7 months ago

Refactored programData should be an array of programs. Each program will have following properties:

workouts is an array of integers. Each integer is the id of a workout in workoutData. next holds a single integer as value. This references the index of workouts array that is the next workout to be done. Used for highlighting workoutButton on home screen with variant = 'primary'

This refactor will affect many things. From rendering programCard to handling how workouts are ended and next flag is incremented, to how programs are created & edited. Also if I implement rearranging workouts within edit program, then will need logic to correctly change next. This is a large breaking change, but it's the correct data structure.