Enhance My Recitation Collection functionality - #733
Conversation
- Added support for 'myRecitationCollection' navigation source in appRouterProvider. - Updated navigation context to include language for recitation items. - Implemented completion tracking for chants in My Recitation Collection, allowing users to mark chants as completed. - Introduced MyRecitationCompletionService to handle chant completion requests during reading. - Updated UI components to reflect completion state and language for recitation items. - Refactored related models and providers to support new features and ensure consistency across the application.
|
| Filename | Overview |
|---|---|
| lib/features/reader/presentation/screens/reader_screen.dart | Adds initialization-time personal chant completion, causing displayed chants to be recorded before the user advances or finishes. |
| lib/features/reader/domain/services/navigation_service.dart | Adds personal collection navigation and adjacent language propagation, but incorrectly inherits the previous item's language when the destination language is null. |
| lib/features/practice/presentation/providers/my_recitation_completion_service.dart | Adds container-scoped request coordination and deduplication for personal collection completion. |
| lib/features/practice/presentation/providers/my_recitation_collections_providers.dart | Adds per-collection loading, submission, error, and completed-ID state. |
| lib/features/practice/presentation/screens/my_recitation_collection_screen.dart | Builds ordered reader context, enables collection reading, and displays completion status. |
| lib/features/practice/data/datasource/my_recitation_collections_remote_datasource.dart | Adds authenticated today-completion and chant-completion endpoint calls with duplicate handling. |
| lib/features/reader/data/models/navigation_context.dart | Adds the personal collection source and per-item language metadata throughout PlanTextItem value semantics. |
Sequence Diagram
sequenceDiagram
participant U as User
participant C as Collection screen
participant R as Reader
participant N as Navigation
participant P as Completion provider
participant API as Completion API
U->>C: Open chant
C->>R: Push reader with collection context
R->>P: Complete displayed chant on initialization
P->>API: POST chant completion
U->>R: Swipe next
R->>P: Complete current chant
R->>N: Navigate adjacent
N->>R: Replace reader with next chant
R->>P: Complete next chant on initialization
Prompt To Fix All With AI
### Issue 1
lib/features/reader/presentation/screens/reader_screen.dart:132-136
**Reader Open Completes Chants**
When a user opens a personal-collection chant or swipes onto an adjacent one, reader initialization calls `completeCurrent`, causing the newly displayed chant to be recorded as complete before the user advances or finishes it.
### Issue 2
lib/features/reader/domain/services/navigation_service.dart:57
**Previous Language Leaks Forward**
When an adjacent personal-collection item has no language, this fallback assigns the previous item's language, causing the reader to resolve the destination chant in the wrong language instead of using the configured content-language behavior.
```suggestion
language: adjacentText.language,
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Enhance My Recitation Collection functio..." | Re-trigger Greptile
- Introduced a new API endpoint to fetch the completion days count for a specific recitation collection. - Updated MyRecitationCollectionsRemoteDatasource to include the new method for fetching completion days. - Added MyRecitationCollectionCompletionDaysCountResponse model to handle the response from the new API. - Enhanced MyRecitationCollectionsRepository to integrate the new completion days count functionality. - Modified MyRecitationCollectionCompletionState to track if a chant has been completed in the current session. - Updated MyRecitationCollectionScreen to show a completion sheet when all chants are completed, displaying the total days count. - Refactored related UI components to accommodate the new completion tracking logic and ensure a seamless user experience.
… from ReaderScreen to streamline code and improve maintainability.
this branch consists the functionality of checkbox marking. integrated with backend. and number of days streak completed.
for each button such as add to practice and bookmarks and share i will make a new branch.