zulip / zulip-flutter

Upcoming Zulip mobile apps for Android and iOS, using Flutter
Apache License 2.0
183 stars 174 forks source link

polls: Read-only support #165

Closed gnprice closed 1 month ago

gnprice commented 1 year ago

As a first step of poll support (#164), we should render poll messages.

For product context, see https://zulip.com/help/create-a-poll .

For details of this part of the API… unfortunately this is one of the few remaining parts of the Zulip API that is effectively undocumented, and one has to resort to reverse-engineering. Two useful resources for reference are:

gnprice commented 1 year ago

Ideally the information we show here would match what's in Zulip web: in particular for each option it'd show the number of votes and also the list of people who voted for it.

Currently zulip-mobile actually shows less than that:

I think it's probably just about as easy to go ahead and show that information, when we're working on this issue, as to not do so. In that case we should go ahead and show it.

(I think when we added poll support in zulip-mobile I may have been concerned that the list of voters would be too big to comfortably view in the message, the way web does it, on a mobile-size screen. A more mobile-optimized alternative would be to have the list on a separate screen, similar to the list of people who reacted on a message. But given that we never followed up by building that second screen and the interaction to get to it, it would have been better in retrospect to go ahead with the perhaps-unwieldy inline list of voters.)

gnprice commented 5 months ago

A small extra implementation note:

There are some ancient messages (2019-01 and earlier) on at least chat.zulip.org which use a different variation of the polls API, which was changed while the feature was still experimental before it was released. When we see such a message, we should just reject it without trying to parse it further.

Specifically that variation involves new_comment rather than new_option. Details at: