google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.22k stars 279 forks source link

Prevent Selection Panel Info Notice from disappearing until two audiences are selected #8909

Open techanvil opened 1 week ago

techanvil commented 1 week ago

Feature Description

In its initial implementation, the Selection Panel Info Notice will disappear when the user opens the Selection Panel with a single selected audience, and unchecks that audience.

This is not ideal, as the notice is intended to encourage the user to add a second audience to the selection, so it would be better to keep the notice visible until they have at least two audiences selected.


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

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

nfmohit commented 1 week ago

@techanvil Just to quickly confirm, what happens if the user unselects one of the audiences after they've selected two? Should the notice reappear? If not, the IB will need to be updated to address that behaviour. I'll write my IBR feedback based on your response, thank you!

techanvil commented 1 week ago

Thanks @nfmohit - I should have been more explicit in the AC. The not should indeed not reappear - I've updated the AC accordingly.

nfmohit commented 1 week ago

Thank you for the confirmation and amendment, @techanvil !

@benbowler Thank you for the IB. Let's update it to make sure the notice doesn't reappear when the user reduces their selection to one audience. We may be able to use a local state in conjunction with a useEffect to achieve this behaviour.

Also, could you also instruct to remove the AUDIENCE_SELECTED form key if it is no longer needed? It was only added for this component as far as I know.

nfmohit commented 6 days ago

Thank you for the update, @benbowler . I think 3 as an estimate is quite steep here just in case an unexpected side-effect comes up. Do you think it might be worth increasing it by a notch just so we're safe?

benbowler commented 5 days ago

Good point, updated @nfmohit

nfmohit commented 3 days ago

Thanks @benbowler ! IB LGTM 👍 ✅