Skip to content

Paid/Premium blocks: Fix cover block alignments on free sites - #35028

Merged
miksansegundo merged 3 commits into
trunkfrom
fix/paid-blocks-upgrade-nudge-break-cover-block-free
Jan 16, 2024
Merged

miksansegundo merged 3 commits into
trunkfrom
fix/paid-blocks-upgrade-nudge-break-cover-block-free

Conversation

@miksansegundo

@miksansegundo miksansegundo commented Jan 15, 2024 •

Copy link
Copy Markdown
Contributor

Fixes Automattic/wp-calypso#71882 Automattic/wp-calypso#79025
Related #27909

Proposed changes:

  • Disable max-width on the div wrapper introduced on free sites to show the upgrade nudge.

The div was added in #27909. This fix doesn't allow the editor to apply the content size max-width on it because it's not content

See the CSS that is overwritten:

Screenshot 2567-01-15 at 15 45 44

Note

Other options to solve this issue can be:

  • Any option better than unset for max-width?
  • Add a classname and put the CSS fix in the editor stylesheet for Paid blocks.
  • Can we show the upgrade nudge without adding that div element?
BEFORE AFTER
Screenshot 2567-01-15 at 15 34 15 Screenshot 2567-01-15 at 15 35 14

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

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

Testing instructions:

  • Sandbox a free site
  • Apply these changes on your sandbox
  • Go to /themes, search for "Blockstar", open the theme detail, and click "Preview & Customize"
  • Verify the width of the cover image on the header is the canvas full-width

@miksansegundo
miksansegundo requested review from a team and BogdanUngureanu January 15, 2024 09:01
@miksansegundo miksansegundo self-assigned this Jan 15, 2024
@github-actions github-actions Bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Jan 15, 2024
@github-actions

github-actions Bot commented Jan 15, 2024 •

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 Team 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 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for February 6, 2024 (scheduled code freeze on February 5, 2024).

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

@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 Jan 15, 2024
@github-actions

github-actions Bot commented Jan 15, 2024 •

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 WordPress.com Simple 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, and enable the fix/paid-blocks-upgrade-nudge-break-cover-block-free branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack fix/paid-blocks-upgrade-nudge-break-cover-block-free
    

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

@fushar

fushar commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

Any option better than none for max-width?

Just answering this specific question, from my past job, I've found that using unset is better semantically 😄

@fushar

fushar commented Jan 15, 2024 •

Copy link
Copy Markdown
Contributor

Can we show the upgrade nudge without adding that div element?

Just brainstorming (haven't tried yet), but what if we move the <BlockEdit { ...props } /> outside the new <div>, so it is a direct child of the <PaidBlockProvider>?

@miksansegundo miksansegundo added [Status] Needs Team Review Obsolete. Use Needs Review instead. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jan 15, 2024
@miksansegundo

miksansegundo commented Jan 15, 2024 •

Copy link
Copy Markdown
Contributor Author

Just brainstorming (haven't tried yet), but what if we move the <BlockEdit { ...props } /> outside the new div...?

I did a test in #35030, and it works, but then the upgrade nudge is not visible because the block toolbar overlaps it.

Screenshot 2567-01-15 at 18 04 54

The best option I have found is moving it over the block so it's not overlapped by the toolbar, which works for the Cover block. We have to check how a change in this code affects other paid blocks. I think they are called Premium blocks. See PCYsg-sZ6-p2

Screenshot 2567-01-15 at 18 08 39

The block toolbar is automatically positioned and that makes it hard to create room to position the nudge.

I think we could merge the CSS change on this PR to fix the issue, and then follow up with another to remove the div from all premium blocks, making sure it looks good. WDYT?

@miksansegundo miksansegundo changed the title Payment blocks: Fix cover block alignments on free sites Paid/Premium blocks: Fix cover block alignments on free sites Jan 15, 2024

@fushar fushar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could merge the CSS change on this PR to fix the issue, and then follow up with another to remove the div from all premium blocks, making sure it looks good. WDYT?

Makes sense to me!

@miksansegundo
miksansegundo force-pushed the fix/paid-blocks-upgrade-nudge-break-cover-block-free branch from e097282 to dfbc566 Compare January 16, 2024 04:21
@miksansegundo
miksansegundo merged commit 7ac5b0d into trunk Jan 16, 2024
@miksansegundo
miksansegundo deleted the fix/paid-blocks-upgrade-nudge-break-cover-block-free branch January 16, 2024 04:48
@github-actions github-actions Bot removed the [Status] Needs Team Review Obsolete. Use Needs Review instead. label Jan 16, 2024
@github-actions github-actions Bot added this to the jetpack/13.1 milestone Jan 16, 2024
@iamtakashi

Copy link
Copy Markdown
Contributor

Thanks, @miksansegundo, for fixing the bug. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover Block: wide width and full width alignments not rendered in editor - impacts FSE themes on sites lower than Premium Plan

3 participants