Skip to content

VideoPress: restructure upgrade notice as Title + Description + ActionButton#49400

Merged
CGastrell merged 3 commits into
trunkfrom
fix/videopress-upgrade-cta-black-button
Jun 5, 2026
Merged

VideoPress: restructure upgrade notice as Title + Description + ActionButton#49400
CGastrell merged 3 commits into
trunkfrom
fix/videopress-upgrade-cta-black-button

Conversation

@CGastrell
Copy link
Copy Markdown
Contributor

@CGastrell CGastrell commented Jun 4, 2026

Fixes the upgrade-notice CTA styling regression reported by @obenland on #48909 (comment).

Proposed changes

  • PR Componentry: migrate ContextualUpgradeTrigger to @wordpress/ui Notice #48909 migrated the legacy ContextualUpgradeTrigger on the VideoPress admin page to a @wordpress/ui Notice, rendering the CTA via <Notice.ActionButton>. base-ui styles that as a dark/high-contrast (black) button, which "looks quite out of place" on the page.
  • Per PR review (thanks @keoshi and @simison): @keoshi preferred a clear button over a long text link, and @simison suggested structuring the notice as two balanced lines — a Notice.Title plus a Notice.Description — followed by Notice.Actions > Notice.ActionButton. This PR adopts exactly that structure.
  • The notice now renders:
    • <Notice.Title> — a contextual heads-up line. Before the first upload it reads "The free plan includes one video upload."; after a video has been uploaded it reads "You have used your free video upload". It is always non-empty.
    • <Notice.Description> — the constant upsell pitch: "Unlock unlimited videos, 1TB of storage, and more!".
    • <Notice.Actions> > <Notice.ActionButton> — a concise "Upgrade" button.
  • Because Notice.ActionButton takes onClick directly, the previous Notice.ActionLink href="#" + event.preventDefault() workaround (the gutenberg#77098 anchor-navigation hack) is dropped entirely.
  • The Notice container migration from Componentry: migrate ContextualUpgradeTrigger to @wordpress/ui Notice #48909 is not reverted — only the action element and copy structure change.
 <Notice.Root intent="info" className={ styles[ 'upgrade-trigger' ] }>
-  <Notice.Description>
-    { hasUsedVideo && ( <>{ UPGRADE_TRIGGER_USED_VIDEO_TEXT }<br /></> ) }
-    { UPGRADE_TRIGGER_UNLOCK_TEXT }
-  </Notice.Description>
-  <Notice.Actions>
-    <Notice.ActionLink href="#" onClick={ e => { e.preventDefault(); onButtonClickHandler(); } }>
-      { cta }
-    </Notice.ActionLink>
-  </Notice.Actions>
+  <Notice.Title>{ title }</Notice.Title>
+  <Notice.Description>{ UPGRADE_TRIGGER_UNLOCK_TEXT }</Notice.Description>
+  <Notice.Actions>
+    <Notice.ActionButton onClick={ onButtonClickHandler }>{ cta }</Notice.ActionButton>
+  </Notice.Actions>
 </Notice.Root>
image

VIDP-245 invariant

base-ui@1.4.1's useRenderElement swaps ref-merge hooks based on the Notice.Root subtree shape; conditionally mounting/unmounting a Notice subcomponent across the hasUsedVideo flip misaligns a stored fork-ref and crashes on the next video upload/delete. So Notice.Title, Notice.Description and Notice.Actions are all rendered unconditionally — only the title text varies via a ternary, keeping the subtree shape stable.

Related product discussion/links

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

No. The click handler still records the jetpack_videopress_upgrade_trigger_link_click Tracks event and still invokes the checkout run workflow. The wiring recordEventHandler( 'jetpack_videopress_upgrade_trigger_link_click', run ) is unchanged; Notice.ActionButton now receives that handler directly as onClick (no anchor, no preventDefault). Verified in the compiled build/admin/index.js bundle: Notice.ActionButton is rendered with onClick: onButtonClickHandler, and onButtonClickHandler = recordEventHandler('jetpack_videopress_upgrade_trigger_link_click', run) is intact.

Testing instructions

The upgrade notice only renders when there is no VideoPress purchase (hasVideoPressPurchase === false). On a site with a VideoPress subscription, remove/cancel it first so the free-tier upgrade notice appears.

  • Go to Jetpack → VideoPress (/wp-admin/admin.php?page=jetpack-videopress).
  • Confirm the notice shows two balanced lines — a bold Notice.Title heads-up ("The free plan includes one video upload." before any upload) and a Notice.Description pitch ("Unlock unlimited videos, 1TB of storage, and more!") — followed by a concise "Upgrade" button (not a black button and not a filled primary button).
  • Upload one video, then revisit: the title should switch to "You have used your free video upload" while the description and button stay the same.
  • Click the Upgrade button and confirm it still kicks off the checkout flow, and that the jetpack_videopress_upgrade_trigger_link_click Tracks event still fires.
  • Sanity-check the VIDP-245 path: upload a video then delete it; the page must not crash (the always-rendered Notice.Title/Notice.Description/Notice.Actions invariant is intact).

…y Button

The ContextualUpgradeTrigger migration to a @wordpress/ui Notice (#48909)
rendered its CTA via Notice.ActionButton, which base-ui styles as a
dark/high-contrast button that looks out of place on the VideoPress admin
page. Swap it for the standard primary Button already imported from
@automattic/jetpack-components, restoring the primary CTA the legacy
trigger rendered.

The click handler is unchanged, so the jetpack_videopress_upgrade_trigger_link_click
Tracks event and the checkout 'run' workflow both still fire. The Notice
container and the always-rendered Notice.Description (VIDP-245 base-ui
ref-merge invariant) are preserved.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 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 fix/videopress-upgrade-cta-black-button branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/videopress-upgrade-cta-black-button

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 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!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jun 4, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented Jun 4, 2026

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/videopress/src/client/admin/components/admin-page/index.tsx 0/27 (0.00%) 0.00% 1 ❤️‍🩹

Full summary · PHP report · JS report

@CGastrell CGastrell changed the title VideoPress: restore primary Button for the upgrade-notice CTA VideoPress: render the upgrade-notice CTA as a Notice.ActionLink Jun 4, 2026
@CGastrell CGastrell self-assigned this Jun 4, 2026
@CGastrell CGastrell added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels Jun 4, 2026
@CGastrell
Copy link
Copy Markdown
Contributor Author

@keoshi any preference between the ActionLink and ActionButton options? (see PR description screenshots)

@keoshi
Copy link
Copy Markdown
Contributor

keoshi commented Jun 4, 2026

Thanks for the ping, @CGastrell !

In this scenario the button clearly indicates a path forward IMHO. The action seems very clear when compared to the long link, so that would be my preference.

@simison
Copy link
Copy Markdown
Member

simison commented Jun 4, 2026

Recommend using title + description for the two lines separately to keep it more balanced visually:

<Notice>
    <Title>
      Notice Title
    </Title>
    <Description>
      Description text.
    </Description>
    <Actions>
      <ActionButton>
        CTA
      </ActionButton>
    </Actions>
</Notice>

Meanwhile this looks to be another case needing WordPress/gutenberg#77098 instead of workarounds. :-)

+  <Notice.ActionLink
+    href="#"
+    onClick={ event => {
+      event.preventDefault();
+      onButtonClickHandler();
+    } }
+  >
+    { cta }
+  </Notice.ActionLink>

…nButton

Per PR #49400 review (keoshi, simison): replace the long text-link CTA
with a concise "Upgrade" Notice.ActionButton, and split the notice copy
into two balanced lines — a Notice.Title contextual heads-up and a
Notice.Description upsell pitch — following simison's structure example.

ActionButton takes onClick directly, so the prior ActionLink href="#" +
preventDefault workaround (gutenberg#77098) is dropped entirely.

VIDP-245 invariant preserved: Title, Description and Actions are all
rendered unconditionally; only the title text varies on hasUsedVideo,
keeping the Notice.Root subtree shape stable so base-ui's ref-merge
hook does not misalign and crash on the next video upload/delete.
@CGastrell CGastrell changed the title VideoPress: render the upgrade-notice CTA as a Notice.ActionLink VideoPress: restructure upgrade notice as Title + Description + ActionButton Jun 4, 2026
@CGastrell
Copy link
Copy Markdown
Contributor Author

Thank you both @keoshi and @simison

This is the current state of the notice now, I'll update on the PR description as well:

image

@CGastrell CGastrell requested a review from obenland June 4, 2026 17:46
@CGastrell CGastrell merged commit 640365f into trunk Jun 5, 2026
80 checks passed
@CGastrell CGastrell deleted the fix/videopress-upgrade-cta-black-button branch June 5, 2026 12:25
@github-actions github-actions Bot removed [Status] In Progress [Status] Needs Review This PR is ready for review. labels Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants