Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Bar: Add Action Bar visibility general setting #41015

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

ntsekouras
Copy link
Member

Part of: Automattic/wp-calypso#53830

This PR adds a new general setting (wpcom_show_action_bar) to conditionally show the Action Bar on the front end of a site. It adds the interface for the classic wp-admin interface and its default value is true to preserve current behavior where we always show the Action Bar.

The main issue will need two more PRs to be complete that I'll create and link shortly:

  1. wpcom to check this option and not enqueue the Action Bar
  2. calypso to add UI for this setting.

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)?

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

I saw that some other settings are being tracked. Do we need to do the same for this one?

Testing instructions:

  1. For now (until I create the other PRs) you can go in classic wp-admin interface and check the UI for this new setting and observe that its value is being updated properly and defaults to true.

@ntsekouras ntsekouras added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] In Progress [Status] Needs Team Review [Plugin] mu wpcom jetpack-mu-wpcom plugin labels Jan 14, 2025
@ntsekouras ntsekouras self-assigned this Jan 14, 2025
Copy link
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 a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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.


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? Reach out in #jetpack-developers for guidance!


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2).

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 [Package] Jetpack mu wpcom WordPress.com Features label Jan 14, 2025
Copy link
Contributor

github-actions bot commented Jan 14, 2025

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 add/action-bar-visibility-general-setting branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/action-bar-visibility-general-setting
    

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

* The setting is displayed only if the has the wp-admin interface selected.
*/
function wpcomsh_wpcom_show_action_bar_settings_field() {
add_settings_field( 'wpcom_show_action_bar', '', 'wpcom_show_action_bar_display', 'general', 'default' );
Copy link
Member Author

Choose a reason for hiding this comment

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

I realized that atomic sites don't show the Action Bar and I'm wondering whether we should check about the type before adding this setting ( at least for now ). 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we should check if the site is Simple before running this.

Alternatively, if there are no plans to bring the action bar to Atomic sites, you could implement this logic directly in the wpcom repo, which only runs on Simple sites.

Choose a reason for hiding this comment

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

There is an issue asking for the action bar in atomic sites: Automattic/wp-calypso#36795

In order to do that, I think we should move the actionbar mu-plugin from wpcom repo to jetpack-wpcom-mu-plugin or something like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

In order to do that, I think we should move the actionbar mu-plugin from wpcom repo to jetpack-wpcom-mu-plugin or something like that.

Yes. @cbravobernal is something you're working on? My linked issue with yours are kind of co-dependent.

Copy link

@cbravobernal cbravobernal Jan 15, 2025

Choose a reason for hiding this comment

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

Not yet, I was checking how to do it while I found this task and decided to wait. Feel free to take it if you feel more comfortable tackling all together.

Copy link
Member Author

Choose a reason for hiding this comment

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

@cbravobernal sounds good. I'll see what's decided about atomic and handle these two issues accordingly.

Copy link
Member

Choose a reason for hiding this comment

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

if there are no plans to bring the action bar to Atomic sites, you could implement this logic directly in the wpcom repo, which only runs on Simple sites.

I would also recommend keeping things together in the dotcom codebase for now. It will make it easier to move things around when/if we eventually bring the action bar to WoA sites.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. I'll port these changes to dotcom.

* The setting is stored in the `wpcom_show_action_bar` option.
* The setting is displayed only if the has the wp-admin interface selected.
*/
function wpcomsh_wpcom_show_action_bar_settings_field() {
Copy link
Member

Choose a reason for hiding this comment

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

The wpcom-admin-interface.php file was intended to contain logic involving the different admin interfaces (Default, Classic), so I'd move this part to somewhere else. Maybe you can add a new features/action-bar/action-bar.php file?

Also, this isn't a wpcomsh function, so I'd remove that prefix.

Suggested change
function wpcomsh_wpcom_show_action_bar_settings_field() {
function wpcom_show_action_bar_settings_field() {

* The setting is displayed only if the has the wp-admin interface selected.
*/
function wpcomsh_wpcom_show_action_bar_settings_field() {
add_settings_field( 'wpcom_show_action_bar', '', 'wpcom_show_action_bar_display', 'general', 'default' );
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we should check if the site is Simple before running this.

Alternatively, if there are no plans to bring the action bar to Atomic sites, you could implement this logic directly in the wpcom repo, which only runs on Simple sites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[mu wpcom Feature] Wpcom Admin Interface [Package] Jetpack mu wpcom WordPress.com Features [Plugin] mu wpcom jetpack-mu-wpcom plugin [Status] In Progress [Status] Needs Team Review [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants