Support polls (read-only)
Stacked on top of #823.
Fixes: #165
For ease of cross-reference: the previous PR #823 originally contained these changes too, and had a round of UX review starting with these screenshots: https://github.com/zulip/zulip-flutter/pull/823#issuecomment-2266101540
Moving this to integration review because these changes went through maintainer review in the original PR.
Thanks for the review @gnprice! I have addressed them and updated the PR.
Partially updated. The tests reorganization is WIP.
The tests from "Message.poll" are rewritten in two destinations. Here's a broad overview:
-
"new message with initial submessages" under "handleMessageEvent":
Contains all the "parse poll" tests. Rewritten so that we handle new
MessageEvents for polls. Because these tests are about processing the initial state of the message, there is noSubmessageEvents to handle. -
"handleSubmessageEvent":
Contains all the "applyEvent" tests. Each of them got moved to the corresponding
PollEventSubmessageTypegroup.
Extra note: dropped the "no poll if submessages is empty" test because it is a duplicate of the existing "message has no submessages" test.
I have updated the PR. In this update:
- added some tests back to the commit that introduces
Poll, before moving them later; - rearrange test grouping.
Pushed a minor formatting update.
Thanks for the revision! Those changes all look good. All the commits before the last one are now ready, so I'm going to go ahead and merge them.
I won't make it to a review of the last commit today, though, before I go on vacation: 798f1b36f poll: Support read-only poll widget UI.
So please send that as a fresh PR. Let's also have @chrisbobbe do the first review on that — I know a similar commit was in #823 which he reviewed before, but it's been a bit of a marathon series of changes :slightly_smiling_face: (which is natural because this is a complex feature), so he may have new comments to make when looking at it with fresh eyes.