vocdoni / votecaster

A farcaster frame for voting with Vocdoni a.k.a. Votecaster
https://votecaster.io
GNU Affero General Public License v3.0
7 stars 1 forks source link

Allow more than 4 choices on polls #172

Open elboletaire opened 1 month ago

elboletaire commented 1 month ago

This is a complicated issue and it requires adding pagination to our polls due to the farcaster limitation of 4 buttons.

Since we can only show 4 buttons on screen, allowing more than 4 choices forces us to use a button to get to the next page of choices. The first page could always show 3 choices (the 4th would be the next button); subsequent pages may have a maximum of two or three choices, depending on the total amount of choices. So if we have a poll with 6 choices, we'd have two different frames to render the choices:

Frame1:

Frame2:

If we have anything over 6 choices, note intermediate pages will require a "next" and "previous" buttons, limiting the total number of choices/buttons to two.

Note this limitation also limits what we're rendering on screen: the first frame would only show options A, B, C, while the second frame would be showing D, E and F options (both rendered and as butttons).

The changes are mostly backend changes, but the frontend will probably require changes too, since the letters are currently hardcoded based on the question index (and it's limited up to the letter F if I recall correctly).

Also, since we would not be limiting the maximum number of choices, in this flow scenario may be a good idea to have a "confirmation frame", showing you exactly the option you did chose with a confirm and a back button (i.e. You selected D: Choice 4, with the action buttons)