Skip to content

626 create the feature opt in in the yoast dashboard#22425

Merged
leonidasmi merged 19 commits intotrunkfrom
626-create-the-feature-opt-in-in-the-yoast-dashboard
Jul 15, 2025
Merged

626 create the feature opt in in the yoast dashboard#22425
leonidasmi merged 19 commits intotrunkfrom
626-create-the-feature-opt-in-in-the-yoast-dashboard

Conversation

@vraja-pro
Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro commented Jul 11, 2025

Context

Summary

This PR can be summarized in the following changelog entry:

  • Adds the llm txt opt in.

Relevant technical choices:

  • I decided to save the user meta in a separate meta key and not use the introductions because it is not an introduction modal, and because it's being dismissed immediately on retrieval.
  • Used a the browser cache (sessionStorage) for the popover trigger. Its cleaner than the adding an argument to the url.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Go to general page, check you see the a notification on the bottom left for the llm txt feature:
Screenshot 2025-07-11 at 17 01 06
  • Click on on the Show me button and see you are redirected to the right settings with a popover with backdrop:
Screenshot 2025-07-11 at 17 01 50
  • Dismiss the popover and refresh
  • Check the popover doesn't reappear.
  • Go back to the general page and check you don't see the notification.
  • Reset the user meta wpseo_seen_llm_txt_opt_in_notification
  • Go to general page and check you see the notification again.
  • Dismiss and refresh, check you don't see the notification.
  • Reset the user meta again.
  • Go to general page and check you see the notification again.
  • Refresh, check you don't see the notification.
  • Reset the user meta again
  • Go to the llms.txt settings page and enable the feature
  • Go to the general page and check you don't see the notification.
  • Disable the feature.
  • Log in as a different user and go to the general page
  • Check you see the notification and click on show me
  • Check you see the popover in the settings as expected.
  • Go back to the general page and check you no longer see the notification.

If local/session storage is disabled in the browser:

  • to make sure things still work even if local/session storage is disabled in the browser, let's use Firefox for this ((because it has a way to disable local storage without disabling cookies).
  • Type about:config in the address bar to view advanced settings (you may need to click an "Accept the Risk and Continue" button in order to view settings).
  • Search for "dom.storage.enabled", and double-click on the entry (or use the adjacent toggle button) to toggle its enabled (true) or disabled (false) state.
  • Reset the user meta wpseo_seen_llm_txt_opt_in_notification and refresh the general page.
  • Check you don't get the opt in notification.
  • Go to the lm.txt setting and check you don't get the popover.
  • IMPORTANT: Make sure you revert the dom.storage.enabled preference to true because if you don't, your Firefox will not work properly in the future.

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 Create the feature opt-in in the Yoast dashboard

@vraja-pro vraja-pro added this to the feature/llms-txt-phase-2 milestone Jul 11, 2025
@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Jul 11, 2025
@vraja-pro vraja-pro force-pushed the 626-create-the-feature-opt-in-in-the-yoast-dashboard branch from fc01cd5 to 81f2877 Compare July 13, 2025 18:23
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 13, 2025

Pull Request Test Coverage Report for Build 0c51e5563c15377321089baa91534f0444509a4a

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

  • 16 of 47 (34.04%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 53.638%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/settings/routes/llms-txt.js 0 1 0.0%
packages/js/src/general/components/llm-txt-opt-in-notification.js 1 14 7.14%
packages/js/src/settings/components/llm-txt-popover.js 0 17 0.0%
Totals Coverage Status
Change from base Build a2bd7e124e8fda2c486937b59f8a306770f2e0af: -0.03%
Covered Lines: 30565
Relevant Lines: 57972

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

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

CR: 🏗️

Comment thread src/general/user-interface/general-page-integration.php Outdated
Comment thread src/general/user-interface/general-page-integration.php Outdated
Comment thread src/general/user-interface/general-page-integration.php Outdated
Comment thread tests/Unit/General/User_Interface/General_Page_Integration_Test.php
Comment thread src/general/user-interface/general-page-integration.php Outdated
Comment thread packages/js/src/general/app.js Outdated
Comment thread packages/js/src/settings/routes/llms-txt.js
export const LlmTxtOptInNotification = () => {
const svgAriaProps = useSvgAria();
const llmTxtSettingsUrl = useSelectGeneralPage( "selectAdminLink", [], "?page=wpseo_page_settings#/llms-txt" );
sessionStorage.setItem( "highlight-setting", "llm-txt" );
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.

Have we considered other alternatives to achieve what we want? I'm kind of hesitant to introduce using session storage in our code base (aside from some usage we got from a library) unless it's necessary.

With using session storage, I think we need to consider many more aspects than what we currently do, like:

  • most importantly, we need to give the key a yoast-specific name, to avoid conflicts with third parties, so something like yoast-highlight-setting
  • I think we need to consider cases where session storage is disabled in the user's browser. I'm not sure if defensive coding is needed, but we need to at least test that the feature might not work in those cases but it fails gracefully.
    • There's some examples on how to fail that in the test instructions of this PR.
  • at the very least, using session storage deserves its own technical decision in the PR.

Comment thread packages/js/src/settings/components/llm-txt-popover.js Outdated
Comment thread packages/js/src/settings/routes/llms-txt.js Outdated
@leonidasmi
Copy link
Copy Markdown
Contributor

By the way, although it's more of an acceptance thing, the styling of the popover is quite different from the desings, mostly about margins:
image

Base automatically changed from feature/llms-txt-phase-2 to trunk July 14, 2025 14:01
@vraja-pro vraja-pro force-pushed the 626-create-the-feature-opt-in-in-the-yoast-dashboard branch from 5079c58 to 3cc446c Compare July 15, 2025 08:05
Comment thread packages/js/src/settings/routes/llms-txt.js Outdated
Co-authored-by: Leonidas Milosis <leonidas.milossis@gmail.com>
Comment thread packages/js/src/settings/components/llm-txt-popover.js Outdated
don't show the the notification if session storage is disabled
@leonidasmi leonidasmi removed this from the feature/llms-txt-phase-2 milestone Jul 15, 2025
@leonidasmi leonidasmi modified the milestones: 25.7, 25.6 Jul 15, 2025
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

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

CR + Acceptance is ✅

@leonidasmi leonidasmi merged commit 79fda9f into trunk Jul 15, 2025
54 of 55 checks passed
@leonidasmi leonidasmi deleted the 626-create-the-feature-opt-in-in-the-yoast-dashboard branch July 15, 2025 09:17
@leonidasmi leonidasmi mentioned this pull request Jul 15, 2025
18 tasks
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