Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevents interactions between spans in the meta description field #21366

Merged
merged 3 commits into from
May 7, 2024

Conversation

mhkuu
Copy link
Contributor

@mhkuu mhkuu commented May 6, 2024

Context

  • In Firefox, selecting the first word of the description added to the meta description field would also select the fixed variable "Separator". This PR prevents that by adding   after (and between) the fixed variables.
  • Also, in this PR we change the "Separator" to the em dash, to make it's clear that's it's not the same as the "Separator" replacement variable.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes an unreleased bug where lack of an element between the fixed variables and the text input by the user could lead to interactions.
  • Fixes an unreleased bug where the fixed variable for Google's separator could be confused with the "Separator" replacement variable.

Relevant technical choices:

  • We're using   as that's the de facto standard to create spacing between elements throughout our codebase.
  • We've added "—" as an untranslatable string.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Create a new post.
  • Open the search appearance settings (in the metabox or the sidebar).
  • Confirm that in the meta description field, there is now an em dash ("—") as a fixed variable instead of "Separator".
  • Add some extra text after the fixed variables.
  • Confirm that double-clicking the first word of the added text does not also select the fixed variable for the em dash. Note: this behaviour previously was reproducible in Firefox, not in Chrome, so I suggest to try different browsers here.

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:

  • The spacing between the fixed variables.

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 https://github.com/Yoast/plugins-automated-testing/issues/1529

@mhkuu mhkuu added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label May 6, 2024
@mhkuu mhkuu added this to the 22.7 milestone May 6, 2024
@coveralls
Copy link

coveralls commented May 6, 2024

Pull Request Test Coverage Report for Build c8432eccf59f652b1c4e6adfe697a3e9940dba85

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

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 1442 unchanged lines in 42 files lost coverage.
  • Overall coverage decreased (-1.2%) to 51.243%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/shared-admin/helpers/search-appearance-description-mention.js 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
admin/class-option-tabs-formatter.php 1 0.0%
src/actions/configuration/first-time-configuration-action.php 1 91.84%
src/generated/assets/externals.php 1 0.0%
src/generated/assets/languages.php 1 0.0%
src/generators/breadcrumbs-generator.php 1 64.23%
src/integrations/blocks/structured-data-blocks.php 1 16.0%
src/integrations/settings-integration.php 1 28.49%
admin/class-admin-editor-specific-replace-vars.php 2 85.71%
admin/endpoints/class-endpoint-statistics.php 2 0.0%
admin/formatter/class-metabox-formatter.php 2 91.77%
Totals Coverage Status
Change from base Build aa17961d17087001e6601a3491e00b3e988b2bfc: -1.2%
Covered Lines: 28351
Relevant Lines: 56272

💛 - Coveralls

@mhkuu
Copy link
Contributor Author

mhkuu commented May 6, 2024

The coveralls action failing can be safely ignored.

@Jordi-PV Jordi-PV added the UI change PRs that result in a change in the UI label May 7, 2024
@Jordi-PV Jordi-PV merged commit 2ff480e into release/22.7 May 7, 2024
16 checks passed
@Jordi-PV Jordi-PV deleted the fix/mentions-spacing branch May 7, 2024 08:59
mhkuu added a commit that referenced this pull request May 16, 2024
This reverts commit 2ff480e, reversing
changes made to ffdfadb.
@mhkuu mhkuu added changelog: reverted Needs to be excluded from all categories in the changelog, should be used for reverted PR and removed changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog labels May 17, 2024
@hardikgohil7988
Copy link

@oksanayoast @tatasha2004
I've tested this PR in Firefox/Chrome/Safari browsers and it is working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: reverted Needs to be excluded from all categories in the changelog, should be used for reverted PR UI change PRs that result in a change in the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants