forked from akai/readest
f361698e05
* feat(android): add D-pad navigation for Android TV remote controller Add basic D-pad/arrow key navigation support for Android TV Bluetooth remote controllers, covering the full flow: library grid browsing, reader page turning, toolbar interaction, and TTS toggle. Library: - Custom spatial navigation hook for grid D-pad navigation - Arrow keys move between BookshelfItem elements with auto column detection - ArrowDown from header enters the bookshelf grid Reader: - Enter key toggles header/footer toolbar visibility - Left/Right navigate between toolbar buttons, Up/Down moves between header and footer bars - Back button dismisses toolbar (with blur) before sidebar/library - Focus-probe technique for reliable button visibility detection across fixed/hidden containers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: only auto-focus toolbar buttons on keyboard activation, not mouse hover Track pointer activity to distinguish keyboard vs mouse toolbar activation. When the toolbar appears due to mouse hover, skip auto-focus to prevent unwanted focus outlines on desktop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: track keyboard events instead of pointer events for auto-focus guard Pointer events from iframes don't bubble to the main document, so tracking pointermove/pointerdown missed hover interactions over book content. Track keydown instead — auto-focus only when a recent keyboard event (Enter key) triggered the toolbar, not mouse hover. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.1 KiB
2.1 KiB
Readest Project Memory
Key Reference Documents
- Bug Fixing Patterns - Common bug categories, root causes, and fix strategies
- CSS & Style Fixes - EPUB CSS override patterns and the style.ts pipeline
- TTS Fixes - Text-to-Speech architecture and bug patterns
- Layout & UI Fixes - Safe insets, z-index, platform-specific UI issues
- Platform Compat Fixes - Android, iOS, Linux, macOS platform-specific bugs
- Annotator & Reader Fixes - Highlight, selection, accessibility bugs
Critical Files (Most Bug-Prone)
src/utils/style.ts- Central EPUB CSS transformation hub (14+ bug fixes)packages/foliate-js/paginator.js- Page layout, image sizing, backgroundssrc/services/tts/TTSController.ts- TTS state machine, section trackingsrc/hooks/useSafeAreaInsets.ts- Safe area inset managementsrc/app/reader/components/FoliateViewer.tsx- Reader view orchestrationsrc/app/reader/components/annotator/Annotator.tsx- Annotation lifecycle
Feature Notes
- D-pad Navigation — Android TV remote / keyboard arrow navigation design, key files, and pitfalls
Architecture Notes
- foliate-js is a git submodule at
packages/foliate-js/ - Multiview paginator: loads adjacent sections in background, multiple View/Overlayer instances per book
- Style overrides:
getLayoutStyles()(always),getColorStyles()(when overriding color) transformStylesheet()does regex-based EPUB CSS rewriting at load time- TTS uses independent section tracking (
#ttsSectionIndex) decoupled from view - Safe area insets flow: Native plugin -> useSafeAreaInsets hook -> component styles
- Dropdown menus use
DropdownContext(not blur-based) for screen reader compat
Workflow
- Always rebase before PR — rebase onto origin/main before creating PRs
- New branch per PR — always create a fresh branch from main for each new PR/issue
- Upgrade gstack locally — always upgrade from the project's .claude/skills/gstack, not global