flutter icon indicating copy to clipboard operation
flutter copied to clipboard

Improve variations widget for new exercises

Open rolandgeider opened this issue 3 years ago • 12 comments

The variations widget used to inform the user that the exercise might already exist in the database needs a bit of polishing so that it works like the one used in the web application:

  • [ ] allow to filter the list by name
  • [ ] group exercises that are together so that it's clear that they form a "group"
  • [ ] add the missing info text

Flutter version

image

Web version: image

rolandgeider avatar Oct 10 '22 14:10 rolandgeider

I wish to contribute to this problem kindly allow me to work on this issue.

Arnav2001 avatar Oct 13 '22 16:10 Arnav2001

It's yours @Arnav2001

rolandgeider avatar Oct 13 '22 18:10 rolandgeider

The help text at the bottom is "If you notice an exercise that is identical to the one you're adding, please discard your draft and edit that exercise instead.", on the search box "enter exercise name to filter variations"

rolandgeider avatar Oct 13 '22 18:10 rolandgeider

ok, thank you for allowing me

Arnav2001 avatar Oct 13 '22 19:10 Arnav2001

no problem man, if you have any questions or anything, just write me

rolandgeider avatar Oct 13 '22 19:10 rolandgeider

I am facing few difficulties to understand this issue need your guidance.

  1. You want me to add a filter to select by name in this variations part
  2. For second task, should I make group having name and then they will expand and show variations, for example:- variation section will have groups of different variations and then after opening those groups we will find main variation (variation section -> group -> variations ) can I make it in this way.
  3. In last task what do you exactly mean by missing info text? Is this a text which I should add at last of variations just like we see others when there is no match in list

Arnav2001 avatar Oct 13 '22 19:10 Arnav2001

  1. exactly
  2. Yes, so exercises can have variations (like e.g. curls with dumbbells, curls with barbell, curls on the machine, etc.) and when the user adds a new exercise, it should be possible to add it to one of the existing groups. That is this whole widget. All the exercises that are variations of each other are then one group which the user should be able to select. These groups can contain from two or three to more than a dozen exercises, so we can't just show the images for all of them, in the react app we show the first three images and can expand the list with the name of the exercises
  3. I meant the info text at the bottom next to the button, I hadn't noticed that I had posted a screnshot in German

rolandgeider avatar Oct 13 '22 19:10 rolandgeider

image

  1. Please guide me from where I can retrieve list of variations UI wise it is complete need to add functionality
  2. will be working on this soon
  3. Is this what you want? kindly check in above image

any suggestions?

Arnav2001 avatar Oct 14 '22 10:10 Arnav2001

Any response ?

Arnav2001 avatar Oct 15 '22 02:10 Arnav2001

  1. There are two lists for this, the exercises that already have variations (those groups we were talking about) and exercises which currently don't belong to any group. In the widget you can see how they are retrieved, the lines with ...exerciseProvider.exerciseBasesByVariation.keys and ...exerciseProvider.bases (we sadly need to differentiate between them because the logic in the backend is different, but you only need to change the UI for the exercises with variations)
  2. sure, not problem!
  3. yes, that's great

rolandgeider avatar Oct 15 '22 09:10 rolandgeider

  1. So do I need to add filter functionality too or just need to add it in UI.
  2. Can you please explain more that how can I group them like on what basis and from where should I retrieve that data.
  3. completed

Arnav2001 avatar Oct 17 '22 15:10 Arnav2001

Implementing the actual filtering filtering would be great, yes

As for grouping, I would just take the first n images (depending on how this would be presented, we don't have so much space as on the web version), you can just use the getMainImage getter on exercisebase. And besides that some amount of names so that the user can get an idea of what kind of exercises are. In the react version we show the first 5 plus some ... to indicate that there are more, if the user hovers over the ellipsis, the list expands completely (while this would be nice to have, just showing the first 5 or so, again, depending on the design, would be enoug)

rolandgeider avatar Oct 18 '22 13:10 rolandgeider