Skip to content

feat(polls): truncate long polls to 4 options with expand toggle#381

Open
dmnyc wants to merge 1 commit into
mainfrom
feat/poll-option-truncation
Open

feat(polls): truncate long polls to 4 options with expand toggle#381
dmnyc wants to merge 1 commit into
mainfrom
feat/poll-option-truncation

Conversation

@dmnyc

@dmnyc dmnyc commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Polls with more than 4 options now collapse to show just the first 4, matching how long text posts are truncated in the feed
  • A centered "N more options" pill button expands the full list; tapping again collapses back to "Show fewer"
  • Applies to both NIP-88 (kind 1068) standard polls and NIP-69 (kind 6969) zap polls
  • Works in both voting mode (pre-vote) and results mode (post-vote / ended)
  • Multi-choice pending selections in hidden options are preserved across expand/collapse — they count toward the Vote button as normal

Details

PollSection.collapsedOptionCount = 4. The expand toggle is animated (.easeInOut(duration: 0.2)) and uses the same visual style as the "Show more" / "Show less" button on long text posts.

Screenshots

Before
image

After
simulator_screenshot_2A109E5E-A9FF-4429-8CB6-40D9FD32067E

Test plan

  • Open a poll with ≤ 4 options — no truncation, no button
  • Open a poll with > 4 options — first 4 visible, "N more options" button shown
  • Tap "N more options" — all options expand with animation
  • Tap "Show fewer" — collapses back to 4
  • Verify with a zap poll (kind 6969) with > 4 options
  • Verify results mode (after voting or on an ended poll) truncates the same way

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