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

Feature/wincher modal improvements #20522

Merged

Conversation

KaisZaoualiWincher
Copy link
Contributor

@KaisZaoualiWincher KaisZaoualiWincher commented Jul 21, 2023

Context

  • We want to improve the Track SEO performance functionality in the Yoast SEO metabox/sidebar.

Summary

This PR can be summarized in the following changelog entry:

  • Improves the Track SEO performance functionality by adding a graph that plots keyphrase trends over time.
  • [@yoast/babel-preset] Adds a plugin to support class properties.

Relevant technical choices:

  • N/A

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Preliminary steps

  • With your browser console open, go to https://app.wincher.com
    • Log in if you're not logged in already
    • In the browser's console network tab, look for a GET request to app.wincher.com/v1/account
    • In the request response, take note of the history_days value: it should be 31

Test the single keyword case

  • Edit a post
  • Add a focus keyphrase
  • Go to Track SEO performance, a modal similar to the one below should appear
    Screenshot 2023-09-29 at 16 39 30
  • Toggle Tracking on, a graph should appear
    • Please note that if you track a keyword you've never tracked before, the graph will be only a point
      Screenshot 2023-10-02 at 10 37 16
    • Conversely, if you track a keyword you've already tracked before, a segment will be shown
    Screenshot 2023-09-29 at 16 40 31
  • Verify that:
    • you can only choose from the drop-down menu time frames which are lower than the history_days value (i.e., for history_days equals to 31, you should be able to choose from Last day, Last week and Last month)
    • data displayed in the table and in the chart refers to the selected time frame
    • if you toggle Tracking off the corresponding line disappears from the graph
    • if you hover on a point on the line (you should have at least one), you get information about that specific point in time
    Screenshot 2023-09-29 at 16 44 44 * clicking on the mini chart of a keyphrase selects the corresponding graph in the chart

