Skip to content

641 create the dropdowns for the manual page selection#22388

Merged
igorschoester merged 20 commits intofeature/llms-txt-phase-2from
641-create-the-dropdowns-for-the-manual-page-selection
Jul 3, 2025
Merged

641 create the dropdowns for the manual page selection#22388
igorschoester merged 20 commits intofeature/llms-txt-phase-2from
641-create-the-dropdowns-for-the-manual-page-selection

Conversation

@leonidasmi
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi commented Jun 30, 2025

Context

Summary

This PR can be summarized in the following changelog entry:

  • Adds multiple dropdowns for the manual selection of pages in the llms.txt file.

Relevant technical choices:

Known limitations of this first iteration:

  • The UX around the page selection dropdowns is weird. Examples
    • When first going into the page and while the /page request is still going, clicking an empty dropdown to add a page, doesn't give you a list of pages to choose from or a loading state. And as soon as the /page request is done, then suddenly you get a list of pages to choose from. Basically, a lack of loading state when the initial `/page request is still going.
    • While you are searching for a page and you are typing the letters slowly, you are greeted with a page not found message while it searches, until you finish typing. When you finish typing, after a while you're greeted with the list of pages that are satisfying the search term.
    • When the /page request fails, there's no errored UX and the user is left guessing
  • The pages that are stored in the db as manual page selections can later be deleted/made private/etc. We will take care not displaying them in the .txt file in the backend. As far as the frontend is concerned, when the user visits again the llms.txt settings page, we will show them an active None option in the dropdown where they had selected a now-deleted page.
  • The user can select a page multiple times in the manual page selection dropdowns. This will be taken care of here.
  • The request that populates the available pages list is looking at WP's REST API's /page route. We intend to change that here.

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 Yoast settings->llms.txt
  • Before enabling the feature, the rest of the settings page is disabled
  • Enable the feature and before selecting manual page selection, the relevant section is disabled
  • Select manual page selection and the section becomes enabled
  • Select pages for the first 5 selections and save and refresh
  • Confirm that the pages you had selected are the ones that appear selected in the dropdowns
  • Start playing around with the content pages
    • Add a couple of pages and save. Confirm that the selections are persisted after a page load
    • Remove a couple of pages and save. Confirm that the dropdowns for the content pages are the ones that you left, plus an empty one. Find in the DB, the wpseo_llmstxt option, run it through https://www.unserialize.com/ and confirm that the other_included_pages subsetting is an array that only contains valid page IDs.
    • Add a couple of content pages but empty ones and save. Confirm after a page load, that you only get a single empty dropdown. Find in the DB, the wpseo_llmstxt option, run it through https://www.unserialize.com/ and confirm that the other_included_pages subsetting is an array that only contains valid page IDs.
    • Add a couple of content pages with selected pages. Then clear the selections by clicking the X at the right of the dropdown. Then save. Confirm after a page load, that you only get a single empty dropdown. Find in the DB, the wpseo_llmstxt option, run it through https://www.unserialize.com/ and confirm that the other_included_pages subsetting is an array that only contains valid page IDs.
  • Select auto page selection, save and refresh. Confirm that the selections you had in the pages are still there, albeit looking disabled.

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 #

@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.

@leonidasmi leonidasmi added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Jun 30, 2025
@leonidasmi leonidasmi changed the base branch from feature/llms-txt-phase-2 to trunk July 1, 2025 09:19
@leonidasmi leonidasmi changed the base branch from trunk to feature/llms-txt-phase-2 July 1, 2025 09:19
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 1, 2025

Pull Request Test Coverage Report for Build e257b438628e2f690e1d6a8317ff42059e2883bf

Details

  • 0 of 140 (0.0%) changed or added relevant lines in 5 files are covered.
  • 8 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 53.729%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/settings/routes/llms-txt.js 0 13 0.0%
inc/options/class-wpseo-option-llmstxt.php 0 24 0.0%
packages/js/src/settings/store/indexable-pages.js 0 29 0.0%
packages/js/src/settings/components/formik-indexable-page-select-field.js 0 36 0.0%
src/integrations/settings-integration.php 0 38 0.0%
Files with Coverage Reduction New Missed Lines %
inc/options/class-wpseo-option-llmstxt.php 1 0.0%
src/integrations/settings-integration.php 2 24.94%
packages/js/src/settings/routes/llms-txt.js 5 0.0%
Totals Coverage Status
Change from base Build 0a85f3f559da61dde396d3b5dd79d5196d97743d: -0.1%
Covered Lines: 30488
Relevant Lines: 57711

💛 - Coveralls

@leonidasmi leonidasmi force-pushed the 641-create-the-dropdowns-for-the-manual-page-selection branch from c651d99 to 4f32217 Compare July 1, 2025 11:20
@leonidasmi leonidasmi force-pushed the 641-create-the-dropdowns-for-the-manual-page-selection branch from 4f32217 to 60f432e Compare July 1, 2025 11:29
@leonidasmi leonidasmi force-pushed the 641-create-the-dropdowns-for-the-manual-page-selection branch from b5ffdd0 to 40963d6 Compare July 3, 2025 05:45
@leonidasmi leonidasmi marked this pull request as ready for review July 3, 2025 06:51
Copy link
Copy Markdown
Contributor

@igorschoester igorschoester 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 inc/options/class-wpseo-option-llmstxt.php
Comment thread packages/js/src/settings/routes/llms-txt.js
Comment thread packages/js/src/settings/routes/llms-txt.js Outdated
Comment thread packages/js/src/settings/routes/llms-txt.js Outdated
Comment thread packages/js/src/settings/routes/llms-txt.js Outdated
leonidasmi and others added 2 commits July 3, 2025 13:06
leonidasmi and others added 3 commits July 3, 2025 13:12
Co-authored-by: Igor <35524806+igorschoester@users.noreply.github.com>
Co-authored-by: Igor <35524806+igorschoester@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

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

AT ✅

@igorschoester igorschoester merged commit cd4a08d into feature/llms-txt-phase-2 Jul 3, 2025
37 checks passed
@igorschoester igorschoester deleted the 641-create-the-dropdowns-for-the-manual-page-selection branch July 3, 2025 10:38
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