Skip to content

feature: Add color marking for read/last-read chapters in library#492

Open
suryaatevellore wants to merge 1 commit into
simjanos-dev:mainfrom
suryaatevellore:feature/chapter-read-color-marking
Open

feature: Add color marking for read/last-read chapters in library#492
suryaatevellore wants to merge 1 commit into
simjanos-dev:mainfrom
suryaatevellore:feature/chapter-read-color-marking

Conversation

@suryaatevellore
Copy link
Copy Markdown

Add visual indicators in the chapter list so users can see which chapters have been read and which one was most recently read.

CleanShot 2026-04-19 at 17 14 26@2x

Changes:

  • Backend: Expose updated_at in chapter list endpoints (ChapterService.php) so the frontend can determine the last-read chapter by timestamp.

  • Library chapter list (BookChapters.vue): Add item-class callback that applies 'chapter-read' or 'chapter-last-read' CSS class to table rows. Add a check-circle icon next to chapter names for read chapters (green for last-read, grey for others). Add lastReadChapterId computed property that finds the chapter with the highest updated_at among read chapters.

  • Reader chapter list (TextReaderChapterList.vue): Apply matching visual indicators in the in-reader chapter list dialog.

  • Styling (BookChapters.scss, TextReaderChapterList.scss): Add chapter-read class (4px muted green left border) and chapter-last-read class (4px green left border + tinted background).

  • Theme colors (themes.js): Add chapterReadBorder and chapterLastReadBackground color variables for light, dark, and eink themes.

  • Testing: Add BookFactory, ChapterFactory, and ChapterReadTrackingTest with 4 feature tests covering read_count and updated_at in API responses, read count increment on finish, and timestamp update on finish. Enable SQLite in-memory DB in phpunit.xml for fast isolated tests.

Add visual indicators in the chapter list so users can see which chapters
have been read and which one was most recently read.

Changes:
- Backend: Expose updated_at in chapter list endpoints (ChapterService.php)
  so the frontend can determine the last-read chapter by timestamp.

- Library chapter list (BookChapters.vue): Add item-class callback that
  applies 'chapter-read' or 'chapter-last-read' CSS class to table rows.
  Add a check-circle icon next to chapter names for read chapters (green
  for last-read, grey for others). Add lastReadChapterId computed property
  that finds the chapter with the highest updated_at among read chapters.

- Reader chapter list (TextReaderChapterList.vue): Apply matching visual
  indicators in the in-reader chapter list dialog.

- Styling (BookChapters.scss, TextReaderChapterList.scss): Add chapter-read
  class (4px muted green left border) and chapter-last-read class (4px green
  left border + tinted background).

- Theme colors (themes.js): Add chapterReadBorder and
  chapterLastReadBackground color variables for light, dark, and eink themes.

- Testing: Add BookFactory, ChapterFactory, and ChapterReadTrackingTest with
  4 feature tests covering read_count and updated_at in API responses, read
  count increment on finish, and timestamp update on finish. Enable SQLite
  in-memory DB in phpunit.xml for fast isolated tests.
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