Skip to content

APP: segment-based reading progress tracker and continue-reading prompt#1697

Open
johan-bell wants to merge 46 commits into
mainfrom
912-app-add-continue-reading-query-to-homepage
Open

APP: segment-based reading progress tracker and continue-reading prompt#1697
johan-bell wants to merge 46 commits into
mainfrom
912-app-add-continue-reading-query-to-homepage

Conversation

@johan-bell

@johan-bell johan-bell commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Review

Status: Ready for review

Supersedes #923 — that PR was merged by mistake and main was reverted to 8d56696f. This is the rebased branch (9955287c) with segment-based tracking, continue prompt UX fix, and QA specs. Commit history from the old PR is on this branch; review thread starts fresh here.

Related issue: #912


Summary

  • Tracks article reading progress locally and surfaces in-progress articles on the homepage Continue Reading row.
  • Replaces block-level visibility with viewport-height segments so long paragraphs advance on mobile (Friday review concern).
  • Shows an in-article Continue reading prompt on return visits; scroll restore does not re-show the card after the user continues.

Changes

  • useReadingProgressTracker.ts — segment collection, visibility/skim/dwell gates, localStorage persistence, scroll restore with guard window
  • ContinueReadingPrompt.vue + SingleContent.vue — resume card; continuePromptHandled prevents prompt reappearing after Continue
  • ContinueReading.vue — homepage row from saved readingProgress
  • readingTime.ts — shared dwell and skim-cap math (language WPM)
  • docs/reading-progress-tracker.md + diagram — architecture and gate documentation
  • QA: readingProgressTracker.qa.spec.ts, ContinueReading.spec.ts, docs/qa/reading-progress-tracker-results.md (63 automated tests passing)
  • i18n seeds (eng/fra) for prompt and home.continue.read

Test plan

  • Phone: long single-paragraph article — progress advances segment by segment (does not stall)
  • Partial read → Home — Continue Reading row shows the article
  • Reopen article — prompt appears; Continue reading scrolls and card stays hidden; Start from top dismisses but keeps progress
  • Fast-fling scroll — little or no progress saved
  • Read short article to end — removed from readingProgress and homepage row
  • cd app && npm run test -- --run src/composables/useReadingProgressTracker.spec.ts src/qa/readingProgressTracker.qa.spec.ts src/components/HomePage/ContinueReading.spec.ts

@johan-bell

Copy link
Copy Markdown
Collaborator Author

Ready for Review column on the project board.

Supersedes #923 (mistaken merge; main reverted). This PR (#1697) is the rebased replacement — please use this for review, not the closed #923 thread.

@ivanslabbert ivanslabbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Split documentation restructuring into separate issue

Comment thread api/src/db/seedingDocs/lang-eng.json Outdated
Comment thread api/src/db/seedingDocs/lang-fra.json Outdated
…angoToDexie for content retrieval and improve filtering logic
Shared WPM resolution, word counting, and per-block dwell bounds keep
SingleContent estimates and the progress tracker on the same math.
Expose get/set/remove helpers and a reactive ref so Continue Reading can
subscribe to progress changes across tabs.
…tes.

Dwell accumulates per prose block only while the user is not skimming,
so fast scrolls do not count as read progress.
Replace scroll-depth tracking with the dwell-based composable on the prose
body and restore saved scroll position on return visits.
Show in-progress text articles from localStorage instead of recomputing
eligibility from scroll position alone.
Add a written guide and diagram for how visibility, scroll velocity, and
per-block dwell combine to power the Continue Reading row.
… reading progress tracker files. Update state declaration to use const for better clarity.
…ved reactivity. Clean up code formatting for better readability.
Scale the skim velocity threshold with language WPM and centralize idle and scroll-sample constants used by the tracker.
…ates.

