Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Change vote" permission clashes with multiple vote polls #76

Closed
dsevillamartin opened this issue Jul 12, 2023 · 7 comments · Fixed by #78
Closed

"Change vote" permission clashes with multiple vote polls #76

dsevillamartin opened this issue Jul 12, 2023 · 7 comments · Fixed by #78
Labels
bug Something isn't working

Comments

@dsevillamartin
Copy link
Member

If a user doesn't have permission to change votes in a poll, they cannot vote for multiple options. They'll get a permission denied error.

One way to solve this would be to have a grace period for editing, like post editing. This would be a bit trickier tho because a user could always just unvote all options, and all track of their actions would be gone (as the rows in poll_votes would be gone).
To avoid that, if a user cannot change their vote, this leeway period could be only for adding more votes. For example, if a user doesn't have permission to change votes, they have ~5 minutes to add more options.

I'm more leaning towards this: for multiple choice, no change permission polls specifically: change to UI where user presses "submit" after selecting the options they're voting for. Worse UX, but only appears in this scenario. Maintaining two different UIs is not ideal, but I don't think its that much extra stuff.

It'd still be maybe a good idea to add a setting for a change vote timer. The problem with it is that as soon as there's one vote, the results are shown. Waiting for this timer to run out to show the votes would also be scuffed and not ideal though. Since that's the way it currently is, I don't think that should be taken into consideration when implementing this.


In short:

  • press "submit" button for multiple vote polls if user doesn't have change vote permission to allow voting for multiple options
  • add setting to allow changing vote only before X minutes pass since the last vote change
    • adjust multiple vote handler logic to attempt to modify existing rows instead of always deleting & creating
    • use updated_at column
@dsevillamartin dsevillamartin added the bug Something isn't working label Jul 12, 2023
@Wlork
Copy link

Wlork commented Jul 19, 2023

Hello @dsevillamartin :)

I really appreciate to choose answers directly, without clicking on buttons. Especially on mobile, we don't have to scroll up or down to find a button or whatever.

First, I'd like to ask you a few questions :

It's not possible to create a permission for multiple choice ?
Or add an option that allows or blocks the change of vote, rather than making it a general permission ?

@dsevillamartin
Copy link
Member Author

dsevillamartin commented Jul 19, 2023

It's not possible to create a permission for multiple choice ?

@Wlork This wouldn't solve any issues though. What does it mean that a user can't change their vote in a poll where multiple choices are allowed? If they're not allowed to change votes, they'd still have the issue of only being able to select one answer.

Or add an option that allows or blocks the change of vote, rather than making it a general permission ?

Again, this doesn't really fix anything. The problem is not how the permission is set up, the problem is that if the user is not supposed to be able to change votes, how to still allow them to choose multiple options in a poll that allows them to do so without preventing them past the first option they vote for.

@Wlork
Copy link

Wlork commented Jul 19, 2023

@dsevillamartin

In that case, if the only solution, or at least the most efficient, is to put a button to submit, I think we'll have to put it for all options.

Create an option to enable or disable vote changes

  • If you choose to block, whether you choose one choice or multiple choice, a "Submit" button appears at the bottom of the poll.
  • If you choose to allow, polls remain as they are now, without buttons

I think this makes it more consistent. One UX for vote change and another for no vote change.
The UX will be worse for no vote change, but in the end, members will be better informed when they are not allowed to change their votes.

I don't know if I've made myself clear ?

@dsevillamartin
Copy link
Member Author

@Wlork That is essentially what I suggested. Everything stays the same except polls that allow multiple votes get a submit button. And in addition to that, introducing a setting for permission to change vote that handles how much time can pass before user can no longer adjust votes (like rename 10 min after creating discussion).

@Wlork
Copy link

Wlork commented Jul 20, 2023

@dsevillamartin

Yes, I understood that, but I've written another proposal which is close to your idea :)

  • Replace the change vote permission by an option that to enable or disable vote changes
    This allows members to choose.

  • Put the "Submit" button if the vote change is disabled by the poll creator, whatever the number of choices chosen (and not only for multiple choice).

I think this would simplify some things and make UX a bit more coherent :) If possible, if you're agree, of course.

@dsevillamartin
Copy link
Member Author

@Wlork I don't think I want to remove the permission for vote changes. It might be a good idea to add the option to individual polls as well (user must have perm to change vote AND poll must allow vote changes). This option is not required for the submit changes though.

@Wlork
Copy link

Wlork commented Jul 20, 2023

I don't think I want to remove the permission for vote changes. It might be a good idea to add the option to individual polls as well (user must have perm to change vote AND poll must allow vote changes).

OK, I didn't know these two settings could work together :)

This option is not required for the submit changes though.

Yes, this option would be there just to allow members to choose. I know this has nothing to do with the original issue, I made this proposal to make the vote change more complete :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants