Skip to content

feature/re read functionality - #115

Merged
codebude merged 25 commits into
developfrom
feature/re-read-functionality
Oct 23, 2026
Merged

codebude merged 25 commits into
developfrom
feature/re-read-functionality

Conversation

@codebude

Copy link
Copy Markdown
Owner
  • Backend: reading sessions/re-reads (issue Feature Request: Support Multiple Reading Sessions / Re-reads per Book #114)
  • Frontend: reading sessions/re-reads UI (issue Feature Request: Support Multiple Reading Sessions / Re-reads per Book #114)
  • Fix migration: omit FK constraint (SQLite does not support ALTER ADD CONSTRAINT)
  • Address code review findings (go-1)
  • Address code review findings (go-2 cross-check)
  • Round-trip reading sessions through JSON export/import
  • Docs: clarify CSV cannot round-trip re-read history
  • Show read count badge on book detail page (from first reread on)
  • Restore timeline pagination (max 40 + load more) and SQL window function for progress/latest
  • Fix restore of older backups (create_all vs migration collision)
  • Docs: backward compatibility for older exports/backups
  • Clear progress log when last reading session is deleted
  • Docs: add regular unreleased v1.11.0 release entry
  • Docs: remove unreleased bug-fix entries; add regression test for progress deletion on session delete
  • Harden route ordering: move timeline endpoint into books router (no cross-router dependency)
  • Fix naive/aware datetime comparison and current-session marking in session round-trip
  • Docs: note progress history is reference-only on export (full fidelity via backup)
  • Fix timeline load-more off-by-one (return total count)
  • Support uploading LibrisLog export ZIP directly to import wizard
  • Revert "Support uploading LibrisLog export ZIP directly to import wizard"
  • Revert "Fix naive/aware datetime comparison and current-session marking in session round-trip"
  • Revert "Round-trip reading sessions through JSON export/import"
  • Revert "Docs: note progress history is reference-only on export (full fidelity via backup)"
  • Revert "Docs: clarify CSV cannot round-trip re-read history"
  • Rollback import/export round-trip changes (sessions/progress)

- Add ReadingSession model + ReadingProgress.session_id
- Alembic migration with per-book backfill
- Session service (mirror, reconcile, read-again, ordinals)
- Sessions router (CRUD, read-again, timeline)
- Session-aware progress and statistics (total_reads, reread_books)
- Export sessions dataset, user deletion, import session creation
- Book detail: Read again action + reading history (add/delete sessions)
- Session-aware progress, read xN badge on cards/list rows
- Timeline one-row-per-completion with reread badge
- Statistics Total reads card, public profile total_reads opt-in
- DateConflictDialog third 'start new read' action
- i18n keys across 5 locales, sessions export dataset
- Fix session 'latest' resolution: order by reading date, not created_at (data-loss)
- Make reconcile idempotent (unrelated PATCH no longer rewrites history)
- Re-mirror book after any session delete; never promote a completed read to current
- Validate session_id on progress create (cross-tenant check)
- pages_read/total_reads no longer require a finish date
- Validate-before-mutate and single-transaction session update/delete
- Skip want_to_read books in migration; create sessions on external-book import
- Drop FK from ReadingProgress.session_id model (matches SQLite migration)
- Conflict dialog keeps keep/use-new actions alongside 'start new read'
- Timeline read-numbers computed once; register-order comment; session edit UI
- Regression tests for all of the above
- Open (currently_reading) sessions never keep a finish date
- pages_wasted scoped to did_not_finish sessions (earlier completions excluded)
- Document sessions export as reference-only (full restore via backup)
- Regression test for open-session finish-date invariant
Embed each book's reading sessions in the JSON book export and reconstruct
them on import, so re-read history survives a data export/import round-trip
instead of collapsing to a single session.

- data_export: embed sessions in books.json (chronological)
- data_import: accept a 'sessions' array field and create sessions from it
- suggest_mapping alias + BOOK_IMPORT_FIELDS entry for 'sessions'
- round-trip test + import-export docs update
_recreate_engine now creates tables directly only for fresh databases; for
older backups (alembic_version row present) it skips create_all and relies
on pending migrations to add new tables/columns. This prevents 'table
reading_session already exists' when restoring a pre-feature backup.
…ssion round-trip

- Use aware datetime.min fallback when sorting sessions (a date-less session
  next to a dated one previously raised TypeError on export/import)
- Mark the most recent open session as current, not the last session overall
Revert the misunderstanding that export/import should round-trip sessions.
Export is for third-party apps; import is for flexible import from third-party
apps. Full fidelity round-trip is via backup/restore (admin section).

- Remove embedded 'sessions' from books.json export
- Remove 'sessions' field from import (BOOK_IMPORT_FIELDS, aliases, mapping)
- Revert _create_sessions_from_data to create_initial_session (single session per book)
- Remove ZIP upload support from parse_upload and data.py
- Remove round-trip regression tests
- Update docs to reflect reference-only sessions dataset
@codebude codebude self-assigned this Oct 22, 2026
@codebude

Copy link
Copy Markdown
Owner Author

This implements #114

@github-actions

Copy link
Copy Markdown

🧪 Test Results — e45e666

✅ Backend (pytest) — 1191 passed, 0 failed, 0 skipped (1191 total)
✅ CLI (pytest) — 54 passed, 0 failed, 0 skipped (54 total)
✅ Frontend (vitest) — 543 passed, 0 failed, 0 skipped (543 total)
✅ E2E (Playwright) — 79 passed, 0 failed, 0 skipped (79 total)

Summary: ✅ All 1867 tests passed

@codebude
codebude merged commit 97b1574 into develop Oct 23, 2026
5 checks passed
@codebude
codebude deleted the feature/re-read-functionality branch October 23, 2026 05:38
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.

1 participant