Skip to content

VideoPress: Replace custom Checkbox with CheckboxControl, fix invisible filter/privacy checkboxes#48175

Merged
CGastrell merged 3 commits into
trunkfrom
change/videopress-checkbox-cleanup
Apr 19, 2026
Merged

VideoPress: Replace custom Checkbox with CheckboxControl, fix invisible filter/privacy checkboxes#48175
CGastrell merged 3 commits into
trunkfrom
change/videopress-checkbox-cleanup

Conversation

@CGastrell
Copy link
Copy Markdown
Contributor

@CGastrell CGastrell commented Apr 18, 2026

Part of #48160

Proposed changes

The Video Privacy toggle at the bottom of the VideoPress dashboard, and the checkboxes in the library's filter panel (Uploader / Privacy / Rating), were rendering as invisible boxes — labels present, no box. Root cause was the local custom Checkbox component doing all: unset on input[type="checkbox"] and then relying on a ::before pseudo-element that only set dimensions, no background/border. Replacing it with @wordpress/components' CheckboxControl gives us native rendering for free.

  • Privacy toggle (site-settings-section): swapped to CheckboxControl, disabledReason routed through the native help prop, component-local layout rule moved into its own style.module.scss next to the consumer.
  • Filter panel (video-filter): CheckboxCheckmark now renders CheckboxControl and applies a .filter-checkbox class with padding-top: var(--spacing-base) for a comfortable vertical rhythm between options. Dropped the for and disabledReason props (neither was used by any call site) and the unused DisabledReasonTooltip helper.
  • List + row selection UI (video-list, video-row): the custom Checkbox's last two consumers were a "select all" header and per-row selection checkboxes, both permanently gated behind const showCheckbox = false; // TODO: implement bulk actionsnever rendered in the current UI. Migrated the would-be-rendered bits to CheckboxControl and then removed the dead selection plumbing entirely: selected/setSelected/allSelected/handleAll state, the checked/onSelect/showCheckbox props on VideoRow, the row-level role="button"/tabIndex/onKeyDown/onKeyUp/aria-label and its keyPressed state/handlers (they only existed to toggle the never-rendered checkbox), and the orphan .checkbox-wrapper-small SCSS. When bulk actions do ship, the implementer will use CheckboxControl directly rather than resurrecting a custom component.
  • Delete components/checkbox/: with the three consumers migrated, the custom Checkbox component, its stylesheet, types, storybook story, and test are removed.

Net: -392 / +15, no visible UI change except "previously blank checkboxes now render correctly."

Before
01-privacy-toggle
02-filter-panel

After:
01-privacy-toggle
02-filter-panel

Related product discussion/links

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

No.

Testing instructions

  1. Open the VideoPress dashboard (/wp-admin/admin.php?page=jetpack-videopress).
  2. Scroll to the bottom — Settings → Video Privacy: Restrict views to members of this site checkbox should render as a normal WP checkbox (and toggle the setting when clicked).
  3. Click the Filters button next to the library search. The Uploader / Privacy / Rating columns should all show visible, checkable checkboxes with a small vertical gap between them.
  4. Toggling any filter should narrow the library as expected.

Before/after screenshots below.

@CGastrell CGastrell self-assigned this Apr 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 18, 2026

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), and enable the change/videopress-checkbox-cleanup branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack change/videopress-checkbox-cleanup

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

@CGastrell CGastrell added [Status] Needs Review This PR is ready for review. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Package] VideoPress Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR labels Apr 18, 2026
@github-actions github-actions Bot added [Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Base Styles [JS Package] Components [Package] Backup [Package] Newsletter [Package] Publicize [Package] Search Contains core Search functionality for Jetpack and Search plugins [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Tests] Includes Tests Admin Page React-powered dashboard under the Jetpack menu RNA labels Apr 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 18, 2026

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: May 5, 2026
    • Code freeze: May 4, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost 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.


Protect 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.

The Video Privacy toggle at the bottom of the VideoPress dashboard was using the local CheckboxCheckmark wrapper around a custom-styled checkbox that relied on a ::before pseudo-element for its visible box but never defined background/border, leaving the control blank on top of any cascade that didn't paint a default. Replace it with WP's @wordpress/components CheckboxControl for native rendering and accessibility, and move the component-local layout rule (margin-top for spacing under the Settings heading) into its own style.module.scss alongside the consumer.

Also routes the existing disabledReason copy through CheckboxControl's `help` prop.
…n UI

Now that the site-settings privacy toggle uses @wordpress/components CheckboxControl directly, the local Checkbox component is only used by:

- video-filter's CheckboxCheckmark (filter panel on the library page)
- video-list / video-row "select all" + per-row selection checkboxes, both permanently gated behind a hardcoded `showCheckbox = false` with a `// TODO: implement bulk actions` note — never rendered in the current UI

Migrate CheckboxCheckmark to CheckboxControl and delete the list/row selection plumbing entirely, then remove the components/checkbox/ directory (component, styles, stories, tests, types).

video-filter:
- CheckboxCheckmark now renders CheckboxControl with a .filter-checkbox class that adds `padding-top: var(--spacing-base)` for vertical rhythm between filter options.
- Drop the `for` and `disabledReason` props plus the internal DisabledReasonTooltip — neither was actually used by any call site.
- Remove now-dead `.filters-section .checkbox-container:last-child` and `.title-adornment` rules.

video-list:
- Remove `selected` / `setSelected` state, `allSelected`, `handleAll`, and the `showCheckbox = false` constant from both VideoList and LocalVideoList.
- Drop the select-all header checkbox and stop passing `checked` / `onSelect` / `showCheckbox` through to the row components.

video-row:
- Drop the CheckboxControl render block + wrapper div.
- Drop `checked`, `onSelect`, `showCheckbox` props from the signature and the VideoRowProps type.
- Drop the row-level keyboard/click handling that only existed to toggle the (never-rendered) checkbox: `role=button`, `tabIndex`, `aria-label`, `onKeyDown`, `onKeyUp`, `keyPressed` state, `handleKeyDown`/`handleKeyUp`/`handleClick`/`isSpaceOrEnter`.
- Simplify `handleInfoWrapperClick` to only toggle mobile expansion.
- Remove the orphan `.checkbox-wrapper-small` SCSS rule (`.pressed` stays — still used by video-row/error.tsx).

Net: ~377 lines of dead code gone, no visible UI change.
@CGastrell CGastrell force-pushed the change/videopress-checkbox-cleanup branch from 6a52b8c to e0e2237 Compare April 18, 2026 19:53
@jp-launch-control
Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 3 files.

File Coverage Δ% Δ Uncovered
projects/packages/videopress/src/client/admin/components/video-filter/index.tsx 6/26 (23.08%) -1.92% -1 💚
projects/packages/videopress/src/client/admin/components/video-row/index.tsx 5/48 (10.42%) 2.48% -15 💚
projects/packages/videopress/src/client/admin/components/video-list/index.tsx 2/26 (7.69%) 3.15% -18 💚

Full summary · PHP report · JS report

Coverage check overridden by Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR .

@CGastrell CGastrell merged commit 2729ce2 into trunk Apr 19, 2026
75 checks passed
@CGastrell CGastrell deleted the change/videopress-checkbox-cleanup branch April 19, 2026 12:27
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Page React-powered dashboard under the Jetpack menu Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR [Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Base Styles [JS Package] Components [Package] Backup [Package] Newsletter [Package] Publicize [Package] Search Contains core Search functionality for Jetpack and Search plugins [Package] VideoPress [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. RNA [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants