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

Updates the styling of the AI buttons #21415

Conversation

Jordi-PV
Copy link
Contributor

@Jordi-PV Jordi-PV commented May 29, 2024

Context

  • We want to change the styling of the AI assessment fixes buttons to differentiate them from the rest of the assessment buttons, and apply a recognizable style for all AI functionalities in the plugin.

Summary

This PR can be summarized in the following changelog entry:

  • Updates the styling of the AI assessment fixes buttons.

Relevant technical choices:

  • I've created an styled-components button AIFixesButton based on the IconButtonBase used for the rest of the assessments functionalities.
  • The border and background properties of the styled-components button, don't accept function rules like linear-gradient(). The work around is to use the border-image and background-image properties.
  • To be able to "manipulate" and add the gradient effect colors to the sparkles icon of the button, we have created a new SparklesIcon component instead of use the heroicon one.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Have Yoast SEO and Yoast SEO Premium activated.
  • Open or create a new post. Make sure to have enough content and also add a focus keyphrase.
  • Use the block editor.
  • Ensure that the keyphrase is not included in the first paragraph/introduction and that it isn't used more than once in the content.
  • Open the Premium SEO analysis tab in the Yoast Premium SEO > SEO or in the Yoast SEO sidebar.
SCR-20240604-oftc
  • Check that the Keyphrase in introduction and Keyphrase density and Keyphrase distribution assessments aren't green and show the sparkle button of the AI assessments fixes project.
  • Verify that the button has a sparkle icon with a gradient effect from purple to blue, and the border of the button has the same gradient effect.
  • Check that the button has a gray shadow at the bottom.
SCR-20240604-ounp
  • Verify that when hovering over the button with the mouse, the cursor changes to a pointer.
  • Verify that the tooltip with the "FIx with AI" text is shown.
  • Check that the button's background also changes to a slightly darker gradient effect.
  • Check that the gray shadow at the bottom of the button is still present.
SCR-20240604-ouao
  • Verify that when the button is pressed the background changes to a darker gradient effect from purple to blue and the sparkle icon turns white. The button should also have a dark-pink shadow at the bottom.
SCR-20240604-ottx

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

Copy link

github-actions bot commented May 29, 2024

@vraja-pro Please be aware that following packages have been abandoned and are not actively maintained anymore:

Package name Path
@yoast/babel-preset packages/babel-preset
@yoast/components packages/components
@yoast/e2e-tests packages/e2e-tests
@yoast/helpers packages/helpers
@yoast/jest-preset packages/jest-preset
@yoast/style-guide packages/style-guide

Please consider using the other packages instead.

@mhkuu mhkuu changed the base branch from trunk to feature/fix-assessments May 29, 2024 13:37
@Jordi-PV Jordi-PV added UI change PRs that result in a change in the UI innovation Innovative issue. Relating to performance, memory or data-flow. labels Jun 4, 2024
@mhkuu mhkuu added this to the feature/fix-assessments milestone Jun 5, 2024
@Jordi-PV Jordi-PV marked this pull request as ready for review June 5, 2024 14:09
@Jordi-PV Jordi-PV requested a review from a team as a code owner June 5, 2024 14:09
@coveralls
Copy link

coveralls commented Jun 6, 2024

Pull Request Test Coverage Report for Build 6541a853dd91f8833f9f1f7d3e59af686e554c1d

Details

  • 19 of 19 (100.0%) changed or added relevant lines in 2 files are covered.
  • 3710 unchanged lines in 106 files lost coverage.
  • Overall coverage decreased (-4.3%) to 48.418%

Files with Coverage Reduction New Missed Lines %
admin/class-option-tabs-formatter.php 1 0.0%
src/actions/configuration/first-time-configuration-action.php 1 91.84%
src/builders/indexable-home-page-builder.php 1 98.0%
src/builders/indexable-term-builder.php 1 99.15%
src/context/meta-tags-context.php 1 28.29%
src/generators/breadcrumbs-generator.php 1 64.23%
src/generators/schema/webpage.php 1 90.32%
src/integrations/blocks/structured-data-blocks.php 1 16.0%
src/integrations/settings-integration.php 1 28.49%
src/integrations/watchers/indexable-ancestor-watcher.php 1 98.41%
Totals Coverage Status
Change from base Build d5d0a48b1bb965a14f46d58478ae2aa521f42520: -4.3%
Covered Lines: 25080
Relevant Lines: 53671

💛 - Coveralls

</>
);
};

Copy link
Contributor

Choose a reason for hiding this comment

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

I would separate this component to a a file of it's own.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can place it back to "Needs changes" when you finish the review 😃

@coveralls
Copy link

