fix(stats): adds placeholders to empty screen time cards - #3156
fix(stats): adds placeholders to empty screen time cards#3156seferturan wants to merge 1 commit into
Conversation
`toHumanDuration` returns an empty string for 0 minutes, so any period without watch time rendered blank stat cards and flat, unlabelled graphs. Zero durations now read as "0m" and both graphs show an empty state.
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, reopen this pull request to trigger a review.
|
|
Overall Grade |
Security Reliability Complexity Hygiene Coverage |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Aug 19, 2026 10:28a.m. | Review ↗ | |
| Code coverage | Aug 19, 2026 10:28a.m. | Review ↗ |
Code Coverage Summary
| Language | Line Coverage (Overall) |
|---|---|
| Aggregate | 69.3% [▲ up 0.1% from main] |
| Javascript | 69.3% [▲ up 0.1% from main] |
➟ Additional coverage metrics may have been reported. See full coverage report ↗
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
🎶 Notes 🎶
toHumanDurationreturns an empty string for 0 minutes, so any period without watch history rendered blank stat cards and flat, unlabelled graphstoScreenTimeDurationrenders zero as0m. The daily chart's inline zero fallback goes through it now too, so there's one source of truthisEmptyflag computed ingetGraphItems, andPulseGraphswaps the chart for a placeholder instead of a zeroed axisScreenTimeDailyDatato one entry per day, so labels / minutes / percentages can't drift apart. Kills the defensive index fallbacks in the chartPulseGraph/PulseCelltext_stats_no_screen_timekey, plus specs for the zero formatting and theisEmptyflags👀 Example 👀
With no data:
