So my night of planned backlog items and bugs for https://trackmylift.app took a bit of a U-turn when I ventured down a rabbit hole with a few bugs I found. However, the resulting outcome is amazing 🔥💪
As simplicity is key with my app, there's alot of functionality in behind the scenes to allow the powerful features to exist with a simplistic, user friendly UI in mind.
I ran into a few bugs which I had to iron out. As you'll see in the little sample video below of this screen, I allow the user to add sets through the incremental and decremental buttons, or by user input in the text box.
I render the set rows (reps and weight) based on objects in an array. So this is where the problem came in.
What I implemented;
if backspace in sets input, don't take it as an action, as it would be taken as a zero (0) and all rows would be removed. Instead, await the next input.
if the amount of sets entered is less than the amount of sets in the main array then 'pop' the difference out of the array.
if it's more then 'push' the difference into the array.
don't allow zeros (0) to be entered if the input value is 0.
Each action also updates the main sets array for the workout which triggers the re render.
I've also added a nice touch where the new row scrolls into view if it's out of view (longer than the max height property).
I'm so excited to release https://trackmylift.app 🔥💪⏳