Repository navigation
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Premium Analytics plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
chihsuan
left a comment
There was a problem hiding this comment.
Thanks for working on this! @retrofox Overall, looks good.
I noticed picking a bucket doesn't close the menu. Menu.RadioItem defaults closeOnClick to false, and adding it fixed this for me.
Screen.Recording.2026-08-31.at.11.00.25.AM.mov
Also, regarding building this on Menu. The DS guidelines say to use SelectControl when picking a value is the whole point of the control. Should we confirm with DS?
Using radio items to recreate a Select. Use Menu.RadioItem only when the state belongs inside a broader command menu. -
https://wordpress.github.io/gutenberg/?path=/docs/design-system-components-menu-usage-guidelines--docs#common-mistakes
with the section header subtitle gone, nothing else read it back
Base UI keeps radio items open, for settings toggled in bunches
I don't see a straightforward escape from this trap. To me, using a Select component for this is a mistake First, it's a Form component that behaves like a Menu. Second, a UI limitation: it isn't possible to define the glyph. The Select component shows the selected value, which makes total sense when it's part of a Form. Alternatives:
We can use the simplest menu items (Rename..., Archive, Save), but they don't highlight the selected value, which makes sense. Its nature is a Menu; it isn't a select. Compared with macOS native Menu:
So, for now, we should simply close this PR. The Menu doesn't seem to cover our needs. I prefer to keep using what we have today:
A note about the macOS menu:
When I select the radio item using this menu, it closes right after I click it. |




Fixes WOOA7S-2026
Stacked on #51701: the base branch is
renovate/bundled-@wordpress-monorepo, sinceMenuneeds@wordpress/ui0.21.0. Once that lands, this rebases onto trunk and the base moves with it; the diff here is the one commit on top.Proposed changes
WOOA7S-2026 asks for the chart intervals to sit behind a button and to default automatically. Both are already on trunk:
DateIntervalDropdownis a glyph-only trigger after the comparison control (WOOA7S-1813, WOOA7S-1929), and the hook resolves the range default whenever the URL carries no interval or a range change stops allowing the pick (getAllowedIntervalsForPreset,resolveIntervalForRange,buildRangePatch). Which buckets each range and widget offer is WOOA7S-1928 and WOOA7S-2005.What this PR changes is the menu itself, to match the prototype frame on the issue and to take the first
@wordpress/uiMenuin the package:DateIntervalDropdownrendersMenu.Root,Menu.Triggerwith a design systemIconButton(outline, neutral, the same 40px box and stroke the shared mixin restated by hand), andMenu.Popupwith aMenu.RadioGroup.Menureaches it through@jetpack-premium-analytics/externals, like the rest of@wordpress/ui.Chart intervalsand listsHours,Days,Weeks,Months,Years, the copy the prototype shows, instead ofBy daysand so on.nullwhen the active bucket is not among the options, so the transient state the report params coerce away checks nothing rather than the group keeping its own selection.icon-togglemixin and the dropdown's stylesheet go: the design system button already is that box. The comparison control keeps thetogglemixin until WOOA7S-2028 reworks it.Gutenberg lists
Menuas use with caution while its API settles (WordPress/gutenberg#76135).Two things a single prototype frame cannot settle, and that this PR leaves as they are: the recommended default is the finest bucket the range allows (days for
Last 30 days, where the frame shows weeks checked), and a manual pick sticks across range changes for as long as the new range allows it.Screenshots
Related product discussion/links
@wordpress/ui0.21.0 bump this builds on.Does this pull request change what data or activity we track or use?
No.
Testing instructions
jetpack build --deps packages/premium-analytics.Chart intervals, listsDaysandWeeksforLast 30 dayswith the active one marked, and pickingWeeksre-buckets the charts and closes the menu. The trigger reads as a sibling ofComparebeside it: same height, same stroke, same radius.Last 7 days: the menu listsDaysalone, still opens, still marked. Switch toLast 24 hours:Hoursalone.MonthsandYearsforAll time.Hours.Packages/Premium Analytics/UI/DateIntervalDropdownand theSectionHeaderstories render the new menu.