Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add multiple choice polls #9519

Closed
wants to merge 15 commits into from

Conversation

owi92
Copy link
Contributor

@owi92 owi92 commented Oct 28, 2022

This PR adds an option to set the maxSelections parameter in the createPollDialog, and allows users to vote for more than one option based on that parameter. Instead of radio buttons, multiple choice polls feature checkboxes, which do however use the same styles as the radio buttons. If maxSelections is greater than 1, an indication telling the user the number of remaining votes is shown. Options can be deselected to vote for another option.
Closes #23319

Bildschirmaufnahme.2022-11-14.um.15.56.13.mov

Signed-off-by: Ole Wieners olewieners@yahoo.com


Here's what your changelog entry will look like:

✨ Features

  • Add multiple choice polls (#9519). Contributed by @owi92.

This adds an option to set the `maxSelections` parameter in the `createPollDialog`
and allows users to vote for more than one answer.
@owi92 owi92 marked this pull request as ready for review November 14, 2022 16:06
@owi92 owi92 requested a review from a team as a code owner November 14, 2022 16:06
@weeman1337 weeman1337 added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Nov 14, 2022
@weeman1337 weeman1337 requested a review from a team November 14, 2022 16:17
@weeman1337
Copy link
Contributor

weeman1337 commented Nov 14, 2022

Thanks for your contribution @owi92 👍

They needs at least a review from design. Probably also from product. When merging this feature for Web it would not be available on the mobile apps. This could lead to a not so nice experience.

Copy link
Contributor

@weeman1337 weeman1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good start. My main point in the code is the StyledPollCheckbox where there is already a StyledCheckbox available and poll uses the StyledRadioButton.

Also found an issue when clicking around: If you have an empty option you can select more available votes than options available.

image

image

Also I think we should cover multi vote polls with Cypress end-2-end tests.

res/css/views/elements/_StyledPollCheckbox.pcss Outdated Show resolved Hide resolved
src/components/views/elements/StyledPollCheckbox.tsx Outdated Show resolved Hide resolved
src/components/views/messages/MPollBody.tsx Show resolved Hide resolved
src/components/views/messages/MPollBody.tsx Outdated Show resolved Hide resolved
src/i18n/strings/en_EN.json Outdated Show resolved Hide resolved
@owi92
Copy link
Contributor Author

owi92 commented Nov 16, 2022

Thank you for the review and suggestions! I believe I have addressed mosty everything with my lates push. I'm still missing the cypress end2end tests but will try to get them done tomorrow.

This adds an option to set the `maxSelections` parameter in the `createPollDialog`
and allows users to vote for more than one answer.
@pree
Copy link

pree commented Mar 13, 2023

Is there something missing for this to get merged?

@daniellekirkwood daniellekirkwood requested a review from a team March 28, 2023 15:20
@daniellekirkwood
Copy link

@jakewb-b It would be great to get your thoughts on this PR as an Enhancement to a feature you're close to. If this is something we want to move ahead with, let's engage with Design (@rufuskahler)

@jakewb-b
Copy link

@daniellekirkwood - definitely keen to have this as a feature; it was on our backlog originally so would be great to have it added. There are some existing designs that @gaelledel did that may cover this as well, so worth getting her and Rufus to take a look.

@rufuskahler
Copy link

@gaelledel – Please advise on the preferred design solution here.

@ggPeti
Copy link

ggPeti commented Sep 19, 2023

+1 would love to have this feature, a team I'm involved in would like to conduct multi-select polls.
Would this only be available in the web client if merged?

@dbkr
Copy link
Member

dbkr commented May 2, 2024

I've been looking at this to try & get it moving forward. I think the main obstacle at the moment is the question of what other clients do in the face of a multiple choice poll, since we'd be launching this feature on element web but not mobile. eg:

  • If on mobile you don't even notice that you could have more votes, that might be ok
  • If you vote lots on web and then view the poll on mobile and it's not accurate, thats a problem

It will also be quite weird if you see other people clearly voting for more than one option, but can't do so yourself, although maybe not the end of the world.

I know other clients have support for this, but it being different in Element on different platforms is more of a problem.

In general, I would advise talking to us before implementing large features like this: they're not trivial to ship, unfortunately.

@dbkr
Copy link
Member

dbkr commented May 9, 2024

I'm going to close this for now. If someone if able to pick up to work of establishing what the experience is, exactly, of having it on web and mobile, we can re-open and continue work on it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for the max_selections poll parameter
10 participants