Require block bottom in viewport, scale skim detection from language WPM, pause dwell after inactivity, and auto-restore scroll on article reopen.
Cover block-end eligibility, WPM-scaled velocity, idle pause, no-scroll progress, and scroll restore on mount.
Document block-end, WPM-scaled skim, idle pause, and auto-restore behavior across the markdown guide and draw.io diagram.
… eligibility logic. Introduce new functions for estimating words per pixel and resolving active blocks. Update scroll velocity handling to use words per second instead of pixels per second, improving accuracy in tracking reading progress.
… for skim detection and block dwell logic. Introduce functions for estimating words per pixel and computing scroll velocity in words per second, improving clarity and accuracy in reading progress tracking.
…for resolving active blocks and computing scroll velocity in words per second. Enhance skim detection logic and update test cases to reflect changes in state management and velocity handling, ensuring accurate tracking of reading progress.
…ds per pixel and computing scroll velocity in words per second. Refactor existing tests to ensure accurate validation of skim detection and velocity calculations, enhancing overall test coverage and reliability.
johan-bell and others added 17 commits June 18, 2026 16:12
…changes in block eligibility and skim detection logic. Clarify the calculation of reading speed in words per second and enhance descriptions of tracking behavior, including idle pauses and scroll restoration on article reopen.
…ext presence, regardless of video content. Update documentation to clarify tracking conditions and improve descriptions of functionality.
Split tall prose blocks into viewport-height segments so gate 1b works on mobile, show a resume card on article reopen, and fix tracker tests for jsdom.

Co-authored-by: Cursor <cursoragent@cursor.com>
… and update event emissions. The prompt now directly emits 'continue' and 'dismiss' events without intermediate state management. Update SingleContent page to handle prompt visibility based on user interaction.
Automated P0/P1 scenarios, ContinueReading homepage tests, and QA results doc for merge sign-off.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore overlay props and layout from the conflict resolution skipped during rebase.
Enhance the README for the reading progress tracker with detailed explanations of tracking mechanics, segment calculations, and gate conditions. Introduce a new diagram for visual representation of the tracking process. Update references in existing documentation to ensure consistency and clarity.
Introduce a new document listing socket.io message names and their descriptions for API and client communication. Additionally, add several architecture diagrams, including data flows, permission systems, and data models, to enhance understanding of the system's structure and interactions. Update the REST API documentation with a detailed overview and workflow diagram to clarify data synchronization processes.
Enhance clarity and organization of documentation by updating references to guides and architecture diagrams. Key changes include:
- Expanded descriptions in `CLAUDE.md` and `README.md` to include guides and index links.
- Updated paths in `permissions.service.ts` to reflect new diagram locations.
- Adjusted documentation in `app` and `cms` to point to the correct guides for translations and project automation.
- Created a new `README.md` in the `docs` directory to serve as an index for documentation.
- Archived historical schema upgrades in a new directory for better organization.

These updates aim to improve navigation and accessibility of project documentation.
This commit introduces significant changes to the content progress tracking system, merging reading and media progress into a unified structure stored under `contentProgress`. Key updates include:
- Renamed functions and variables to reflect the new content progress model.
- Migrated legacy `readingProgress` and `mediaProgress` data into the new format.
- Updated UI components to display content in progress under a single "Continue" section, replacing the previous "Continue Watching" and "Continue Reading" components.
- Enhanced tests to cover the new progress tracking logic and ensure proper functionality across components.

These changes aim to streamline the user experience and improve the maintainability of the codebase.
This commit updates the SingleContent test suite to incorporate better handling of content progress tracking. Key changes include:
- Added `removeReadingProgress` and `syncContentProgressFromStorage` to ensure proper state management during tests.
- Cleared local storage and reset timers in the `afterEach` hook for consistent test environments.
- Replaced `waitForExpect` with `flushPromises` and `nextTick` for more reliable asynchronous handling.

These improvements aim to enhance test reliability and maintainability.
Show max(reading%, watching%) without duration labels so the Continue row treats articles and video consistently.
Expose --desktop-sidebar-w so fixed overlays can align with the content column when the sidebar is expanded or collapsed.
Use a progress bar, X dismiss, flexible width for i18n, content-column centering on desktop, and spacing above the mobile nav.
Remove unused home.continue.watch/read keys and align the compact prompt action label with the meeting wording.
@johan-bell johan-bell force-pushed the 912-app-add-continue-reading-query-to-homepage branch from 3460c15 to a6aeca0 Compare June 18, 2026 16: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.

2 participants