Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5c5e8b237
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (b) => b.completedAt != null && b.completedAt!.isAfter(range.start) && b.completedAt!.isBefore(range.end), | ||
| ) | ||
| .length; | ||
| return _dataStore!.activityTotals(range.start, range.end).finishedBooks; |
There was a problem hiding this comment.
Preserve pre-ledger completion history in statistics
When an existing user upgrades, their completed books only have Book.completedAt; this change introduces no migration or synthetic completion activities for them. Replacing the previous completedAt query with ledger-only finishedBooks therefore makes Statistics report zero completed books—and zero in the monthly breakdown—until each book is completed again. Backfill the ledger or retain a fallback for books without a corresponding completion activity.
Useful? React with 👍 / 👎.
| bool _checkingTracking = false; | ||
| Future<void> _prepareTracking() async { | ||
| final library = _activeLibrary; | ||
| if (_checkingTracking || library.trackingSupported) return; |
There was a problem hiding this comment.
Re-evaluate tracking support after a server downgrade
If tracking was enabled and the active server is then rolled back before a reconnect, this early return prevents capability discovery from ever observing the downgrade. supportsTracking consequently remains true, so the connector sends tracking-table CRUD to the older server instead of staging it; rejection of that batch can also prevent ordinary queued library writes behind it from uploading until the client is restarted. Reconnects need to refresh both positive and negative capability state.
AGENTS.md reference: AGENTS.md:L27-L30
Useful? React with 👍 / 👎.
| final updated = finished | ||
| ? book.copyWith(readingStatus: LibraryReadingStatus.completed, completedAt: end) | ||
| : correcting?.kind == 'completion' | ||
| ? book.copyWith(readingStatus: LibraryReadingStatus.inProgress, clearCompletedAt: true) |
There was a problem hiding this comment.
Keep a book completed when correcting one duplicate completion
When a book has multiple effective completion records—for example, it was marked finished on two devices—and one completion is corrected into an unfinished reading entry, this branch always changes the book to inProgress even though another completion still contributes to the ledger. That leaves library status inconsistent with goals and statistics; use the same remaining-completion check already present in reverseActivity before clearing completion.
Useful? React with 👍 / 👎.
Summary
Replace in-memory goals and example sessions with a profile-scoped reading ledger. Reader checkpoints persist offline, goal progress derives from eligible activity, and Dashboard/Statistics use the same source. Calendar periods, recurrence, pauses, corrections, explicit completion/undo, overlap deduplication, and book/page coverage preserve inspectable history.
Overview now groups goals by progress: In progress, Not started, Completed, and Paused. A compact filter hides completed goals. Overview and Activity are swipeable, with the same tab height and collection-page spacing as the rest of the app. Desktop actions sit beside the tabs; phones use compact Log reading and a New goal FAB. Activity groups book/day entries and provides a full-width heatmap, filters, and expandable goal history.
Creation defaults to Daily, with an editable target, recurrence, library/shelf/multiple-book scope, and searchable book selection. A books-finished target cannot exceed the selected book count. Goal and activity detail sheets use compact summaries, book covers/authors, fixed footers, and readable multiline inputs. Activity expansion state has distinct saved-state keys from scroll offsets, fixing the crash when revisiting archived history. Time details show eligible duration after creation cutoffs and overlapping logs.
Validation
Screenshots
Desktop Overview
Activity
Goal creation
Mobile Overview
Compatibility and delivery
Reader revision remains pinned to
bc617deeaf2ae684f20c1000ed7cd52f9a61d0a7. Server tracking capability version 2 addsbook_ids; single-book/library goals retain version-1 payloads. Unsupported multi-book uploads remain staged so ordinary library synchronization continues. Existing additive migration/publication/PowerSync setup must be deployed before the integrated client release.Versions remain unchanged. Target
development; coordinate server #12, reader #5, and workspace #13. Scheduled reminders and composite challenges remain follow-up work.