VideoPress: fix Add new video button being clipped on admin dashboard#48690
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 🤖 🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so: 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so: 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. Videopress 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. |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
|
Ran |
There was a problem hiding this comment.
Pull request overview
Fixes a layout regression in the legacy VideoPress wp-admin dashboard where the populated-state hero collapses and clips the “Add new video” button by preventing the hero section from shrinking in the jetpack-admin-page-layout flex column.
Changes:
- Add a local
.hero-shrink-guardwrapper withflex-shrink: 0around<AdminSectionHero>instances on the legacy VideoPress admin page. - Add changelog entries for the VideoPress package and both the VideoPress and Jetpack plugins to document the fix.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| projects/packages/videopress/src/client/admin/components/admin-page/styles.module.scss | Adds .hero-shrink-guard with flex-shrink: 0 and documents the flex/overflow root cause. |
| projects/packages/videopress/src/client/admin/components/admin-page/index.tsx | Wraps <AdminSectionHero> in a non-shrinking wrapper div in both pricing and non-pricing states. |
| projects/plugins/videopress/changelog/fix-add-new-video-button-clipped | Changelog entry for the VideoPress plugin release notes. |
| projects/plugins/jetpack/changelog/fix-add-new-video-button-clipped | Changelog entry for the Jetpack plugin release notes. |
| projects/packages/videopress/changelog/fix-add-new-video-button-clipped | Changelog entry for the VideoPress package release notes. |
Fixes VIDP-242
Context
Two recent user reports in Zendesk (11192950-zd-a8c, 11201391-zd-a8c). On the legacy VideoPress admin dashboard, the "Add new video" button disappears once videos exist in the library. Got p1778325739637059/1778323869.151139-slack-C02LT75D3 from the VideoPress team for a Bug Blitz fix.
Root cause
At standard viewports, the hero collapses to 1px. The shared
.section-herohasoverflow: hidden, which in a flex column letsmin-height: autoresolve to 0. All shrink pressure from siblings lands on the hero, which clamps to 0 and clips the button.Recent regression from PR #48244 (base-styles v1.2.0). My Jetpack had a similar regression fixed in PR #48578.
Fix
Wrap each
<AdminSectionHero>in a local div withflex-shrink: 0. Shared component untouched, no blast radius on other admin pages using it (Backup, Search, Publicize, Protect, ~12 sites).Legacy code will be replaced by modernization work in #48506 at Phase 9 cutover. This fix goes away with it.
Note on the diff: the TSX file shows 119 line changes due to JSX re-indentation when adding the wrappers. Toggle "Hide whitespace changes" in the GitHub diff view to see the actual fix: 2 wrappers + 1 Prettier-mandated multi-line reformat on
jp-admin-notices.Testing
Tested live on JN sandbox with the fix deployed:
Not tested: other admin pages using
AdminSectionHero, mobile viewports, many videos (5+).Test site: https://ocelot-of-hydrozoans.jurassic.ninja/wp-admin/admin.php?page=jetpack-videopress
Before / After
The bug in numbers: at default viewport (1440x800) on the populated dashboard, the hero collapses to 1px height while its content needs 285px. That's the entire "Add new video" button (and storage meter) clipped out of view.
BEFORE (bug active): baseline state. Hero collapsed to 1px, 284px of content clipped, including the upload button. Overlay shows the computed CSS values that cause it.
AFTER (fix applied via local override): same page,
flex-shrink: 0applied to wrapper. Hero renders at full 285px, button visible. Overlay showsoverflow: hiddenis preserved (we don't break the shared component's semantics).Live verification on JN with the deployed fix: dashboard after the fix was actually shipped to the sandbox, populated state, default viewport.
Notes for reviewers
This PR was built using an AI-assisted workflow (Claude Code + Chrome DevTools MCP for investigation and testing). I drove the process, AI helped with the heavy lifting on code investigation and live verification. Happy to walk through the workflow if useful.