feat: add listening activity / stats page - #438
Open
luishidalgoa wants to merge 3 commits into
Open
Conversation
Adds an "Activity" page that surfaces the user's listening stats, similar to the activity views found in some Subsonic clients. Plays are recorded locally in IndexedDB when a track is scrobbled, and the page derives from that history: - summary cards (total plays, listening time, unique artists, streak) - daily activity and listening-hours bar charts - a genres breakdown (donut) and a calendar heatmap of listening history - recent plays Top albums are pulled from the server (getAlbumList2 frequent), so that panel has data from day one. A 7D/30D/90D/All range filter scopes the local stats. Since the Subsonic API exposes no per-play history, the time-series data accumulates on-device from the moment the feature ships. Adds recharts for the charts and translations for en/es/pt/pt-BR. Closes victoralvesf#436 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@luishidalgoa is attempting to deploy a commit to the Victor Alves' projects Team on Vercel. A member of the Team first needs to authorize it. |
The empty state hid the whole page, including the server-backed Top Albums panel, so a brand-new user saw a fully blank page. Keep Top Albums visible alongside the empty state so there is immediate content while the local play history builds up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
…esf#436-listening-activity # Conflicts: # pnpm-lock.yaml
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.


What
Adds an Activity page (sidebar → Activity) with listening stats, as requested in #436 — similar to the activity views some Subsonic clients offer.
Sections:
How the data works (please read)
The Subsonic API exposes play counts and a last-played timestamp, but no per-play history with timestamps, which the time-series views (daily/hourly/heatmap/streak) need. So this takes a hybrid approach:
player.store), the play is also recorded in IndexedDB (idb-keyval). Everything time-based is derived from this log. It's bounded (max 50k events) and best-effort (never blocks playback). This means the stats start empty and fill in from the moment the feature ships — there's no historical backfill because the server can't provide it.getAlbumList2(frequent), so that panel has data from day one.All the derivation logic is pure and isolated in
src/utils/activity.ts; the page/components just render it, so swapping any panel between local/server later is easy.Notes
/library/activity(auth-gated like the rest), sidebar entry, and i18n foren/es/pt/pt-BR(others fall back toen-US/ Weblate).tsc, Biome (incl. the repo pre-commit hook) and a productionvite buildare all clean.This is a proposal — happy to adjust scope, drop the dependency for hand-rolled charts, or change the data strategy (e.g. local-only, or server-only) based on what you'd prefer. Since it introduces a new dependency and an on-device tracking store, I wanted to check the direction with you.
Closes #436