Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Nav Unification: Notices and Nudges #45574

Open marekhrabe opened 4 years ago

marekhrabe commented 4 years ago

All nudges and notices are concentrated in the CurrentSite component. This component controls everything that shows above the standard nav links in Calypso sidebar.

Screenshot 2020-09-10 at 12 36 34

✅ Implemented — The Site Switcher link

✅ Implemented simplified version — Site card

✅ implemented Domain Credit

✅ implemented Domain Upsell

✅ implemented JITM (Just In Time Messages) for wp-admin

💡 Needs plan & implmentation — Nudges and Notices of different kinds

Domain Warnings

Stale Cart

Other Notices

Site Redirect Notice

Active Discount Notice

Conclusion

This was just a first pass over the existing nudges and it turns out this is a pretty complicated chunk of code which uses different store types (Redux, Flux) and several different API types for feeding the data

It relies on entities like user, site, domain, store, cart, plan and has no central logic that does all the checks. The eligibility logic is scattered across many different components and their methods. Should we want to achieve 1:1 copy in wp-admin, it will require a huge rewrite of the code. Copying the full logic in wp-admin will be an extreme project too.

getdave commented 4 years ago

Thanks for the solid overview Marek.

Other Notices

Are you able to share the location for these components?

cpapazoglou commented 4 years ago

Can we maybe think of iframing this section and injecting it in wp-admin?

cpapazoglou commented 4 years ago

In an attempt to address this I have drafted https://github.com/Automattic/wp-calypso/pull/45780. Let's discuss whether it is feasible or we should go another way.

marekhrabe commented 4 years ago

Other Notices

Are you able to share the location for these components?

@getdave It branches from here. https://github.com/Automattic/wp-calypso/blob/master/client/my-sites/current-site/notice.jsx

I have edited the main post to include more links to code, including this one

marekhrabe commented 4 years ago

A little update on this one — we have implemented a "Switch Site" link into wp-admin (which opens https://wordpress.com/home), as well as a simplified "Site Card" (for now without any error/warning states it can have).

Everything else needs a better plan before proceeding. Some discussions in paYJgx-10T-p2

obenland commented 4 years ago

@marekhrabe What are the next steps on this one (if any)?

marekhrabe commented 3 years ago

For the first release, remaining nudges and notices were put out of scope for the wp-admin implementation

obenland commented 3 years ago

Re-opening now that v1 has shipped and porting notices and nudges might become more relevant again