Skip to content

feat(polls): votes-by-choice drawer, notification consolidation, and poll card improvements#367

Open
dmnyc wants to merge 3 commits into
mainfrom
feat/polls-votes-by-choice
Open

feat(polls): votes-by-choice drawer, notification consolidation, and poll card improvements#367
dmnyc wants to merge 3 commits into
mainfrom
feat/polls-votes-by-choice

Conversation

@dmnyc

@dmnyc dmnyc commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Notification consolidation: poll-vote notifications fold into a single row per poll (keyed poll-votes:<pollId>), preventing eviction from the 500-item buffer. Row shows per-choice tally; voter count no longer scales with slots used.
  • Votes-by-choice drawer: expandable DisclosureGroup tabs 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.
  • Notification row: consolidated rows show "N votes on your poll" (not a single voter's name), hide the misleading actor avatar, and display the poll question above the choice breakdown.
  • Summary bar: adds scrollable votes filter icon (chart.bar) in the correct position (after DMs); bar is now horizontally scrollable to accommodate all 7 filter types.
  • Poll card footer: shows "X days/hours/minutes left", "∞ left" for no-expiry polls, "Poll ended" when closed. Poll author always sees the results view (bypasses the hasVoted gate).
  • Votes drawer contrast: detail text (counts/percentages) promoted to .primary; disclosure chevron toned down to .secondary.

Test plan

  • Notifications tab: poll-vote row shows "N votes on your poll" with no avatar and choice breakdown below the question
  • Votes filter in summary bar is visible and tappable; bar scrolls horizontally
  • Tapping votes filter isolates poll rows; tapping again restores all
  • Opening a poll thread: author sees bar-graph results view immediately (without having voted)
  • Poll footer shows correct time remaining for timed polls; "∞ left" for open-ended polls
  • Expanding the note details panel on a poll shows per-choice voter breakdown

Screenshots

simulator_screenshot_6D6BAA5C-464A-4290-859E-CC01C2E45916 simulator_screenshot_E1332AFD-D634-49F5-823E-767BBB35EE0D

dmnyc added 3 commits June 12, 2026 22:42
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
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.

1 participant