boolder-org / boolder-android

Boolder Android app https://www.boolder.com/en/app
MIT License
28 stars 12 forks source link

Variants #20

Closed nmondollot closed 1 year ago

nmondollot commented 1 year ago

Display a button to see the list of variants of a problem. When the user taps on a variant name, go to the variant.

What is a variant?

A variant is a problem that is very similar to an existing problem but has a slight difference (sit start, line going slightly left or right, forbidden hold, ...).

A problem can have zero, one, or multiple variants. One problem is considered as the parent problem, and the other problems as children, using the parent_id column of the problems table (see https://github.com/boolder-org/boolder-data for more info). Note: to make it simpler, a child cannot have another child.

When showing variants of a problem, we don't care about who is parent and who is child, we just want to show all the variants of the same "family".

Demo iOS

https://github.com/boolder-org/boolder-android/assets/330823/bc7f23b6-437a-484c-815c-20c7da1f4c54

iOS code

https://github.com/boolder-org/boolder-ios/blob/b418c9d55501a911de4b49b6b2a8b8d51ae2c403/Boolder/UI/Map/Problem%20details/ProblemDetailsView.swift#L221-L251

https://github.com/boolder-org/boolder-ios/blob/b418c9d55501a911de4b49b6b2a8b8d51ae2c403/Boolder/Models/Problem.swift#L67-L78

https://github.com/boolder-org/boolder-ios/blob/b418c9d55501a911de4b49b6b2a8b8d51ae2c403/Boolder/Models/Problem.swift#L225-L244