Skip to content

Stops showing the introduction modals in the FTC#22489

Merged
thijsoo merged 4 commits intotrunkfrom
711-dont-show-introduction-in-first-time-configuration
Aug 14, 2025
Merged

Stops showing the introduction modals in the FTC#22489
thijsoo merged 4 commits intotrunkfrom
711-dont-show-introduction-in-first-time-configuration

Conversation

@leonidasmi
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi commented Aug 11, 2025

Context

Summary

This PR can be summarized in the following changelog entry:

  • Improves the UX of onboarding new users by preventing irrelevant modals from displaying in the First Time Configuration.

Relevant technical choices:

  • The solution that was implemented should work with modals created and registered by Premium too. As in, when Premium registers a modal that shows in Yoast admin pages, it should not appear in FTC and when we reach the FTC, we need to have that request set the introduction as not seen again
    • Due to the fact that Premium doesnt register such modal currently, we have to do some hacks to make it do that. All that is described in the Test with Premium introduction modals (for devs only) section.
  • There was also a minor change where the _yoast_wpseo_introductions usermeta key was replaced with the Introductions_Seen_Repository::USER_META_KEY, to allow devs find the usage of that key easier in the future.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • In a fresh site (or with the _yoast_wpseo_introductions usermeta deleted from the db), open the General page, but straight to the FTC
    • you can use the link here: (/wp-admin/admin.php?page=wpseo_dashboard#/first-time-configuration), or you can install the plugin in a fresh site and you will be presented with a link to the FTC
  • Confirm that you don't see any introduction modal there
  • Go to any other Yoast admin page and confirm that you now see the introduction modal (which now should be the announcement for the upcoming AI Brand Insights feature)
  • Go to any other Yoast admin page again and confirm that you now don't see the modal again
  • Go to any other Yoast admin page with a different user and confirm that you see the modal again

Note: The fact that you don't see the introduction when you go to the FTC and then navigate to Dashboard or Alert center is a known limitation of the current implementation and described here.

Test with Premium introduction modals (for devs only):

  • We need to check that our solution works also for introduction modals that are created and displayed by Premium. We currently dont have such modals appearing in Yoast page, but we have to ensure that if we ever do, they wont appear in the FTC.
  • Since we don't currently have introduction modals appearing in Yoast admin pages, we'll need to hack some files to make it like we do:
    • Ensure every other introduction is not intefering by having them marked as seen or should_show false
      • In the case of what we currently have as introduction modal, we have to add a return false; early in AI_Brand_Insights_Pre_Launch::should_show() and empty the initial components (const initialComponents = {};) in packages\js\src\introductions\initialize.js
    • In Premium, make the AI Optimize Classic introduction appear in Yoast admin pages, possibly by adding return true; in AI_Optimize_Classic_Introduction::should_show()
    • For some JS reason that modal doesn't show in Yoast admin pages even with that hack in, so let's make sure we display something, to make our tests easier. In assets\js\src\introductions\initialize.js replace the register with register( "ai-optimize-classic", () => <div style={ { position: "absolute", alignSelf: "center", justifySelf: "center", inset: 0, fontSize: "20rem" } }>HELLO!!</div> );
  • Now, if you visit any Yoast admin page, you'll see (after a couple of seconds, because of that timeout) the HELLO appearing
  • If you visit any Yoast admin page again, you wont see the HELLO again.
  • Reset usermeta and go straight to the FTC (with the Network tab open)
  • Wait some seconds and confirm that you dont see the HELLO
  • In the network tab, you see the /wp-json/yoast/v1/introductions/ai-optimize-classic/seen?_locale=user request
  • Go to another page and confirm that you do see the HELLO

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.

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 #

@leonidasmi leonidasmi added the changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog label Aug 11, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Aug 11, 2025

Pull Request Test Coverage Report for Build 07ede00b851a4d772f8c4dea47e6335593a19b03

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

  • 2 of 13 (15.38%) changed or added relevant lines in 2 files are covered.
  • 139 unchanged lines in 13 files lost coverage.
  • Overall coverage decreased (-0.07%) to 52.835%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/introductions/initialize.js 0 11 0.0%
Files with Coverage Reduction New Missed Lines %
packages/js/src/shared-admin/components/sidebar-recommendations.js 1 66.67%
packages/js/src/introductions/components/provider.js 1 0.0%
packages/js/src/general/components/sidebar-layout.js 2 0.0%
packages/js/src/introductions/initialize.js 2 0.0%
packages/js/src/general/components/connected-premium-upsell-list.js 3 0.0%
packages/js/src/shared-admin/components/premium-upsell-list.js 3 18.75%
packages/js/src/support/app.js 4 0.0%
packages/js/src/helpers/get-premium-benefits.js 6 20.0%
packages/js/src/settings/app.js 7 0.0%
packages/js/src/shared-admin/components/premium-upsell-card.js 9 11.11%
Totals Coverage Status
Change from base Build 81d2b4dba47f1f36d53a30afb3079916e29c1e30: -0.07%
Covered Lines: 31240
Relevant Lines: 59778

💛 - Coveralls

@leonidasmi leonidasmi marked this pull request as ready for review August 12, 2025 08:54
Comment thread packages/js/src/introductions/initialize.js Outdated
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 added this to the 25.9 milestone Aug 14, 2025
@thijsoo thijsoo merged commit 0a48730 into trunk Aug 14, 2025
38 checks passed
@thijsoo thijsoo deleted the 711-dont-show-introduction-in-first-time-configuration branch August 14, 2025 13:37
@enricobattocchi enricobattocchi added this to the 25.9 milestone Aug 28, 2025
@leonidasmi leonidasmi mentioned this pull request Sep 12, 2025
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants