|
| 1 | +# Implementation Plan |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This implementation plan breaks down the advanced reader features into discrete, actionable coding tasks. Tasks are ordered by priority: reliability features first (Auto-Chapter Repair, Smart Source Switching), followed by AI enhancements, reading experience improvements, lifecycle management, visual enhancements, and monetization features. Each task builds incrementally on previous work. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Tasks |
| 10 | + |
| 11 | +- [ ] 1. Implement Auto-Chapter Repair System |
| 12 | + - Create `ChapterHealthChecker` class with detection logic for broken chapters (word count < 50, empty content, scrambled text) |
| 13 | + - Implement `AutoRepairChapterUseCase` to search all installed sources for working chapter replacements |
| 14 | + - Add `ChapterHealth` database table and repository methods for tracking broken chapters |
| 15 | + - Integrate health checking into `ReaderViewModel.loadChapter()` method |
| 16 | + - Create repair banner UI component that displays when broken chapter is detected |
| 17 | + - Add caching mechanism to avoid repeated repair attempts (24-hour cache) |
| 18 | + - _Requirements: 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9_ |
| 19 | + |
| 20 | +- [ ] 2. Implement Smart Source Switching |
| 21 | + - Create `CheckSourceAvailabilityUseCase` to compare chapter counts across installed sources |
| 22 | + - Implement `SourceComparison` data model and caching repository (24-hour TTL) |
| 23 | + - Add background source checking when user opens novel detail page |
| 24 | + - Create `SourceSwitchingBanner` composable with "Switch" and "Dismiss" buttons |
| 25 | + - Implement `MigrateToSourceUseCase` to handle source migration with progress tracking |
| 26 | + - Add dismiss logic that prevents banner from showing again for 7 days |
| 27 | + - Wire banner into `NovelDetailScreen` and `ReaderScreen` |
| 28 | + - _Requirements: 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9_ |
| 29 | + |
| 30 | + |
| 31 | +- [ ] 4. Implement True Read-Along TTS |
| 32 | + - Create `TTSReadAlongManager` class to handle word boundary callbacks from TTS engine |
| 33 | + - Implement word highlighting logic using `AnnotatedString` with background color spans |
| 34 | + - Build `ReadAlongText` composable that highlights current word being spoken |
| 35 | + - Add auto-scroll logic with `TTSAutoScroller` class to keep current word visible |
| 36 | + - Implement user scroll detection to pause auto-scrolling for 5 seconds |
| 37 | + - Add tap-to-jump functionality allowing users to tap a word to jump TTS playback |
| 38 | + - Integrate with existing TTS service and handle platform differences (Android/Desktop) |
| 39 | + - _Requirements: 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7_ |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +- [ ] 6. Implement Reading Break Reminder System |
| 44 | + - Create `ReadingTimerManager` class with start, pause, resume, and reset methods |
| 45 | + - Add reading break interval preference to settings (30, 45, 60, 90, 120 minutes) |
| 46 | + - Implement timer logic that tracks continuous reading time |
| 47 | + - Create `ReadingBreakReminderDialog` with "Take a Break" and "Continue Reading" buttons |
| 48 | + - Add timer state persistence to handle app restarts |
| 49 | + - Implement sentence boundary detection to avoid interrupting mid-sentence |
| 50 | + - Wire timer into `ReaderViewModel` lifecycle (start on chapter open, pause on close) |
| 51 | + - Add auto-dismiss logic (15 seconds) if user doesn't respond to reminder |
| 52 | + - _Requirements: 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8_ |
| 53 | + |
| 54 | +- [ ] 7. Implement Resume Last Read Feature |
| 55 | + - Create `GetLastReadNovelUseCase` that queries reading history for most recent chapter |
| 56 | + - Implement `LastReadInfo` data model with novel details, chapter info, and progress |
| 57 | + - Build `ResumeReadingCard` composable with cover image, title, chapter, and progress bar |
| 58 | + - Add card to top of `LibraryScreen` with one-tap navigation to last read chapter |
| 59 | + - Implement logic to hide card when no reading history exists |
| 60 | + - Add automatic update when user finishes a chapter to show next chapter |
| 61 | + - Handle novel switching to always show most recently read novel |
| 62 | + - _Requirements: 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7_ |
| 63 | + |
| 64 | +- [ ] 8. Implement End of Life Management - Archive |
| 65 | + - Create `ArchiveNovelUseCase` to move completed novels to archived category |
| 66 | + - Add "Archived" category to database and category management system |
| 67 | + - Implement `EndOfLifeOptionsDialog` that appears when user marks novel as completed |
| 68 | + - Add "Show Archived" toggle to library settings |
| 69 | + - Create visual indicator (badge/icon) for archived novels |
| 70 | + - Implement "Unarchive" functionality to restore novels to original category |
| 71 | + - Wire dialog into novel detail screen's "Mark as Completed" action |
| 72 | + - _Requirements: 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7_ |
| 73 | + |
| 74 | +- [ ] 9. Implement End of Life Management - ePub Export |
| 75 | + - Create `EpubGenerator` class to build ePub file structure (META-INF, OEBPS, mimetype) |
| 76 | + - Implement HTML content cleaning to remove scripts, styles, ads, and watermarks |
| 77 | + - Build `ExportNovelAsEpubUseCase` to fetch all chapters and generate ePub |
| 78 | + - Add ePub metadata generation (title, author, cover, table of contents) |
| 79 | + - Implement chapter-to-XHTML conversion with proper formatting |
| 80 | + - Create toc.ncx file for navigation |
| 81 | + - Add file picker integration to save ePub to user-selected location |
| 82 | + - Show progress dialog during export with chapter count progress |
| 83 | + - _Requirements: 15.1, 15.2, 15.3, 15.4, 15.5, 15.6, 15.7, 15.8, 15.9, 15.10_ |
| 84 | + |
| 85 | + |
| 86 | +- [ ] 11. Implement Cryptocurrency Donation Page |
| 87 | + - Create `DonationScreen` composable with wallet addresses for Bitcoin, Ethereum, Litecoin |
| 88 | + - Add QR code generation for each wallet address using ZXing library |
| 89 | + - Implement copy-to-clipboard functionality with toast confirmation |
| 90 | + - Build explanation section describing why donations are needed (server costs, APIs, development) |
| 91 | + - Add navigation from Settings to DonationScreen via "Support Development" menu item |
| 92 | + - Create wallet address configuration in app constants or remote config |
| 93 | + - Implement QR code enlargement on tap for easier scanning |
| 94 | + - Add cryptocurrency disclaimer about non-refundable donations |
| 95 | + - _Requirements: 18.1, 18.2, 18.3, 18.4, 18.5, 18.6, 18.7, 18.8_ |
| 96 | + |
| 97 | +- [ ] 12. Implement Donation Trigger System |
| 98 | + - Create `DonationTrigger` sealed class for different trigger events |
| 99 | + - Implement `DonationTriggerManager` to check for trigger conditions |
| 100 | + - Add trigger detection for book completion (500+ chapters) |
| 101 | + - Add trigger detection for first successful source migration |
| 102 | + - Add trigger detection for chapter milestones (every 1,000 chapters) |
| 103 | + - Create `DonationPromptDialog` with contextual messages for each trigger |
| 104 | + - Implement 30-day cooldown between prompts to avoid spam |
| 105 | + - Add "Donate Now" and "Maybe Later" buttons with proper navigation |
| 106 | + - Store last prompt time in preferences to enforce cooldown |
| 107 | + - _Requirements: 19.1, 19.2, 19.3, 19.4, 19.5, 19.6, 19.7, 19.8, 19.9_ |
| 108 | + |
| 109 | +- [ ] 13. Implement Cryptocurrency Wallet Integration |
| 110 | + - Create `WalletIntegrationManager` class for deep link handling |
| 111 | + - Implement deep links for Trust Wallet, MetaMask, and Coinbase Wallet |
| 112 | + - Add "Pay with [Wallet]" buttons to donation screen for each supported wallet |
| 113 | + - Implement wallet app detection and "not installed" error handling |
| 114 | + - Create payment URI generation for cryptocurrency addresses |
| 115 | + - Add QR code display for desktop users to scan with mobile wallets |
| 116 | + - Implement hover tooltips with scanning instructions |
| 117 | + - Handle ActivityNotFoundException gracefully with user-friendly messages |
| 118 | + - _Requirements: 20.1, 20.2, 20.3, 20.4, 20.5, 20.6, 20.7_ |
| 119 | + |
| 120 | +- [ ] 14. Implement Fund-a-Feature Progress System |
| 121 | + - Create `FundingGoal` data model with title, description, target, and current amount |
| 122 | + - Build `FundaFeatureSection` composable with progress bar and goal description |
| 123 | + - Add funding goal configuration (monthly server costs, feature-specific goals) |
| 124 | + - Implement progress bar UI showing current/target with percentage |
| 125 | + - Add "Goal Reached!" state when target is met |
| 126 | + - Create automatic goal rollover for monthly recurring goals |
| 127 | + - Implement goal detail dialog showing feature description and funding purpose |
| 128 | + - Add manual goal update mechanism (admin-controlled or remote config) |
| 129 | + - _Requirements: 21.1, 21.2, 21.3, 21.4, 21.5, 21.6, 21.7, 21.8_ |
| 130 | + |
| 131 | +- [ ] 15. Implement Supporter Badge Verification |
| 132 | + - Create `SupporterBadgeVerificationDialog` with TXID and User ID input fields |
| 133 | + - Implement `SubmitSupporterVerificationUseCase` to send data to Supabase |
| 134 | + - Add "I've donated! Get my badge" button to donation screen |
| 135 | + - Create Supabase table for verification submissions with pending status |
| 136 | + - Build verification form validation (non-empty fields, valid format) |
| 137 | + - Implement submission success message with 24-hour review timeline |
| 138 | + - Add error handling for network failures and invalid submissions |
| 139 | + - Create instructions showing where to find User ID in About page |
| 140 | + - _Requirements: 22.1, 22.2, 22.3, 22.4, 22.5, 22.6, 22.7_ |
| 141 | + |
| 142 | +- [ ] 16. Implement Supporter Badge Display and Features |
| 143 | + - Create `SupporterStatus` data model with isSupporter flag and tier |
| 144 | + - Add `is_supporter` field to user profile in Supabase |
| 145 | + - Implement supporter status sync from Supabase on app launch |
| 146 | + - Add 💖 supporter icon next to username in About section |
| 147 | + - Display "Supporter" badge on user reviews and comments |
| 148 | + - Create "Supporter Themes" section in Appearance settings |
| 149 | + - Implement 3-5 exclusive supporter themes (Gold, Platinum, Diamond) |
| 150 | + - Add "Supporter since [Date]" label to user profile |
| 151 | + - Implement theme locking/unlocking based on supporter status |
| 152 | + - _Requirements: 23.1, 23.2, 23.3, 23.4, 23.5, 23.6, 23.7, 24.1, 24.2, 24.3, 24.4, 24.5, 24.6, 24.7_ |
| 153 | + |
| 154 | +- [ ] 17. Add Feature Flags and Configuration |
| 155 | + - Create `FeatureFlags` object with toggles for all new features |
| 156 | + - Implement remote config integration for feature flag control |
| 157 | + - Add feature flag checks before showing new UI components |
| 158 | + - Create admin interface or config file for flag management |
| 159 | + - Implement gradual rollout capability for risky features (voice commands) |
| 160 | + - Add analytics events for feature usage tracking |
| 161 | + - _Requirements: All_ |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | +- [ ] 20. Create Settings and Configuration UI |
| 167 | + - Add "Reading Break Reminder" toggle and interval selector to Reader settings |
| 168 | + - Implement "Enable Dynamic Theme" toggle in Appearance settings |
| 169 | + - Add "Support Development" menu item to main Settings screen |
| 170 | + - Create glossary management screen accessible from Reader settings |
| 171 | + - Add "Show Archived" toggle to Library settings |
| 172 | + - Implement test interface for voice commands |
| 173 | + - _Requirements: 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 11.1, 11.2, 17.7_ |
| 174 | + |
| 175 | +- [ ] 21. Database Migrations and Schema Updates |
| 176 | + - Create migration for `ChapterHealth` table |
| 177 | + - Create migration for `SourceComparisonCache` table |
| 178 | + - Create migration for `GlossaryEntry` table |
| 179 | + - Create migration for `ReadingTimerState` table |
| 180 | + - Create migration for `SupporterStatus` table |
| 181 | + - Add indexes for performance optimization |
| 182 | + - Implement migration rollback procedures |
| 183 | + - Test migrations on existing databases |
| 184 | + - _Requirements: All database-related_ |
| 185 | + |
| 186 | +- [ ] 22. Platform-Specific Implementations |
| 187 | + - Implement Android-specific TTS word boundary callbacks |
| 188 | + - Create Desktop TTS implementation with word timing estimation |
| 189 | + - Add Android deep link handling for wallet apps |
| 190 | + - Implement Desktop QR code display for wallet integration |
| 191 | + - _Requirements: All platform-specific requirements_ |
| 192 | + |
| 193 | +- [ ] 23. Integration and Wiring |
| 194 | + - Wire `ChapterHealthChecker` into `ReaderViewModel.loadChapter()` |
| 195 | + - Integrate `CheckSourceAvailabilityUseCase` into `NovelDetailScreen` |
| 196 | + - Add glossary context menu to reader long-press handler |
| 197 | + - Wire `TTSReadAlongManager` into existing TTS service |
| 198 | + - Integrate `VoiceCommandManager` with TTS activation |
| 199 | + - Add `ReadingTimerManager` to `ReaderViewModel` lifecycle |
| 200 | + - Wire `EndOfLifeOptionsDialog` into "Mark as Completed" action |
| 201 | + - Integrate `DonationTriggerManager` into relevant user events |
| 202 | + - Connect all use cases to repositories via Koin DI |
| 203 | + - _Requirements: All integration requirements_ |
| 204 | + |
| 205 | +--- |
| 206 | + |
| 207 | +## Notes |
| 208 | + |
| 209 | +- Tasks are ordered by priority: reliability → AI → reading experience → lifecycle → visual → monetization |
| 210 | +- Each task includes specific implementation details and references to requirements |
| 211 | +- Testing tasks are marked as optional (*) to focus on core functionality first |
| 212 | +- Platform-specific implementations should be tested on both Android and Desktop |
| 213 | +- Feature flags allow for gradual rollout and easy rollback if needed |
| 214 | +- Caching and performance optimizations are critical for good user experience |
| 215 | +- Error handling should be comprehensive with user-friendly messages |
| 216 | +- Documentation is essential for user adoption and developer maintenance |
0 commit comments