Commit 167d55c
Premium Analytics: add a global chart interval control (#51112)
* make date comparison an additive control
swap the SelectControl for a DropdownMenu and style it as the select it replaced
* draw the comparison trigger border explicitly
the shipped wp-components Button carries border: 0, so recoloring alone painted nothing; same for its accent focus shadow
* remove wrap prop
* drop the previous-week comparison preset
the picker offers previous period, month and year; a saved URL carrying the old id degrades to no comparison
* name the comparison preset on the picker trigger
the trigger shows Prev. period instead of the resolved dates, which the section header subtitle already spells out
* stack the section header when it runs out of width
grid plus a container query on the header's own box, so it follows the panel it sits in rather than the viewport
* drop the select fallback from the date presets
the pills abbreviate and stay pills at every width; removes the second measurement, the compact panel layout and the collapsed trigger variant
* keep the preset group on a single row
wrapping hung a doubled divider on the group's own frame; the pills stop shrinking too, so the custom trigger is what gives
* stop the comparison trigger from wrapping
its slot was shrinkable, so an overflowing row squeezed the control to the button's min-width and broke the label over two lines
* measure the comparison control with the row
the probe only covered the presets, so the + and a labelled trigger ran off the header before the labels ever shortened
* cap the title half so the subtitle wraps first
an auto track takes its max-content before an fr track gets anything, so a long date range shortened the preset labels while the header still had room
* give the subtitle a row of its own
out of the title column it stops setting the split, so the controls keep their width; stacked, it swaps back under the title
* abbreviate last 24 hours to 24H
it was the only short label keeping a word, which cost the row width the other three had already given up
* trim the date control comments
cut the development history and the alternatives not taken; keep the contracts that are not visible from the code
* abbreviate the month on the range trigger
a compact range form with the CLDR elision intact, so the trigger reads Aug 2 - 9, 2025 without inventing an English convention
* move the interval vocabulary into datetime
the interval type moves next to the presets it is derived from, and the allowed-interval list becomes public so a control can list exactly what the range permits
* extract the shared menu trigger styles
the comparison trigger's box and states are the same ones an icon-only trigger needs, so they move to a mixin instead of being copied
* add the chart interval dropdown
a glyph opening the buckets the active range allows; a single-option range still opens the menu, since the trigger carries no text to read the choice off
* keep a still-allowed interval across ranges
the range change no longer drops the bucket on every preset switch; the range rules coerce it only when the new range disallows it
* expose the chart interval from the date filters
the applied range derives both the buckets on offer and the one checked; the change applies on click unless a range draft is staged, as a comparison change does
* render the interval control in the date panel
it sits between the preset group and the comparison trigger, and goes through the probe too so the measured row accounts for its width
* name the chart interval in the section subtitle
the control renders as a glyph, so the subtitle carries the active bucket as a cadence beside the window length
* add the interval control to the dashboard date bar
both surfaces carry it: the rolling panel asks for it explicitly, and the year surface composes it beside the year presets
* fix linting issue
Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/31184274896
Upstream-Ref: Automattic/jetpack@b5aeec71 parent 51356a3 commit 167d55c
33 files changed
Lines changed: 65 additions & 49 deletions
File tree
- build
- modules
- data
- fields
- ui
- routes
- dashboard
- post-detail
- reports
- video-detail
- widgets
- most-popular-day
- post-comments
- post-likes
- post-views
- subscribers-list
- video-detail-views-performance
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
58 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
59 | 74 | | |
60 | 75 | | |
61 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments