Notifications: gate v3 panel behind hosting-dashboard-opt-in preference#49560
Notifications: gate v3 panel behind hosting-dashboard-opt-in preference#49560arthur791004 wants to merge 1 commit into
Conversation
Replace the `notifications=v3` query parameter gate with the user's `calypso_preferences['hosting-dashboard-opt-in']` value, mirroring the wpcom admin-bar "All Sites" logo gate. Falls back to v2 when get_user_attribute() is unavailable (self-hosted Jetpack). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
Fixes #
Proposed changes
notifications=v3query-parameter gate (added in Notifications: gate v3 panel behind a notifications=v3 query parameter #49514) with a check on the current user'scalypso_preferences['hosting-dashboard-opt-in']value. When that value is'opt-in', the notifications admin-bar item renders#wpnt-notes-panel3(v3 panel/iframe); otherwise it renders#wpnt-notes-panel2.get_user_attribute()withfunction_exists()so self-hosted Jetpack sites (where the function and the preference don't exist) safely fall back to the v2 panel.Related product discussion/links
Does this pull request change what data or activity we track or use?
No. It reads an existing user preference (
calypso_preferences) to decide which notifications panel markup to render.Testing instructions
get_user_attribute()andcalypso_preferencesare available):#wpnt-notes-panel2.calypso_preferences['hosting-dashboard-opt-in']['value']toopt-in, reload, and confirm the panel div is now#wpnt-notes-panel3and clicking the bell opens the v3 panel (iframehttps://widgets.wp.com/notifications/app/) in a browser that allows third-party cookies.#wpnt-notes-panel2and is unaffected.