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

Implement selection panel add group notice #8881

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

nfmohit
Copy link
Collaborator

@nfmohit nfmohit commented Jun 16, 2024

Summary

Addresses issue:

Relevant technical choices

This PR implements an add group notice to the Audience Selection Panel when there is only one group selected.

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

Copy link

github-actions bot commented Jun 16, 2024

Build files for 227104d have been deleted.

Copy link

github-actions bot commented Jun 16, 2024

Size Change: +9.17 kB (+0.6%)

Total Size: 1.55 MB

Filename Size Change
./dist/assets/css/googlesitekit-admin-css-********************.min.css 54.9 kB +334 B (+0.61%)
./dist/assets/js/34-********************.js 3.12 kB +2 B (+0.06%)
./dist/assets/js/googlesitekit-activation-********************.js 24 kB -2 B (-0.01%)
./dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 59.5 kB +8 B (+0.01%)
./dist/assets/js/googlesitekit-adminbar-********************.js 34.8 kB +9 B (+0.03%)
./dist/assets/js/googlesitekit-api-********************.js 10.1 kB -5 B (-0.05%)
./dist/assets/js/googlesitekit-components-gm2-********************.js 5.87 kB -3 B (-0.05%)
./dist/assets/js/googlesitekit-data-********************.js 2.17 kB -5 B (-0.23%)
./dist/assets/js/googlesitekit-datastore-forms-********************.js 9.13 kB -1 B (-0.01%)
./dist/assets/js/googlesitekit-datastore-location-********************.js 2.08 kB -2 B (-0.1%)
./dist/assets/js/googlesitekit-datastore-site-********************.js 20 kB -1 B (-0.01%)
./dist/assets/js/googlesitekit-datastore-ui-********************.js 10.1 kB -1 B (-0.01%)
./dist/assets/js/googlesitekit-datastore-user-********************.js 25.2 kB +4 B (+0.02%)
./dist/assets/js/googlesitekit-entity-dashboard-********************.js 74 kB +23 B (+0.03%)
./dist/assets/js/googlesitekit-main-dashboard-********************.js 127 kB +2.25 kB (+1.81%)
./dist/assets/js/googlesitekit-modules-********************.js 22.3 kB +3 B (+0.01%)
./dist/assets/js/googlesitekit-modules-ads-********************.js 29.4 kB -9 B (-0.03%)
./dist/assets/js/googlesitekit-modules-adsense-********************.js 112 kB -24 B (-0.02%)
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 142 kB +4 kB (+2.9%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 22.6 kB +12 B (+0.05%)
./dist/assets/js/googlesitekit-modules-search-console-********************.js 58.5 kB +43 B (+0.07%)
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 30.6 kB -18 B (-0.06%)
./dist/assets/js/googlesitekit-polyfills-********************.js 377 B +1 B (+0.27%)
./dist/assets/js/googlesitekit-settings-********************.js 61.7 kB -17 B (-0.03%)
./dist/assets/js/googlesitekit-splash-********************.js 73 kB -295 B (-0.4%)
./dist/assets/js/googlesitekit-user-input-********************.js 48.3 kB -12 B (-0.02%)
./dist/assets/js/googlesitekit-vendor-********************.js 317 kB -120 B (-0.04%)
./dist/assets/js/googlesitekit-widgets-********************.js 59.8 kB +2.2 kB (+3.82%)
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 60.2 kB +62 B (+0.1%)
./dist/assets/js/optin-monster-********************.js 673 B +1 B (+0.15%)
./dist/assets/js/popup-maker-********************.js 634 B +1 B (+0.16%)
./dist/assets/js/runtime-********************.js 1.3 kB +3 B (+0.23%)
./dist/assets/js/ninja-forms-********************.js 727 B +727 B (new file) 🆕
ℹ️ View Unchanged
Filename Size
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 11.2 kB
./dist/assets/css/googlesitekit-authorize-application-css-********************.min.css 770 B
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 7.47 kB
./dist/assets/js/29-********************.js 2.76 kB
./dist/assets/js/30-********************.js 2.25 kB
./dist/assets/js/31-********************.js 3.64 kB
./dist/assets/js/32-********************.js 935 B
./dist/assets/js/33-********************.js 892 B
./dist/assets/js/analytics-advanced-tracking-********************.js 776 B
./dist/assets/js/contact-form-7-********************.js 645 B
./dist/assets/js/googlesitekit-components-gm3-********************.js 10.1 kB
./dist/assets/js/googlesitekit-i18n-********************.js 3.92 kB
./dist/assets/js/mailchimp-********************.js 629 B
./dist/assets/js/woocommerce-********************.js 652 B
./dist/assets/js/wpforms-********************.js 632 B

compressed-size-action

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Hi @nfmohit, nice work here so far. However - it doesn't fully meet the AC. I realise the IB itself doesn't fully meet the AC as originally specced, so no worries, these things happen!

Anyhow, the notice should only be displayed if there is just one audience selected when the panel is initially opened, rather than any time the audience selection count in the panel is reduced to one.

The idea is that we want to draw the user's attention to this if they have a saved selection of just one audience, but not nag them too much while they are simply interacting with the selection.

One a related note - I realise this aspect wasn't made clear at all but once a user has selected another audience, the notice should disappear and should not show up again while the panel is still open even if the user reduces the selection to a single audience. I've amended the AC to make this point clear, sorry this was a last minute addition.

@nfmohit nfmohit requested a review from techanvil June 19, 2024 08:01
@nfmohit
Copy link
Collaborator Author

nfmohit commented Jun 19, 2024

Thank you for the clarification, @techanvil! I've updated the PR accordingly. Please let me know if this looks good now.

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Thanks @nfmohit!

I've left a comment on one of the tests, please take look.

Beyond that - I must admit that when testing it, the behaviour does feel slightly odd. Notably the case where the user opens the selection panel with a single saved audience, and then unchecks the audience.

At this point, the notice disappears, but the user hasn't actually given an implicit indication of having taken action in accordance with the notice - they've removed their audience rather than adding one as the notice suggests.

Anyhow, let's not worry about that here - I will raise a separate issue to refine the behaviour to address this.

).toBeInTheDocument();
} );

it( 'should not display notice when there is a saved selection of less than or more than one group', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This describes the case where there is less than one group in the saved selection, but doesn't test it.

Please either add test coverage for the zero-selection case (maybe splitting the test into two or using it.each()), or amend the description.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've updated the test coverage using it.each() as recommended, thanks Tom!

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Whoops, forgot to request changes on my previous review!

@techanvil
Copy link
Collaborator

Beyond that - I must admit that when testing it, the behaviour does feel slightly odd. Notably the case where the user opens the selection panel with a single saved audience, and then unchecks the audience.

At this point, the notice disappears, but the user hasn't actually given an implicit indication of having taken action in accordance with the notice - they've removed their audience rather than adding one as the notice suggests.

Anyhow, let's not worry about that here - I will raise a separate issue to refine the behaviour to address this.

Just noting I've added #8909 to address the above.

@nfmohit nfmohit requested a review from techanvil June 19, 2024 16:48
@nfmohit
Copy link
Collaborator Author

nfmohit commented Jun 19, 2024

I agree, thank you for covering this behaviour. I've addressed the CR feedback, thanks @techanvil !

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

LGTM, nice one @nfmohit!

@techanvil techanvil merged commit 90fa37b into develop Jun 20, 2024
21 of 22 checks passed
@techanvil techanvil deleted the enhancement/#8159-selection-panel-info-notice branch June 20, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants