chore(release): prepare version 4.0.1 with analytics fixes, playlist updates, and storage optimizations - #82
Conversation
…updates, and storage optimizations - Fixed analytics summary cards by rebuilding persistent stats from hybrid storage for improved accuracy. - Improved playlist handling: robust detection, reliable history toggles, and better navigation detection. - Enhanced data hygiene with pruning of stats to last 7 days for a compact snapshot. - Removed outdated sync triggers and redundant code for cleaner storage management. - Updated `manifest.json` version to 4.0.1.
There was a problem hiding this comment.
Pull request overview
This release (v4.0.1) focuses on improving the reliability and accuracy of analytics by introducing a hybrid stats snapshot system and enhancing playlist navigation handling. The changes rebuild persistent stats from the complete hybrid storage (IndexedDB + localStorage) to serve as the single source of truth for all analytics displays, ensuring summary cards and charts reflect the full history rather than just the current page.
Key Changes:
- Persistent stats snapshot now rebuilt from full hybrid history with one-time rebuild mechanism using
stats_syncedflag - Analytics charts (Activity, Watch Time by Hour) and summary cards use the persisted stats snapshot for accuracy across complete dataset
- Enhanced playlist navigation detection with dedicated interval checks, timing resets, and mutation observers to prevent inherited timing issues
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/storage.js |
Added _rebuildStatsFromHybrid() method to rebuild stats snapshot from merged IndexedDB + localStorage with 7-day daily retention; removed outdated sync trigger code |
src/popup.js |
Updated calculateAnalytics() to prefer persisted stats counters; enhanced chart rendering to use snapshot data; added analyticsAllVideos for full-history analytics |
src/content.js |
Added handlePlaylistNavigation() function with timing reset logic; enhanced click/link interception logging; added 500ms playlist navigation check interval |
tests/unit/storage.test.js |
Added comprehensive tests for stats rebuild, 7-day pruning, and incremental updates; added playlist ignore flag preservation test |
tests/unit/popup.test.js |
Added test verifying export includes stats snapshot from ytStorage.getStats() |
src/manifest.chrome.json |
Version bump to 4.0.1 |
src/manifest.firefox.json |
Version bump to 4.0.1 |
docs/technical.md |
Updated stats structure documentation to include stats_synced and lastFullRebuild fields |
docs/index.md |
Updated analytics description to mention hybrid history rebuild and 7-day retention |
docs/detailed_guide.md |
Updated export documentation to mention compact 7-day daily buckets |
CHANGELOG.md |
Added v4.0.1 release notes documenting stats fixes, playlist improvements, and data hygiene |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
…ng reliability - Refined `timestampLoaded` property and dataset flag reset for better SPA navigation handling. - Added conditional checks to prevent errors from null video objects. - Improved analytics average duration calculation with `Number.isFinite` check. - Enhanced unit test for hybrid storage, ensuring daily stats pruning validates key format and count.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
manifest.jsonversion to 4.0.1.This pull request updates YT re:Watch to version 4.0.1, focusing on major reliability improvements for stats/analytics and playlist handling. The changes address issues with inconsistent analytics, enhance playlist detection and progress saving, and introduce better data hygiene for stored stats. There are also significant code enhancements for playlist navigation and video progress restoration, ensuring more accurate and responsive user experience.
Stats & Analytics Reliability Improvements
Playlist Handling Enhancements
src/content.jswith interval-based checks, mutation observers, and context-aware timing resets. This ensures correct progress restoration and prevents inherited timing issues when navigating between videos in a playlist. [1] [2] [3] [4] [5] [6] [7] [8]Data Hygiene
Diagnostics & Logging
Version Bump