Add comprehensive poll support with full accessibility

Features:
- Poll creation in compose dialog with up to 4 options, single/multiple choice, expiration times
- Accessible poll discovery with keyboard navigation (Enter to vote on polls in timeline)
- Poll voting dialog with radio buttons/checkboxes and proper focus management
- Poll results display using navigable list widget for accessibility
- Real-time poll validation and error handling
- Updated README with complete poll documentation

Technical improvements:
- Added poll endpoints to ActivityPub client (create_poll, vote_in_poll)
- Extended Post model with poll data fields and accessibility methods
- Enhanced timeline view with Enter key handling for poll interaction
- Simplified radio button implementation following doom launcher patterns
- Fixed undefined variable bug in poll info generation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Storm Dragon
2025-07-21 01:19:46 -04:00
parent cf240e1aa5
commit 014f288524
7 changed files with 517 additions and 9 deletions

View File

@ -24,6 +24,7 @@ This project was created through "vibe coding" - a collaborative development app
- **Keyboard Navigation**: Complete keyboard control with intuitive shortcuts
- **Direct Message Interface**: Dedicated conversation view with threading support
- **Bookmarks**: Save and view bookmarked posts in a dedicated timeline
- **Poll Support**: Create, vote in, and view results of fediverse polls with full accessibility
## Audio System
@ -45,6 +46,7 @@ Bifrost includes a sophisticated sound system with:
- **Real-time Character Count**: Visual feedback with limit warnings
- **Content Warnings**: Optional spoiler text support
- **Visibility Controls**: Public, Unlisted, Followers-only, or Direct messages
- **Poll Creation**: Add polls with up to 4 options, single or multiple choice, with expiration times
## Technology Stack
@ -81,7 +83,7 @@ Bifrost includes a sophisticated sound system with:
- **Arrow Keys**: Navigate through posts
- **Page Up/Down**: Jump multiple posts
- **Home/End**: Go to first/last post
- **Enter**: Expand/collapse threads
- **Enter**: Expand/collapse threads, or vote in polls
- **Tab**: Move between interface elements
### Compose Dialog
@ -113,6 +115,37 @@ sudo pacman -S python-pyside6 python-requests python-simpleaudio python-emoji
yay -S python-plyer
```
## Poll Features
Bifrost includes comprehensive poll support with full accessibility:
### Creating Polls
- **In Compose Dialog**: Check "Add Poll" to create polls with your posts
- **Up to 4 Options**: Add 2-4 poll options (minimum 2 required)
- **Choice Types**: Single choice (radio buttons) or multiple choice (checkboxes)
- **Expiration**: Set when the poll expires (1 hour to 30 days)
- **Real-time Validation**: Get immediate feedback on poll requirements
### Voting in Polls
- **Accessible Discovery**: Polls announced as "Poll: X options, Y votes, press Enter to vote"
- **Keyboard Voting**: Use Tab and arrow keys to navigate options, Space to select
- **Radio Button Groups**: Single choice polls use accessible radio button navigation
- **Checkbox Lists**: Multiple choice polls use standard checkbox interaction
- **Vote Submission**: Submit votes with accessible button controls
### Viewing Results
- **Automatic Display**: Results shown immediately after voting or for expired polls
- **Navigable List**: Vote counts and percentages in an accessible list widget
- **Arrow Key Navigation**: Review each option's results individually
- **Clear Information**: Format like "Option 1: 5 votes (41.7%)"
### Poll Accessibility Features
- **Screen Reader Support**: Full compatibility with Orca, NVDA, and other screen readers
- **Keyboard Only**: Complete functionality without mouse interaction
- **Clear Announcements**: Descriptive text for poll status and options
- **Focus Management**: Proper tab order and focus placement
- **Error Handling**: Accessible feedback for voting errors (duplicate votes, etc.)
## Accessibility Features
- Complete keyboard navigation
@ -120,6 +153,7 @@ yay -S python-plyer
- Focus management and tab order
- Accessible names and descriptions for all controls
- Thread expansion/collapse with audio feedback
- Poll creation and voting with full accessibility support
## Sound Pack Creation and Installation