Skip to content

Add listening stats experience#301

Merged
theovilardo merged 6 commits intomasterfrom
codex/add-user-stats-overview-feature
Oct 28, 2025
Merged

Add listening stats experience#301
theovilardo merged 6 commits intomasterfrom
codex/add-user-stats-overview-feature

Conversation

@theovilardo
Copy link
Owner

Summary

  • add a playback stats repository with configurable ranges and timeline aggregation
  • surface a listening stats preview card on Home and a dedicated Stats screen with expressive Material 3 visuals
  • record playback history from the player view model and add duration formatting helpers for the new UI

Testing

  • ./gradlew :app:compileDebugKotlin (fails: Android SDK not available in CI environment)

https://chatgpt.com/codex/tasks/task_e_68fbcef32134832f9cd4f9c50d012345

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +107 to +110
val effectiveStart = startBound
?: filteredEvents.minOfOrNull { it.timestamp }
?: allEvents.minOfOrNull { it.timestamp }
val effectiveEnd = filteredEvents.maxOfOrNull { it.timestamp } ?: endBound

Choose a reason for hiding this comment

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

P1 Badge Average listening time ignores inactive days in range

The averageDailyDurationMs shown in the stats UI is computed using effectiveEnd, which is assigned to the last event timestamp when there are any plays. As a result, the subsequent calculation divides the total duration by only the days between the first and last played days instead of the full selected time range (e.g., a week or month). If a user listens only on Monday and then stops for the rest of the week, the code will divide by one day and display an inflated “Avg per day” even though the screen labels the range as “This Week”. Consider deriving the day span from startBound/endBound (the actual range boundaries) so inactive days inside the selected range are accounted for.

Useful? React with 👍 / 👎.

@theovilardo theovilardo merged commit ed874ce into master Oct 28, 2025
@lostf1sh lostf1sh deleted the codex/add-user-stats-overview-feature branch January 16, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant