Reciter List Navigation
The reciter list supports full keyboard navigation for quick browsing:Arrow Keys
Arrow Down
Arrow Down
Action: Move focus to the next reciter in the listBehavior:
- If no item is focused, focuses the first reciter
- If the last item is focused, wraps to the first reciter
- Automatically scrolls the focused item into view
- Smooth scrolling animation for better visual tracking
src/hooks/use-keyboard-navigation.ts:18-23Arrow Up
Arrow Up
Action: Move focus to the previous reciter in the listBehavior:
- If no item is focused, focuses the last reciter
- If the first item is focused, wraps to the last reciter
- Automatically scrolls the focused item into view
- Smooth scrolling animation
src/hooks/use-keyboard-navigation.ts:25-30Escape
Escape
Action: Return focus to the search input fieldBehavior:
- Clears current focus from reciter list
- Focuses the search input at the top of the page
- Allows immediate typing to search for reciters
- Does not close any open menus or modals
src/hooks/use-keyboard-navigation.ts:32-36Keyboard navigation is implemented in
useKeyboardNavigation hook and automatically prevents default browser scrolling behavior for arrow keys.Navigation Features
Auto-Scrolling
When you navigate with arrow keys, the focused reciter automatically scrolls into view:- Smooth: Animated scrolling for better visual tracking
- Block: nearest: Minimal scrolling - only scrolls if item is out of view
- Inline: start: Aligns to the start edge for RTL/LTR support
Focus Management
The keyboard navigation system manages focus state:- Focused Index: Tracks which reciter is currently focused (0-based index or null)
- Reciter Refs: Array of references to reciter button elements
- Search Input Ref: Reference to the search input field for Escape key
Circular Navigation
Arrow key navigation wraps around at list boundaries:- At Bottom: Arrow Down wraps to the first item
- At Top: Arrow Up wraps to the last item
- No Selection: First arrow key focuses appropriate end of list
Circular navigation ensures you can quickly reach any reciter regardless of list length.
Browser Shortcuts
Standard browser keyboard shortcuts also work in Open Tarteel:Fullscreen
| Shortcut | Action |
|---|---|
F11 | Toggle fullscreen mode (Windows/Linux) |
Fn + F11 | Toggle fullscreen mode (macOS) |
Escape | Exit fullscreen mode (all platforms) |
Page Navigation
| Shortcut | Action |
|---|---|
Space | Scroll down one page |
Shift + Space | Scroll up one page |
Home | Scroll to top of page |
End | Scroll to bottom of page |
Page Up | Scroll up one viewport |
Page Down | Scroll down one viewport |
Search and Selection
| Shortcut | Action |
|---|---|
Ctrl/Cmd + F | Open browser’s find-in-page |
Tab | Move focus to next interactive element |
Shift + Tab | Move focus to previous interactive element |
Enter | Activate focused button or link |
Accessibility Features
Keyboard navigation enhances accessibility:Screen Reader Support
- All interactive elements have proper ARIA labels
- Focus changes are announced by screen readers
- Current state (playing, paused, etc.) is accessible
- Button purposes are clearly labeled
Keyboard-Only Operation
The entire app can be operated without a mouse:Visual Focus Indicators
Focused elements display clear visual indicators:- Outline or border on focused interactive elements
- Different styling for keyboard focus vs mouse hover
- High contrast focus indicators for visibility
- Focus rings respect system preferences
Focus indicators follow accessibility guidelines for contrast ratios and visibility.
Implementation Details
Hook: useKeyboardNavigation
Location:src/hooks/use-keyboard-navigation.ts
Parameters:
itemCount: number- Total number of reciters in the list
Event Handling
Keyboard events are handled at the window level:- Works regardless of which element has focus
- Consistent behavior across the entire app
- Properly cleaned up on component unmount
Focus Effects
Focus changes trigger effects to update the UI:- Scrolls focused element into view
- Applies browser focus to the element
- Only runs when focus index changes
Best Practices
Fast Navigation
Use Arrow keys for quick browsing through reciters instead of scrolling and clicking
Quick Search
Press Escape from anywhere to jump to search and filter the list
Fullscreen Focus
Press F11 for fullscreen mode when you want distraction-free listening
Combine Methods
Mix keyboard and mouse navigation - use whatever feels most efficient
Future Shortcuts
While not currently implemented, these shortcuts would enhance the experience:| Proposed Shortcut | Suggested Action |
|---|---|
Space | Play/Pause toggle |
→ (Right Arrow) | Next track (when not in list) |
← (Left Arrow) | Previous track (when not in list) |
M | Mute/unmute volume |
F | Toggle fullscreen |
V | Toggle visualizer |
L | Toggle playlist |
+/- | Increase/decrease volume |
0-9 | Jump to percentage of track |
These shortcuts could be added in future versions. Consider contributing to the project if you’d like to implement them!