Skip to content

Conversation

@olorin99
Copy link
Contributor

@olorin99 olorin99 commented Dec 2, 2025

Adds support for piefed polls.

  • Show poll posts with button to toggle whether results are shown.
  • Vote on posts. Seems like it is a limitation on piefed that you can't change a vote for single choice polls and you can't remove a vote for multichoice polls.
  • Create polls. Can add options, set the poll mode and set the duration of the poll.

I don't believe the polls API has made it to stable yet so polls only work on crust.piefed.social for now.

- Show poll posts.
- Vote on posts.
- Create posts.
Copy link
Member

@jwr1 jwr1 left a comment

Choose a reason for hiding this comment

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

Looks pretty cool! Do you have any information on when the API will be moved to stable?

@jwr1
Copy link
Member

jwr1 commented Dec 3, 2025

Seems like it is a limitation on piefed that you can't change a vote for single choice polls and you can't remove a vote for multichoice polls.

That's an interesting limitation, especially if you can add a choice to multi choice polls but not remove one.

@olorin99
Copy link
Contributor Author

olorin99 commented Dec 4, 2025

Looks pretty cool! Do you have any information on when the API will be moved to stable?

The poll API is part of version 1.4. Looks like they're about halfway through the planned issues https://codeberg.org/rimu/pyfedi/projects/24034. 22 done, 2 doing and 21 todo, but the PieFed folks move fast so not sure what the expected timeline is for that.

Only submit poll votes on press of submit button.
Prevent poll submission when not logged in.
Change poll mode to switch.
@olorin99
Copy link
Contributor Author

olorin99 commented Dec 4, 2025

I changed it slightly so that now the user can change their choices until they press submit. Then after submission the radio/check boxes will be disabled so the user can't interact any more. Hopefully this will be less confusing than being able to check choices and not being able to uncheck them.

Also results aren't available until the user has submitted.

On a guest account the poll should act like it's been submitted already. So the user can't select choices but the results are available.

# Conflicts:
#	lib/src/models/post.dart
#	lib/src/widgets/content_item/content_item.dart
@olorin99 olorin99 requested a review from jwr1 December 4, 2025 12:34
Copy link
Member

@jwr1 jwr1 left a comment

Choose a reason for hiding this comment

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

Thank you! We can go ahead and merge this. I don't think people will have any issue using it with an older PieFed server as long as they don't try to create a poll just yet.

@jwr1 jwr1 merged commit 3a1d83f into main Dec 4, 2025
2 checks passed
@jwr1 jwr1 deleted the polls branch December 4, 2025 16:28
@olorin99 olorin99 mentioned this pull request Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants