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

MU WPCOM: dashboard: add daily writing prompt #41094

Merged
merged 6 commits into from
Jan 31, 2025

Conversation

ellatrix
Copy link
Contributor

@ellatrix ellatrix commented Jan 15, 2025

image

See Automattic/wp-calypso#95386.

Proposed changes:

  • Added a small new widget with the prompt.

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:

  • With classic style admin enabled, check the Dashboard and test the widget.

Copy link
Contributor

github-actions bot commented Jan 15, 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/dashboard-daily-prompt 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/dashboard-daily-prompt
    

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

Copy link
Contributor

github-actions bot commented Jan 15, 2025

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.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-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 [Package] Jetpack mu wpcom WordPress.com Features [Status] In Progress [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jan 15, 2025
@@ -45,6 +45,8 @@ function () {},
*/
function enqueue_wpcom_dashboard_widgets() {
$handle = jetpack_mu_wpcom_enqueue_assets( 'wpcom-dashboard-widgets', array( 'js', 'css' ) );
global $wp_scripts;
$wp_scripts->registered[ $handle ]->deps[] = 'gutenberg-wpcom-apifetch';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, we need changes to gutenberg-wpcom too so that the custom middleware is added.

@github-actions github-actions bot added [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Wpcomsh labels Jan 16, 2025
@ellatrix ellatrix changed the title MU WPCOM: add daily writing prompt to dashboard MU WPCOM: dashboard: add daily writing prompt Jan 16, 2025
@ellatrix ellatrix force-pushed the add/dashboard-daily-prompt branch from 3614768 to bc7c97c Compare January 16, 2025 20:54
@jameskoster
Copy link
Contributor

Some small design feedback on this one;

  • I think it would be beneficial for the next/previous buttons to be closer to the prompt.
  • There's room to include next/previous labels to avoid ambiguity (and align with General Tasks).
  • I think it would be nice to highlight the prompt a little; padding and background color probably adequate.
Prompt

What do you think?

@ellatrix
Copy link
Contributor Author

I like that! I was trying to make as compact as possible, but this just looks way better!

Copy link
Contributor

github-actions bot commented Jan 29, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-dashboard-widgets.php 0/77 (0.00%) 0.00% 6 💔

Full summary · PHP report · JS report

@ellatrix ellatrix marked this pull request as ready for review January 29, 2025 16:46
@jameskoster
Copy link
Contributor

Looks good to me! :)

@ellatrix ellatrix force-pushed the add/dashboard-daily-prompt branch from 86fe9f4 to 1fdc132 Compare January 30, 2025 17:43
@youknowriad
Copy link
Contributor

Screenshot 2025-01-31 at 10 52 14 AM

This is testing well for me.

Two remarks:

1- The widget is showing up before the "site" widget, should it show up after that one instead?
2- I understand the need for the gray background behind the subjects (especially because of the next/previous links) but it does feel a bit odd design wise to me, maybe too visible or something. I can't pinpoint exactly how I feel.

@youknowriad
Copy link
Contributor

I think what I would prefer design wise, is to remove the gray background and move "next", "previous" next to "view all responses" or alternatively to the top right with a similar link design than "view all responses". Anyway, just random suggestions, no blocker here.

import { useEffect, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { addQueryArgs } from '@wordpress/url';
import moment from 'moment';
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels too much to import moment for that no? Any alternatives?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, can try to avoid it. Honestly, I just copied it from Calypso :)

const [ index, setIndex ] = useState( 0 );
useEffect( () => {
// See projects/packages/jetpack-mu-wpcom/src/features/wpcom-block-editor-nux/src/blogging-prompts-modal/index.js
const path = addQueryArgs( `/wpcom/v3/blogging-prompts`, {
Copy link
Contributor

Choose a reason for hiding this comment

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

I only tested simple so far, does this work for atomic ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Also a bit weird that there's no data layer or something, random apiFetch calls scatters like that are hard to evolve and reason about.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, let's polish this once we have most dashboard functionality in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I only tested simple so far, does this work for atomic ...

Yes, it works on Atomic :)

youknowriad
youknowriad previously approved these changes Jan 31, 2025
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

Other than the position of the widget itself (I prefer under Site) I think this is good to land.

@ellatrix ellatrix merged commit dc14f97 into trunk Jan 31, 2025
61 checks passed
@ellatrix ellatrix deleted the add/dashboard-daily-prompt branch January 31, 2025 15:24
@github-actions github-actions bot removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Status] In Progress labels Jan 31, 2025
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