Test the multiple keywords case

  • Install and activate Yoast SEO Premium
  • Keep editing the post you were editing and add a related keyphrase
  • Go to `Track SEO performance: you should see the additional keyphrase in the table
    Screenshot 2023-09-29 at 17 02 26
  • Toggle the new keyphrase and verify a new line appears in the chart
    Screenshot 2023-09-29 at 17 06 08
  • Verify that:
    • select all selects all tracked keyphrases
    • deselect all deselects all selected keyphrases.
    • deselecting all keyphrases hide the chart
    • untracking a keyphrase deselects it
    • clicking on the mini chart of a keyphrase select it, deselects any other selected keyphrase, and display chart if not already displayed.

Test keyword change over time

  • Edit packages/js/src/redux/selectors/WincherSEOPerformance.js
  • Substitute the getWincherTrackedKeyphrases method with the following:
export function getWincherTrackedKeyphrases( state ) {
  return {
    test: {
      id: 36381183,
      keyword: "test",
      position: {
        change: -54,
        value: 101,
        history: [
          {
            datetime: "2023-09-24T18:04:38Z",
            value: 155,
          },
          {
            datetime: "2023-09-28T06:31:22Z",
            value: 101,
          },
        ],
      },
      updated_at: "2023-09-28T06:31:22Z",
    },
  };
}
  • Edit a post, click on Track SEO performance and verify the graph is as follows
    Screenshot 2023-09-29 at 17 27 02
    • specifically, verify that the caret in the Position over time column is green and points upwards
  • Edit again packages/js/src/redux/selectors/WincherSEOPerformance.js
  • Substitute the getWincherTrackedKeyphrases method with the following:
export function getWincherTrackedKeyphrases( state ) {
  return {
    test: {
      id: 36381183,
      keyword: "test",
      position: {
        change: 54,
        value: 155,
        history: [
          {
            datetime: "2023-09-24T18:04:38Z",
            value: 101,
          },
          {
            datetime: "2023-09-28T06:31:22Z",
            value: 155,
          },
        ],
      },
      updated_at: "2023-09-28T06:31:22Z",
    },
  };
}
  • Edit a post, click on Track SEO performance and verify the graph is as follows
    Screenshot 2023-09-29 at 17 30 31
    • specifically, verify that the caret in the Position over time column is red and points downwards

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 (Block/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.

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 #

@KaisZaoualiWincher KaisZaoualiWincher force-pushed the feature/wincher-modal-improvements branch from 4fa0dc0 to c7ed18b Compare July 21, 2023 09:48
@thijsoo thijsoo self-assigned this Jul 26, 2023
@enricobattocchi enricobattocchi changed the base branch from trunk to feature/plugin-fixes July 27, 2023 10:28
@ux-tom ux-tom assigned ux-tom and unassigned ux-tom Jul 31, 2023
@thijsoo thijsoo removed their assignment Aug 4, 2023
@KaisZaoualiWincher KaisZaoualiWincher force-pushed the feature/wincher-modal-improvements branch from 521853c to cf1f5a1 Compare August 10, 2023 23:17
@mhkuu mhkuu deleted the branch Yoast:trunk August 18, 2023 13:58
@mhkuu mhkuu closed this Aug 18, 2023
@vraja-pro vraja-pro reopened this Aug 22, 2023
@vraja-pro vraja-pro changed the base branch from feature/plugin-fixes to trunk August 22, 2023 11:50
@mhkuu
Copy link
Contributor

mhkuu commented Aug 22, 2023

Sorry, I see this PR got auto-closed when I merged the feature/plugin-fixes branch!

@KaisZaoualiWincher KaisZaoualiWincher force-pushed the feature/wincher-modal-improvements branch from cf1f5a1 to 3dfbbb5 Compare August 29, 2023 14:13
@pls78
Copy link
Member

pls78 commented Sep 15, 2023

Hey @KaisZaoualiWincher 👋
I have some points about the PR I feel should be addressed:

  • For some reason, the PR breaks focusing on #focus-keyword-input-sidebar when there’s no focus keyword and you try to track SEO performance: changing it to #focus-keyword-input-metabox fixed it
  • @babel/plugin-proposal-class-properties has been added as dependency in packages/babel-preset/package.json: however, in npmjs it is stated that This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
  • with history_days set to 31 I just get only Last day and Last week as options from the menu (following the instructions, I should also get Last month)
  • This point is not clear to me: Make sure we display the correct position change, with the correct caret type
    Thanks! 🙏

@KaisZaoualiWincher
Copy link
Contributor Author

Hey @KaisZaoualiWincher 👋 I have some points about the PR I feel should be addressed:

  • For some reason, the PR breaks focusing on #focus-keyword-input-sidebar when there’s no focus keyword and you try to track SEO performance: changing it to #focus-keyword-input-metabox fixed it
  • @babel/plugin-proposal-class-properties has been added as dependency in packages/babel-preset/package.json: however, in npmjs it is stated that This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
  • with history_days set to 31 I just get only Last day and Last week as options from the menu (following the instructions, I should also get Last month)

Hi @pls78 👋

All the points should be addressed.

  • This point is not clear to me: Make sure we display the correct position change, with the correct caret type

This means we should display a red bottom caret if there is a position lost, otherwise a green top caret:

image

@KaisZaoualiWincher KaisZaoualiWincher force-pushed the feature/wincher-modal-improvements branch from ba6a692 to 93dae1e Compare September 25, 2023 11:12
@pls78
Copy link
Member

pls78 commented Sep 26, 2023

Hello @KaisZaoualiWincher 👋
There are still a couple of small things to address 🙂

  • When I edit a post and I'm disconnected from Wincher, I get a 400 - Bad Request console error from http://plswordpress.test/wp-json/yoast/v1/wincher/account/limit?_locale=user. the response payload is as follows:
    {"status":400,"error":"Token usage failed. Token is empty."}
  • I get the following console error, too: Warning: Failed prop type: The prop 'isOpen' is marked as required in 'CollapsibleStateless', but its value is 'undefined'.

Could you please take a look ad these issues, too? 🙏

@KaisZaoualiWincher KaisZaoualiWincher force-pushed the feature/wincher-modal-improvements branch from 3b5df9a to 6a4a84c Compare October 11, 2023 16:41
@hardikgohil7988
Copy link

The changes, bugs, and scenarios have all been validated and everything is working as expected.

@enricobattocchi enricobattocchi added the changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog label Oct 19, 2023
@enricobattocchi enricobattocchi merged commit 55c136e into Yoast:trunk Oct 19, 2023
@enricobattocchi enricobattocchi added this to the 21.6 milestone Oct 19, 2023
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 community-patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants