Automattic / wp-calypso

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

Plans (grid): Disable term-savings price display if another discount is active (intro/coupon/etc.) #96631

Open chriskmnds opened 3 days ago

chriskmnds commented 3 days ago

Related to https://github.com/Automattic/martech/issues/3403 Related to https://github.com/Automattic/wp-calypso/pull/96357 Branched from https://github.com/Automattic/wp-calypso/pull/96492

Proposed Changes

This is a follow-up to the term-savings price display (see core implementation: https://github.com/Automattic/wp-calypso/pull/96357) to disable the term-savings display if any plan, across any available/effective term for the rendered grid appears as discounted already.

See related discussion: pdvytD-Se-p2#comment-645. Implementation directly addresses comment pdvytD-Se-p2#comment-650:

Why are these changes being made?

Avoid confusion when plans are discounted while the term-savings display is active. Keep the focus on the effective/promoted discount across the user's interaction with the grid.

See related discussion: pdvytD-Se-p2#comment-645. Implementation directly addresses comment pdvytD-Se-p2#comment-650

Testing Instructions

TBD - WIP

Pre-merge Checklist

github-actions[bot] commented 3 days ago

Link to live branch is being generated... Please wait a few minutes and refresh this page.

chriskmnds commented 2 days ago

@jeyip This is a pretty insane change. If this is where we want things to head, then I'll continue pushing through more surrounding refactors. I think this is where we want things to head, conceptually.

cc @southp as something to keep an eye on. The primary consideration going forward should on maintaining the memoization of the affected hooks. Otherwise, it literally can be 4x the processing on any interaction (if not already - needs to be tested). 🤷

chriskmnds commented 2 days ago

@jeyip This is a pretty insane change. If this is where we want things to head, then I'll continue pushing through more surrounding refactors. I think this is where we want things to head, conceptually.

cc @southp as something to keep an eye on. The primary consideration going forward should on maintaining the memoization of the affected hooks. Otherwise, it literally can be 4x the processing on any interaction (if not already - needs to be tested). 🤷

Well, I'm going to experiment with another approach. This feels a little over the line.

jeyip commented 2 days ago

@jeyip This is a pretty insane change. If this is where we want things to head, then I'll continue pushing through more surrounding refactors. I think this is where we want things to head, conceptually.

Well, I'm going to experiment with another approach. This feels a little over the line.

Thanks for exploring this change. Pretty unfortunate that it gets crazy. I haven't reviewed the code yet, but I'll take a closer look before I sign off