feat(polls): votes-by-choice drawer, notification consolidation, and poll card improvements#367
Open
dmnyc wants to merge 3 commits into
Open
feat(polls): votes-by-choice drawer, notification consolidation, and poll card improvements#367dmnyc wants to merge 3 commits into
dmnyc wants to merge 3 commits into
Conversation
Group a poll's voters under their chosen option in the expandable note details panel. Each choice renders as an expandable tab showing its tally and, when expanded, the voters who picked it (with zap amounts for kind 6969 zap polls). Choices are ordered by tally descending. - Expose PollVoteBreakdown from PollTallyRepository (per-option voter lists) - Render the Votes section in NoteDetailsPanel with DisclosureGroup tabs - Fetch voter profiles on panel appear
Poll-vote notifications were one row per vote, so they got evicted out of the 500-item flat buffer as newer notifications arrived — "results disappear after a while". Fold every vote on a poll into a single consolidated row (keyed poll-votes:<pollId>, latest-wins per voter) that shows the per-choice tally. One slot per poll means it no longer evicts itself, and the breakdown stays visible. - Aggregate voters per poll in FlatNotificationItem.pollVotes with pollVoteCounts / pollVoterCount helpers - Route .pollVote through mergePollVote in the repository - Cache the user's poll events so active-poll choice labels resolve - Row shows "N votes" badge + per-choice counts
…mprovements - Add votes filter icon to notification summary bar (scrollable HStack, ordered Replies/Reactions/Zaps/Reposts/Mentions/DMs/Votes) - Consolidated poll rows (>1 voter): show "N votes on your poll" instead of a single actor name; hide the misleading voter avatar - Show poll question above the per-choice breakdown in notification rows - Poll card: poll author always sees results view (bypasses hasVoted gate) - Poll card footer: "X days/hours/minutes left", "∞ left" for no-expiry, "Poll ended" when closed - Votes drawer: detail text (.primary) and chevron (.secondary) contrast fixes - Fix missing pollEvent: param in PostCardView NoteDetailsPanel call - Fix @escaping on voteTab content closure for DisclosureGroup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
poll-votes:<pollId>), preventing eviction from the 500-item buffer. Row shows per-choice tally; voter count no longer scales with slots used.DisclosureGrouptabs in the note details panel show each choice with its voter count and percentage, and expand to list individual voters. Choices ordered by tally descending.hasVotedgate)..primary; disclosure chevron toned down to.secondary.Test plan
Screenshots