Skip to content

feat: Implement Polls - #1129

Open
Speykious wants to merge 74 commits into
fluxerapp:mainfrom
Speykious:polls
Open

feat: Implement Polls#1129
Speykious wants to merge 74 commits into
fluxerapp:mainfrom
Speykious:polls

Conversation

@Speykious

@Speykious Speykious commented Jun 22, 2026

Copy link
Copy Markdown

Implements desktop support for fluxerapp/fluxer-meta#2.

Here's what has been done:

  • modal for poll creation and component for single-answer and multiple-answer poll messages
  • users can create polls and send them, poll messages actually get displayed
  • polls are stored and retrieved correctly from the database at least on postgres
  • message service crate correctly handles poll objects
  • poll schemas & zod
  • SEND_POLLS permission, I guess
  • functioning expiration of polls
  • in the message poll component, a progress-ish bar to represent the percentage of votes in an answer button
  • handle global limits
  • handle polls in optimistic messages
  • server-side safety checks and error codes/messages
  • make sure users cannot edit or forward polls
  • manually end polls
  • Cassandra schema
  • Display polls in the admin panel message lists
  • functioning poll votes
    • handling of MESSAGE_POLL_VOTE_ADD and MESSAGE_POLL_VOTE_REMOVE gateway events
    • extension of MESSAGE_REACTION_ADD and MESSAGE_REACTION_REMOVE gateway events
    • a new table for poll votes
    • fix bad voting state on multi-answer polls
    • API endpoint for fetching users who voted for some answer
    • modal for looking at who voted in polls
  • poll results embed after poll is finalized
  • clean localization in the code
  • adapt design for mobile (responsive)
  • anonymous voting

Since this is my first time touching the codebase, I decided to do simple polls first, and then once the implementation around that is solid, extend the functionality to things beyond Discord's polls, such as attachments, an additional layout (say, grid instead of list), anonymous voting, etc.

I attributed special care in making sure that the API was compatible with Discord's, since that is a somewhat important part of Fluxer's appeal for developers.

As discussed in the Fluxer Developers community with staff, one of the ways my PR will slightly differ from what's specified in the bounty is that I will implement graded voting rather than ranked voting. Both can translate to pretty intuitive interfaces for voting on the poll, but I believe graded voting makes it a lot easier to accept the results of the poll than ranked voting, because users can express the extent to which they like all options a lot better. With ranked voting, users are forced to assume a linearity of preferences, which is very often at odds with what they actually think about the options. That being said, having both graded and ranked as additional ways to organize a poll is also a possibility. (But maybe it would be feature creep? idk)

Note on anonymous voting: it's technically possible for the average user to monitor MESSAGE_REACTION_ADD and MESSAGE_REACTION_REMOVE messages to see who voted on what, because I did not modify anything on that front. The only thing anonymous voting prevents is fetching the list of voters for any answer if you don't have the permission for it.

Screenshots

Screenshots image image image image image image image

As well as a small video of the modal with custom emotes:

fluxer-polls-custom-emotes.mp4

Verification

  • Tests run: yes
  • Manual checks: tested the functionality in dev, with ~1000 fake users

Checklist

  • I understand every change in this PR.
  • I can explain what it does and why it is correct.
  • I disclosed any LLM coding help below.

LLM Disclosure

This PR is entirely vibe-coded; that is, I vibed to Hatsuki Yura and ShibayanRecords while handcrafting everything myself. ;v

Zero LLMs were used in the production of this code.

BrainMade logo

@Kamalaja

Copy link
Copy Markdown
Member

Could we make the outline of the poll Accent Primary while the poll is active, then what you have it afterwards?


Not required for Bounty

  • Bonus points if it acts like a countdown, where the primary accent color disappears starting from the top middle and going around clockwise as the poll gets closer to closing

@Speykious

Copy link
Copy Markdown
Author

hmmm yeah I guess that's not a bad idea

@Speykious

Copy link
Copy Markdown
Author
image image

That should do it for the outline

@ghost ghost added the p:limits label Jun 24, 2026
@Speykious

Copy link
Copy Markdown
Author
image

going out of my way with the styling there

@ghost ghost added the p:errors label Jun 25, 2026
@Speykious

Copy link
Copy Markdown
Author

No feedback on the selected option for screen readers during voting

Let me know what you think of this last commit. I'm wondering if there's a better approach.

@Jiralite
Jiralite self-requested a review July 11, 2026 23:22
#: src/features/auth/components/pages/ResetPasswordPage.tsx:114
msgid "This reset link has expired. Reset links last 1 hour. Please request a new one."
msgstr ""
msgstr "Dieser Link zum Zurücksetzen ist abgelaufen. Solche Links sind nur eine Stunde lang gültig. Bitte fordern Sie einen neuen an."

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

(This was translated using https://translate.kagi.com)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants