Repository navigation
feat: add a study heatmap with daily activity and streaks - #72
Closed
Punnawit9285 wants to merge 8 commits into
Closed
Punnawit9285 wants to merge 8 commits into
Punnawit9285 wants to merge 8 commits into
Conversation
Show a calendar of study activity on the home page, with per-day totals, current and longest streaks, and a range selector. Time is credited from video playback and from Pomodoro study phases, so both count towards the same picture. Activity is recorded per device and merged across devices through UserSyncService, which keeps an account's record in one document and re-reads it at most once every five minutes so repeatedly opening the app does not multiply billed reads. Video counts from other devices are kept as a separate total, since devices do not share video identifiers and the lists cannot be combined without double-counting. Sync sits behind a userSyncEnabled remote config flag. The calendar colours come from --flick-* when a theme provides them and otherwise fall back to values derived from the Ionic palette, so the heatmap stands on its own and a theme can restyle it without either depending on the other.
Study time is written at most once per 15 minutes per device. Leaving the page no longer forces a write while the last one is recent; what is held back stays on the device and is sent the next time the app opens. The theme and the heatmap share one read, and hourly token refreshes no longer spend another. Also show the selected range on iOS, where the chosen segment is filled with the same colour as its label, and bring today back into view when a tablet is rotated.
The interval is remembered on the device, so reloading the page no longer starts it again. That puts a hard ceiling of 48 study writes per device per day; what is held back is still sent on the next open.
Master now runs the unit tests in CI, and every spec that created the study tracker or the Pomodoro service failed here with "No provider for Firestore", since the tracker syncs through UserSyncService. The tracker's own tests get a stand-in sync service, and the Pomodoro's get a stand-in tracker, so neither needs Firestore to run.
- observe Pomodoro timer observables from StudyStatsService to keep PomodoroService decoupled - restore base PomodoroService and spec to master state - update StudyStatsService spec with PomodoroService test provider - re-anchor home page imports
- read and save the synced settings through FlickMan's v1/user_settings, so no Firestore rule is needed - wait for the ID token before the first read, so sync is not switched off while sign-in finishes - add getUserSettings and saveUserSettings to ManService
Member
|
I would like to raise a concern about the “streaks” feature. This website is different from a flashcard application, i.e. Anki, and is not designed to be used every day. The “streaks” and “heatmap” features may encourage users to watch the videos daily for rewards, potentially producing unhealthy usage habits. Therefore, I would actually advise against implementing these features. However, allowing users to turn them off could address this concern. |
Ionic 9 (#74) dropped @ionic/angular/standalone, so the study heatmap now imports from @ionic/angular like the rest of the app.
Member
|
Replaced by f2c55fc. I agree with @ittipatken that students aren't supposed to study recorded lectures every day. Furthermore, the activity data should be sourced from FlickMan's existing |
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.
Needs docchula/FlickMan#23 for syncing across devices
Heatmap: shows 3 months, 6 months, a year (default) or all time, with a short guide explaining it like the ones in Pomodoro.
Off by default (Can be turn on in settings menu)
Low server load:
UI already test by clicking through in Safari's responsive design mode, both in Ipad and IOS, seem to work well so far (at least on localhost)
P.S. Pretty obvious where I got inspiration from haha
(GitHub and Anki heatmap addon)