Enhance stats and telemetry features with formatting updates - #52
Merged
Merged
Conversation
…ivity tracking, and backup export/import
…ry, and achievements
…ory AchievementToast
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a privacy-first local analytics and statistics dashboard across all 24 interactive tools in Useless Polymath. Tracks practice telemetry (attempts, correct answers, accuracy rate, streaks, high scores, activity timestamps), computes multi-domain subject mastery (Novice, Apprentice, Proficient, Master), displays a 30-day practice activity heatmap, unlocks 8 milestone achievements with real-time celebratory in-app toast notifications, and provides full JSON backup export and import data portability.
Key Additions and Changes:
Storage and Telemetry Engine (src/services/storage.ts): Granular per-module telemetry tracking stored locally under polymath_stats_* keys with automatic backward-compatibility migration from legacy streak and high score keys. Full JSON backup export and validated import with error resilience.
Achievements and Mastery Logic (src/modules/stats/logic.ts): Pure domain logic computing subject mastery across 5 categories (Chronometry, Cryptography, Logic, Networks, Science & Electronics), 30-day activity heatmap intensity levels, and 8 milestone achievement evaluations.
Practice Coordinator and Toast Alerts (src/hooks/usePracticeStreak.ts, src/components/core/AchievementToast.tsx): Seamless telemetry auto-logging on practice submissions that dispatches real-time celebratory in-app toast banners when milestone achievements are unlocked.
Full-Screen Stats Dashboard (src/components/stats/StatsDashboard.tsx): Dedicated analytics dashboard with overview KPI cards, 30-day heatmap grid, domain mastery progress meters, milestone achievements showcase, sortable/filterable per-module telemetry table, and backup data management controls.
Navigation and Deep-Linking (src/components/layout/AppShell.tsx, src/hooks/useModuleNavigation.ts): Direct access via top header "Stats" button, sidebar navigation, and #stats URL hash deep-linking.
100% Locale Parity: Complete translations across English (en), Spanish (es), and Italian (it) verified by automated parity tests.
Type of Change
Checklist
npm run checkpasses (Biome lint & format)npm run testpasses (all unit tests)npm run buildpasses (TypeScript strict mode)