Skip to content

Fix edit buttons for woo assessments#22654

Merged
FAMarfuaty merged 5 commits intorelease/26.2from
fix-edit-buttons-for-woo-assessments
Oct 17, 2025
Merged

Fix edit buttons for woo assessments#22654
FAMarfuaty merged 5 commits intorelease/26.2from
fix-edit-buttons-for-woo-assessments

Conversation

@agnieszkaszuba
Copy link
Copy Markdown
Contributor

@agnieszkaszuba agnieszkaszuba commented Oct 16, 2025

Context

  • The tooltip and buttons for SKU and Product identifier in the SEO analysis for woo products was broken.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes an unreleased bug where the edit buttons for the SKU and product identifiers assessments would be broken.

Relevant technical choices:

  • Similar to what happened in this issue, the tooltip wouldn't dismiss after clicking the button because it was still focus. I decided to apply a blur() event to prevent the focus staying in the button.

Test instructions

Test instructions for the acceptance test before the PR gets merged

Warning

Please test together with the accompanying woocommerce PR

This PR can be acceptance tested by following these steps:

  • Install Yoast Free, Woocommerce and Yoast SEO: WooCommerce
  • Open or create a new product
  • Open the SEO analysis tab in the metabox
  • Find the suggestions for Product Identifier and SKU in the improvements section.
image
  • Hover over the edit buttons for the Product Identifiers assessment
  • Confirm that you see a tooltip with the label Edit your product identifiers
image
  • Click on the button and confirm that you are redirected (screen scroll) to the Product Identifiers section tab.
  • Scroll down to find the assessment in the Improvement section again.
  • Confirm that the tooltip of the edit button isn't visible.
  • Hover over the SKU assessmente edit button.
  • Confirm that you see a tooltip with the label: Edit your SKU
image
  • Click on the button and confirm that you are redirected (screen scroll) to the SKU section tab.
  • Scroll down to find the assessment in the Improvement section again.
  • Confirm that the tooltip of the edit button isn't visible.

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:

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 #2645

@coveralls
Copy link
Copy Markdown

coveralls commented Oct 16, 2025

Pull Request Test Coverage Report for Build 3e51d8c7a99dfc5a99c224027fffd22b07246fd3

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 4 of 6 (66.67%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 53.213%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/analysis-report/src/AnalysisList.js 0 1 0.0%
packages/js/src/components/contentAnalysis/Results.js 0 1 0.0%
Totals Coverage Status
Change from base Build 0da602d2266fb2e31a78ed47bbaf04ea0f87a7da: 0.001%
Covered Lines: 31853
Relevant Lines: 60140

💛 - Coveralls

@JorPV JorPV added the changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog label Oct 17, 2025
@JorPV JorPV added changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog and removed changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog labels Oct 17, 2025
@JorPV JorPV marked this pull request as ready for review October 17, 2025 06:55
onButtonClickMarks={ () => onMarksButtonClick( result.id, result.marker ) }
onButtonClickEdit={ () => onEditButtonClick( editFieldName ) }
onButtonClickEdit={ ( event ) => {
event?.currentTarget?.blur();
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.

This is a good idea! However, I would move it to inside the onEditButtonClick function itself for the following reason:

  • onEditButtonClick might be undefined or not used by all consumers (e.g. Shopify SEO). Placing the blurring outside means the blur code might run (or error) even if there's no edit handler, which could be problematic.

@FAMarfuaty FAMarfuaty added this to the 26.2 milestone Oct 17, 2025
Copy link
Copy Markdown
Contributor

@FAMarfuaty FAMarfuaty left a comment

Choose a reason for hiding this comment

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

CR and AT ✅
Code looks good and everything works as expected, including the existing edit buttons for other assessments

Note: I only pushed a small commit to move the blur to inside the onEditButtonClick handler

@FAMarfuaty FAMarfuaty merged commit 6d52e29 into release/26.2 Oct 17, 2025
19 checks passed
@FAMarfuaty FAMarfuaty deleted the fix-edit-buttons-for-woo-assessments branch October 17, 2025 08:31
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants