Skip to content

feat: redesign goals with durable reading tracking - #40

Open
Eoic wants to merge 4 commits into
developmentfrom
feat/goals-redesign
Open

Eoic wants to merge 4 commits into
developmentfrom
feat/goals-redesign

Conversation

@Eoic

@Eoic Eoic commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

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

  • Latest full client suite: 1,598 passed, 19 skipped.
  • Client formatting, analysis, four web-bootstrap tests, and the production web build passed.
  • Latest focused Goals/activity run: 25 passed; final page spacing run: 21 passed.
  • Chrome review covered desktop/mobile presentation, creation, archived history, expansion, and tab restoration. Screenshots below use isolated synthetic fixtures.
  • Shared Dart/server aggregation fixtures and SQLite regressions cover multi-book scopes, creation cutoffs, overlap, corrections, ownership, profile isolation, and older-server staging.
  • Earlier real EPUB/PDF Android and Chromium integration evidence remains recorded in tracking documentation. Real multi-device PowerSync transport remains unverified.

Screenshots

Desktop Overview

Desktop Overview

Activity

Activity heatmap and filters

Goal creation

Daily goal with editable target

Mobile Overview

Mobile Overview with compact toolbar and New goal FAB

Compatibility and delivery

Reader revision remains pinned to bc617deeaf2ae684f20c1000ed7cd52f9a61d0a7. Server tracking capability version 2 adds book_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.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T14:41:45.552493Z a5c5e8b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +292 to +295
final updated = finished
? book.copyWith(readingStatus: LibraryReadingStatus.completed, completedAt: end)
: correcting?.kind == 'completion'
? book.copyWith(readingStatus: LibraryReadingStatus.inProgress, clearCompletedAt: true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Eoic Eoic self-assigned this Oct 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants