New Stats: revamp period selector presets - #23287
Conversation
Remove the "Last 6 months" preset and add calendar-aligned presets (Today, This Week, This Month, This Year), grouped in the selector with separators between the rolling presets, the calendar presets, and Custom. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Generated by 🚫 Danger |
|
|
|
|
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
The period selector revamp removed stats_period_last_6_months from the default locale but left it in translation files, causing ExtraTranslation lint errors. Remove the orphaned entries. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #23287 +/- ##
=======================================
Coverage 37.92% 37.93%
=======================================
Files 2352 2352
Lines 128848 128925 +77
Branches 17909 17940 +31
=======================================
+ Hits 48867 48907 +40
- Misses 75983 76012 +29
- Partials 3998 4006 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@adalpari This is looking good, but Claude found a potential problem. |
The ThisYear window is charted in day buckets early in January (when its window is short) and month buckets otherwise, so keying drill-down and the legend range off the period type mislabelled and mis-drilled the early-year chart. Derive both from the chart's actual bucket unit instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Man, I was getting so mad at Claude because I already reviewed and fixed that twice!
|
This Week/Month/Year now step to the full previous (or next) calendar week/month/year instead of a same-length mirror of the partial window, and continued paging stays aligned to whole calendar units. Rolling presets keep their fixed-span step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On the first day of a calendar week/month/year the "This week/month/year" window collapses to a single day identical to Today's window, so several presets matched at once and snapToPreset picked Today first (it is listed before the calendar presets). Paging forward onto the present then relabelled the period "Today" and switched navigation from whole-unit steps to daily steps. Pass the navigated period into snapToPreset and, when multiple presets match, prefer the one whose calendar unit matches the source, keeping the calendar label and its whole-unit stepping. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I introduced some extra-changes. So, it should be ready to go now! |


TL;RD
This PR is reorganising the fixed periods in the new stats screen. Specifically, I'm adding "recent stats" periods and reorganising the menu.
Description
Revamps the period selector in the New Stats screen (Traffic tab).
Supporting changes so the new presets behave correctly across the chart, bottom-row totals, comparison ranges, labels, and back/forward navigation: the calendar windows derive their API granularity (day up to a month, month for This Year) and quantity from the actual window length.
Todayremains only in the calendar group (no longer duplicated at the top). Old-stats deep links keep mapping WEEK/MONTH to the rolling last-7/30-day periods.Unit tests updated: the two
Last6Monthsmonthly-granularity tests were migrated toLast12Months, and duplicates thatLast12Monthsalready covered were removed.Testing instructions
New Stats period selector: