Automattic / wp-calypso

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

Plans 2023: Export SpotlightPlan and uncouple FeaturesGrid from it #81076

Open chriskmnds opened 12 months ago

chriskmnds commented 12 months ago

As of https://github.com/Automattic/wp-calypso/issues/78266 we export FeaturesGrid and ComparisonGrid from plans-features-2023-grid (which is now mainly an index of the individual components) and assemble the plans page on consuming end.

We should export the Spotlight plan, which is currently part of FeaturesGrid, and uncouple the latter (require no knowledge of a spotlight plan being rendered anywhere).

The refactor here should lead into the redesign for the Spotlight cards (along with the possibility of consolidating them between Woo and Wpcom). There is a separate issue for that on the MarTech repo (with lots of related discussions and design mocks shared): https://github.com/Automattic/martech/issues/2001

How

This will likely require some more foundational work be done first. Spotlight plan shares the same structure as the mobile cards, and we can aim for reusability if possible - be DRY. It could mean creating a few finer/granular components into components/shared folder and reusing them between Spotlight and mobile cards. Needs some investigation first. Also considering the redesigns and the WooExpress-Wpcom Spotlight card consolidation when thinking about reuse: https://github.com/Automattic/martech/issues/2001

and the WooExpress-Wpcom Spotlight card consolidation

To see the WooExpress spotlight card:

Screenshot 2023-12-21 at 3 33 43 PM

uncouple the latter (require no knowledge of a spotlight plan being rendered anywhere)

A possible direction for this is to evolve the gridPlans: GridPlan[] property to gridPlans: { mobile: GridPlan[], default: GridPlan[] } - that way the reordering and reduced list of plans (that requires knowledge of spotlight plan being rendered) will happen outside of FeaturesGrid and at the consuming end (plans-features-main).

chriskmnds commented 8 months ago

@southp I've updated the description a bit so that it links with the work happening in https://github.com/Automattic/martech/issues/2001

The refactor here should lead into the redesign for the Spotlight cards (along with possibility of consolidating them between Woo and Wpcom). There is a separate issue for that on the MarTech repo (with lots of related discussions and design mocks shared): https://github.com/Automattic/martech/issues/2001

p.s. I couldn't add https://github.com/Automattic/martech/issues/2001 to the existing milestone on wp-calypso (or transfer the issue over), but we should be good. no big deal :-)