Skip to content

fix the widgets visibility on connect and tab navigation#22069

Merged
thijsoo merged 7 commits intotrunkfrom
fix-site-kit-widgets-visibility
Feb 26, 2025
Merged

fix the widgets visibility on connect and tab navigation#22069
thijsoo merged 7 commits intotrunkfrom
fix-site-kit-widgets-visibility

Conversation

@vraja-pro
Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro commented Feb 21, 2025

Context

  • Once connected, the site kit widget should be dismissed by the "Got it!" button.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes unreleased bug where the site kit widget "Top 5 mot popular content" would disappear on tab navigation.

Relevant technical choices:

  • Since the initial list of widgets before site kit is connected doesn't include the "Top 5 most popular content" widget, I had to add that with condition in the widget factory, that solves the bug where the "Top 5 most popular content" widget would disappear on tab navigation.
  • Adding and removing the widgets from inside the site kit widget would create duplication because of the condition above. The removing or adding would change the state and in turn would re-render the dashboard component. That is why I used the remove callback with empty string to only re-render the dashboard.
  • I updated the factory data for site kit setup dismissed permanently without calling the endpoint , for the "dismissed until next visit" and "Got it!" buttons, to avoid re-rendering of the setup widget on tab change ( approved by ux).

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Connect to site kit and check you still see the set up widget with a button "Got it!"
  • Check the widgets "Top 5 most popular content" and "Top 5 search queries" are below it.
  • Navigate to other tabs in the dashboard like alert center or first time configuration and return to the dashboard.
  • Check both widgets are still there.
  • Click on "Got it" and check the set up widget disappears
  • Navigate to other tabs in the dashboard like alert center or first time configuration and return to the dashboard.
  • Check the setup widget is still not there.
  • Go to integration page and disconnect the widget.
  • Go back to the dashboard and check you see the set up widget again.
  • Click on the the 3 vertical dots menu and dismiss until next visit.
  • Go to other tabs and return to the dashboard.
  • Check you don't see the setup widget.
  • Refresh and check you do see the set up widget again.

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 Fix sit kit set up flow and tab navigation

@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Feb 21, 2025
Comment thread packages/js/src/dashboard/services/widget-factory.js Outdated
Comment thread packages/js/src/dashboard/services/widget-factory.js Outdated
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 23, 2025

Pull Request Test Coverage Report for Build 603fab81a98c253ac00401ce08646120029c42a3

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

  • 15 of 27 (55.56%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 57.906%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/dashboard/services/data-provider.js 3 6 50.0%
packages/js/src/general/initialize.js 0 3 0.0%
packages/js/src/dashboard/components/dashboard.js 0 6 0.0%
Totals Coverage Status
Change from base Build f709a8bfb5ba868df873f15a28afbb0c35197f8e: 0.03%
Covered Lines: 13696
Relevant Lines: 23295

💛 - Coveralls

@github-actions
Copy link
Copy Markdown

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

@vraja-pro vraja-pro force-pushed the fix-site-kit-widgets-visibility branch from 2d37e71 to 436b1ae Compare February 25, 2025 09:25
@thijsoo thijsoo added this to the 24.7 milestone Feb 26, 2025
Copy link
Copy Markdown
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

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

CR + ACC 👍

@thijsoo thijsoo merged commit 7cbd663 into trunk Feb 26, 2025
@thijsoo thijsoo deleted the fix-site-kit-widgets-visibility branch February 26, 2025 14:32
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.

3 participants