Fix context menu accessibility, conversation replies, and integrate polls into post details
This commit addresses several critical accessibility and functionality issues: - Fix context menu keyboard shortcuts (Applications key and Shift+F10) in messages tab - Resolve 404 errors when replying to private message conversations by implementing separate conversation reply handling - Restore Enter key functionality for viewing post details - Integrate poll voting into post details dialog as first tab instead of separate dialog - Fix accessibility issues with poll display using QTextEdit and accessible list patterns - Add comprehensive accessibility guidelines to CLAUDE.md covering widget choices, list patterns, and context menu support - Update README.md with new features including context menu shortcuts, poll integration, and accessibility improvements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
81
CLAUDE.md
81
CLAUDE.md
@ -14,6 +14,7 @@ Bifrost is a fully accessible fediverse client built with PySide6, designed spec
|
||||
2. **UI Event Handlers**: Avoid circular event chains (A triggers B which triggers A)
|
||||
3. **Timeline Operations**: Coordinate refresh calls and state changes to prevent conflicts
|
||||
4. **Lifecycle Events**: Ensure shutdown, close, and quit events don't overlap
|
||||
4. **Design**: Ensure single point of truth is used as much as possible through out the code. This means functionality should not be duplicated across files.
|
||||
|
||||
### Required Patterns for Event-Heavy Operations
|
||||
|
||||
@ -611,4 +612,82 @@ Examples of forbidden practices:
|
||||
- Shortened usernames or descriptions
|
||||
- Abbreviated profile information
|
||||
|
||||
This document serves as the comprehensive development guide for Bifrost, ensuring all accessibility, functionality, and architectural decisions are preserved and can be referenced throughout development.
|
||||
### Screen Reader Accessibility Guidelines
|
||||
|
||||
#### Widget Choice and Layout
|
||||
**DO:**
|
||||
- Use `QTextEdit` (read-only) for all text content that needs to be accessible
|
||||
- Use `QListWidget` with fake header items for navigable lists
|
||||
- Set proper `setAccessibleName()` on all interactive widgets
|
||||
- Enable keyboard navigation with `Qt.TextSelectableByKeyboard`
|
||||
|
||||
**DON'T:**
|
||||
- Use `QLabel` for important information - screen readers often skip labels
|
||||
- Use disabled `QCheckBox` or `QRadioButton` widgets - they get skipped
|
||||
- Create single-item lists without fake headers - they're hard to navigate
|
||||
|
||||
#### Accessible List Pattern
|
||||
For any list that users need to navigate (polls, favorites, boosts):
|
||||
```python
|
||||
list_widget = QListWidget()
|
||||
list_widget.setAccessibleName("Descriptive List Name")
|
||||
|
||||
# Add fake header for single-item navigation
|
||||
fake_header = QListWidgetItem("List title:")
|
||||
fake_header.setFlags(Qt.ItemIsEnabled) # Not selectable
|
||||
list_widget.addItem(fake_header)
|
||||
|
||||
# Add actual items
|
||||
for item in items:
|
||||
list_item = QListWidgetItem(item_text)
|
||||
list_item.setData(Qt.UserRole, item_data)
|
||||
list_widget.addItem(list_item)
|
||||
```
|
||||
|
||||
#### Context Menu Accessibility
|
||||
**Required keyboard shortcuts for context menus:**
|
||||
- Applications key (`Qt.Key_Menu`)
|
||||
- Shift+F10 (`Qt.Key_F10` with `Qt.ShiftModifier`)
|
||||
|
||||
Both must trigger: `self.customContextMenuRequested.emit(center)`
|
||||
|
||||
#### Interactive vs Display Content
|
||||
**For expired/completed interactive elements (polls, forms):**
|
||||
- Replace disabled controls with accessible display lists
|
||||
- Show results using the accessible list pattern
|
||||
- Never leave users with disabled widgets they can't interact with
|
||||
|
||||
**For live interactive elements:**
|
||||
- Use standard Qt controls (`QCheckBox`, `QRadioButton`, `QPushButton`)
|
||||
- Ensure all controls have meaningful `setAccessibleName()`
|
||||
- Provide clear feedback for actions
|
||||
|
||||
#### Information Display Priority
|
||||
**All important information must be in accessible widgets:**
|
||||
1. **Primary location:** `QTextEdit` (read-only, keyboard selectable)
|
||||
2. **Secondary location:** `QListWidget` items
|
||||
3. **Never primary:** `QLabel` widgets (often skipped)
|
||||
|
||||
**Example of accessible content display:**
|
||||
```python
|
||||
content_text = QTextEdit()
|
||||
content_text.setAccessibleName("Full Post Details")
|
||||
content_text.setPlainText(f"Author: @{username}\n\nContent:\n{post_content}\n\nMetadata:\n{details}")
|
||||
content_text.setReadOnly(True)
|
||||
content_text.setTextInteractionFlags(Qt.TextSelectableByKeyboard | Qt.TextSelectableByMouse)
|
||||
```
|
||||
|
||||
#### Dialog and Tab Design
|
||||
**Avoid content duplication:**
|
||||
- Don't show the same information in multiple places
|
||||
- Use tabs to organize different types of information
|
||||
- Keep essential stats/counts at the top level
|
||||
- Put detailed content in dedicated tabs
|
||||
|
||||
**Tab organization example:**
|
||||
- Statistics: Brief counts at dialog top
|
||||
- Poll tab: Interactive voting or accessible results list
|
||||
- Content tab: Full post details in accessible text widget
|
||||
- Interaction tabs: Who favorited/boosted in accessible lists
|
||||
|
||||
This document serves as the comprehensive development guide for Bifrost, ensuring all accessibility, functionality, and architectural decisions are preserved and can be referenced throughout development.
|
||||
|
Reference in New Issue
Block a user