Skip to content

Codex/improve statsscreen UI and metrics#309

Merged
theovilardo merged 20 commits intomasterfrom
codex/improve-statsscreen-ui-and-metrics
Oct 28, 2025
Merged

Codex/improve statsscreen UI and metrics#309
theovilardo merged 20 commits intomasterfrom
codex/improve-statsscreen-ui-and-metrics

Conversation

@theovilardo
Copy link
Owner

No description provided.

- Use squircle shape for stats overview card.
- Adjust padding, spacing, and layout on the stats screen for a cleaner appearance.
- Refine the styling of metric filter chips.
- Remove redundant summary section from the main stats screen, as it's already in the overview card.
- Adjust padding in the `StatsOverviewCard` to remove extra top padding.
- Change the default category dimension to "Song".
- Improve the visual design of the `CategoryVerticalBarChart` by using circular shapes for bars and adding a horizontal divider.
- Remove the highlight row from under the category chart.
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 +702 to +723
fun finalizeCurrentSession() {
val session = currentSession ?: return
val nowRealtime = SystemClock.elapsedRealtime()
if (session.isPlaying) {
session.accumulatedListeningMs += (nowRealtime - session.lastRealtimeMs).coerceAtLeast(0L)
}
val totalCap = if (session.totalDurationMs > 0) session.totalDurationMs else Long.MAX_VALUE
val listened = session.accumulatedListeningMs.coerceAtMost(totalCap).coerceAtLeast(0L)
if (listened >= MIN_SESSION_LISTEN_MS) {
val timestamp = System.currentTimeMillis()
val songId = session.songId
viewModelScope.launch(Dispatchers.IO) {
dailyMixManager.recordPlay(
songId = songId,
songDurationMs = listened,
timestamp = timestamp
)
playbackStatsRepository.recordPlayback(
songId = songId,
durationMs = listened,
timestamp = timestamp
)

Choose a reason for hiding this comment

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

P1 Badge Record stats using last playback timestamp, not finalization time

When a session is finalized the code creates the playback event with timestamp = System.currentTimeMillis(). That reflects when the session was closed, not when the user was actually listening. If the user pauses a track and only changes songs or closes the app hours later, the accumulated listening time is recorded at the later time window, which will skew daily/weekly timelines, streaks and peak-hour calculations. Using the session’s tracked start/last update timestamps (e.g. session.lastUpdateEpochMs) would better represent the true listening period.

Useful? React with 👍 / 👎.

@theovilardo theovilardo merged commit 94c1e77 into master Oct 28, 2025
@lostf1sh lostf1sh deleted the codex/improve-statsscreen-ui-and-metrics 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

None yet

1 participant