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

My Jetpack: Fix Protect card Tooltip placement & content issues #40691

Merged
merged 9 commits into from
Dec 21, 2024

Conversation

elliottprogrammer
Copy link
Contributor

@elliottprogrammer elliottprogrammer commented Dec 19, 2024

This PR fixes a few minor issues with the placement and content of the Tooltips in the Protect product card in My Jetpack.

Original issues (screenshots):

Mobile view - Tooltip issues

Threats Tooltip Auto-firewall Tooltip (Mobile view)
protect-before Screen Shot on 2024-12-19 at 16-04-06

** Notice in the "Auto-fix threats" tooltip (left img), it says "The last scan identified 6 critical threats.. But..."; This is wrong, as you can see, there is 6 (regular) threats and 1 critical threat.
This PR also fixes this incorrect wording ⤴️.

Fixes #40433

Proposed changes:

  • Fixes the appearance "Auto-fix threats" tooltip (increases the width to better fit the content)
  • Fixes the wording/content in the "Auto-fix threats" tooltip with the correct distinction between the number of (regular) threats and critical threats. Also adjusts wording to make it a little more clear that not all threats can be auto-fixed.
  • Fixes the "Auto-firewall" tooltip, on mobile so that half of it is no longer overflowing off the side of the viewport.

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:

  • Install/activate Jetpack Protect with a Scan upgrade
  • Using the Scan Helper in the Jetpack Debug Helper/Tools plugin, select the first EIACAR Threats selection to Add five EICAR threats to the site (one for every severity).
  • Run a scan to detect them
  • Proceed to the My Jetpack section, scroll down to the Protect product card.
  • Hover over and click the "Threats" info icon tooltip to view the tooltip. It should look like this screenshot:
Desktop Mobile
Screen Shot on 2024-12-20 at 02-01-38 Screen Shot on 2024-12-20 at 02-02-35
  • In mobile view Hover over and click the "Auto-firewall" info icon tooltip. It should look like this screenshot:

Screen Shot on 2024-12-19 at 14-06-38

  • Thats it!

@elliottprogrammer elliottprogrammer self-assigned this Dec 19, 2024
Copy link
Contributor

github-actions bot commented Dec 19, 2024

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 update/my-jetpack-fix-protect-card-tooltips branch.

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

    bin/jetpack-downloader test jetpack update/my-jetpack-fix-protect-card-tooltips
    

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 Dec 19, 2024

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!

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Dec 19, 2024
@elliottprogrammer elliottprogrammer requested a review from a team December 20, 2024 07:12
@elliottprogrammer elliottprogrammer added [Status] Needs Team Review and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Dec 20, 2024
@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Dec 20, 2024
CodeyGuyDylan
CodeyGuyDylan previously approved these changes Dec 20, 2024
Copy link
Contributor

@CodeyGuyDylan CodeyGuyDylan left a comment

Choose a reason for hiding this comment

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

I left a few minor comments but I don't see any as blocking. The translator comment should be fixed before deploying but that won't require a re-review

ownerDocument?: Document;
};

export type PopoverProps = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing the Popover WordPress component doesn't have an exported types we could use instead? If not, how hard would it be to add them there? Only asking because the ideal scenario would be to have the component type itself, but I understand that may be more difficult than it's worth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah right, the Popover WordPress component doesn't have any exported types, unfortunately. But yeah you're right, it would be nice if it did! 👍
I'll add a followup maintenance task to update the WordPress Popover component to export the Popover type, and then come back here to clean up the InfoTooltip types.

if ( isProtectPluginActive ) {
return protectPluginDashboardUrl;
}
return `https://cloud.jetpack.com/scan/${ siteSuffix }`;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just an idea and I'm not sure how much better it would be, but it might be useful to have a getJetpackCloudLink utility function that could be used like

return getJetpackCloudLink( `/scan/${sitesuffix}` );

Let me know what you think 😄

Copy link
Contributor Author

@elliottprogrammer elliottprogrammer Dec 20, 2024

Choose a reason for hiding this comment

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

Actually I refactored this..
Instead, I refactored class Protect::get_manage_url() function to return either the Protect plugin dashboard url or the Jetpack Cloud Scan url based on whether the standalone or Jetpack plugin is installed & activated.
Then I pull and use that url here in use-protect-tooltip-copy.ts. I think this would be the more appropriate solution. What do you think?

@elliottprogrammer elliottprogrammer removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Dec 20, 2024
@elliottprogrammer elliottprogrammer requested a review from a team December 20, 2024 21:41
@elliottprogrammer elliottprogrammer merged commit 1b69987 into trunk Dec 21, 2024
73 checks passed
@elliottprogrammer elliottprogrammer deleted the update/my-jetpack-fix-protect-card-tooltips branch December 21, 2024 14:02
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.

My Jetpack: Protect card Threats tooltip styles/content issues
2 participants