coveralls commented Jun 7, 2024

Pull Request Test Coverage Report for Build 167d246fb0cacdd406d6bdd2c7c7e6e8107e82f6

Details

  • 19 of 19 (100.0%) changed or added relevant lines in 2 files are covered.
  • 3710 unchanged lines in 106 files lost coverage.
  • Overall coverage decreased (-37.3%) to 15.422%

Files with Coverage Reduction New Missed Lines %
admin/class-option-tabs-formatter.php 1 0.0%
src/actions/configuration/first-time-configuration-action.php 1 91.84%
src/builders/indexable-home-page-builder.php 1 98.0%
src/builders/indexable-term-builder.php 1 99.15%
src/context/meta-tags-context.php 1 28.29%
src/generators/breadcrumbs-generator.php 1 64.23%
src/generators/schema/webpage.php 1 90.32%
src/integrations/blocks/structured-data-blocks.php 1 16.0%
src/integrations/settings-integration.php 1 28.49%
src/integrations/watchers/indexable-ancestor-watcher.php 1 98.41%
Totals Coverage Status
Change from base Build d5d0a48b1bb965a14f46d58478ae2aa521f42520: -37.3%
Covered Lines: 3227
Relevant Lines: 22870

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 7, 2024

Pull Request Test Coverage Report for Build 3edaa99df65a8ae55c4bb980a99dcccdbf2306cd

Details

  • 19 of 19 (100.0%) changed or added relevant lines in 2 files are covered.
  • 3710 unchanged lines in 106 files lost coverage.
  • Overall coverage decreased (-4.3%) to 48.416%

Files with Coverage Reduction New Missed Lines %
admin/class-option-tabs-formatter.php 1 0.0%
src/actions/configuration/first-time-configuration-action.php 1 91.84%
src/builders/indexable-home-page-builder.php 1 98.0%
src/builders/indexable-term-builder.php 1 99.15%
src/context/meta-tags-context.php 1 28.29%
src/generators/breadcrumbs-generator.php 1 64.23%
src/generators/schema/webpage.php 1 90.32%
src/integrations/blocks/structured-data-blocks.php 1 16.0%
src/integrations/settings-integration.php 1 28.49%
src/integrations/watchers/indexable-ancestor-watcher.php 1 98.41%
Totals Coverage Status
Change from base Build d5d0a48b1bb965a14f46d58478ae2aa521f42520: -4.3%
Covered Lines: 25080
Relevant Lines: 53671

💛 - Coveralls

</>
);
};

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add a snapshot test for this one @Jordi-PV

Copy link
Contributor

Choose a reason for hiding this comment

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

Update: I took care of that

@vraja-pro
Copy link
Contributor

CR & AC ✅

@coveralls
Copy link

coveralls commented Jun 7, 2024

Pull Request Test Coverage Report for Build 349d2c7248ed9ca909f869f9ef94b8123fc0311b

Details

  • 20 of 20 (100.0%) changed or added relevant lines in 2 files are covered.
  • 3710 unchanged lines in 106 files lost coverage.
  • Overall coverage decreased (-4.3%) to 48.416%

Files with Coverage Reduction New Missed Lines %
admin/class-option-tabs-formatter.php 1 0.0%
src/actions/configuration/first-time-configuration-action.php 1 91.84%
src/builders/indexable-home-page-builder.php 1 98.0%
src/builders/indexable-term-builder.php 1 99.15%
src/context/meta-tags-context.php 1 28.29%
src/generators/breadcrumbs-generator.php 1 64.23%
src/generators/schema/webpage.php 1 90.32%
src/integrations/blocks/structured-data-blocks.php 1 16.0%
src/integrations/settings-integration.php 1 28.49%
src/integrations/watchers/indexable-ancestor-watcher.php 1 98.41%
Totals Coverage Status
Change from base Build d5d0a48b1bb965a14f46d58478ae2aa521f42520: -4.3%
Covered Lines: 25081
Relevant Lines: 53672

💛 - Coveralls

@mhkuu mhkuu merged commit 7293537 into feature/fix-assessments Jun 7, 2024
16 of 17 checks passed
@mhkuu mhkuu deleted the update-styling-of-sparkle-buttons-ai-assessment-fixes branch June 7, 2024 11:54
@mhkuu mhkuu added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Jul 1, 2024
@mhkuu mhkuu changed the title Update styling of sparkle buttons ai assessment fixes Updates the styling of the AI buttons Jul 16, 2024
@mhkuu mhkuu modified the milestones: feature/fix-assessments, 23.2 Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog innovation Innovative issue. Relating to performance, memory or data-flow. UI change PRs that result in a change in the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants