Skip to content

Premium Analytics: scroll the dashboard with the page, not in its own scroll area - #51594

Closed
chihsuan wants to merge 1 commit into
trunkfrom
wooa7s-1991-fix-scrolling-when-wp-admin-sidebar-exceeds-viewport
Closed

chihsuan wants to merge 1 commit into
trunkfrom
wooa7s-1991-fix-scrolling-when-wp-admin-sidebar-exceeds-viewport

Conversation

@chihsuan

@chihsuan chihsuan commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Fixes WOOA7S-1991

Proposed changes

  • Make the page the only scroll container on desktop, so one wheel gesture scrolls the dashboard from top to bottom.
  • Keep the pinned page header and section header behaving as they do today, now offset against the viewport instead of the panel.
  • Publish the page header's measured height so the section header rests below it, rather than restating admin-ui's padding tokens.
  • Scope to the dashboard route; the detail and report routes pin different things and need their own pass.

wp-admin grows #wpwrap to the admin menu's height, so a menu taller than the window makes the document scrollable. The shell also scrolled internally, and a wheel gesture latches to one scroller at a time — so scrolling stalled at whichever end it reached first, and the document scroll dragged the whole app off-screen behind the shell's rounded corners.

Pinning the shell (the first approach on this branch) stopped the app moving but left both scrollers in place, so the stall remained. Letting the app's content flow into the page removes the second scroller entirely.

The comment guarding the panel's scroller warned that removing it would make the panel and the widget grid oscillate while resizing a widget. That no longer applies: @wordpress/grid takes a fixed pixel rowHeight snapped to presets, so there is no container-to-grid feedback, and a sampled resize drag (1350 frames) showed the grid height move once, with zero direction reversals.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • Open the Premium Analytics dashboard (Stats v2) in wp-admin on a desktop-width window, with an admin menu taller than the window — shrink the window to ~600px tall, or add menu items.
  • Scroll from the top of the page to the bottom in one continuous gesture with the pointer over the dashboard. It should scroll all the way without stalling and needing a second gesture.
  • While scrolling, the "Stats" header should stay pinned below the admin bar and the section header ("Site traffic" plus the date controls) directly below it, with no overlap or gap. The tab list scrolls away, as it does today.
  • Collapse the admin menu and repeat; the dashboard should sit flush against the 36px menu.
  • Hover a menu item with a submenu — the flyout must still appear and not be clipped.
  • Enter Customize, resize a widget, and confirm the layout does not flicker.
  • Below 783px wide, nothing should change: boot fixes its own surfaces there and the panel keeps its own scroller.

@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the wooa7s-1991-fix-scrolling-when-wp-admin-sidebar-exceeds-viewport branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack wooa7s-1991-fix-scrolling-when-wp-admin-sidebar-exceeds-viewport
bin/jetpack-downloader test jetpack-mu-wpcom-plugin wooa7s-1991-fix-scrolling-when-wp-admin-sidebar-exceeds-viewport

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics labels Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

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:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: September 7, 2026

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.

@jp-launch-control

jp-launch-control Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Cannot generate coverage summary while tests are failing. 🤐

Please fix the tests, or re-run the Code coverage job if it was something being flaky.

Full summary · PHP report · JS report

… scroll area

wp-admin grows #wpwrap to the admin menu's height, so a menu taller than the
window makes the document scrollable. With the shell scrolling internally as
well, one wheel gesture latched to whichever scroller it was over and stalled at
that scroller's end, and the document scroll dragged the whole app off-screen.

Let the page be the only scroll container on desktop. The pinned page header and
section header keep their current behaviour, now offset against the viewport:
admin-ui pins its header at 0, and the section header rests below it using a
height the page publishes rather than a restated constant.

The guard against removing the panel's scroller (widget-resize flicker) no longer
applies: @wordpress/grid takes a fixed pixel rowHeight, and a sampled resize drag
showed no oscillation.
@chihsuan
chihsuan force-pushed the wooa7s-1991-fix-scrolling-when-wp-admin-sidebar-exceeds-viewport branch from ab428c8 to 84cb861 Compare August 26, 2026 09:14
@chihsuan chihsuan changed the title Premium Analytics: keep the dashboard in view when the admin menu is taller than the window Premium Analytics: scroll the dashboard with the page, not in its own scroll area Aug 26, 2026
@chihsuan chihsuan closed this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Type] Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant