Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MBL-1604] Show bonus in add-ons #2129

Merged
merged 9 commits into from
Aug 22, 2024
Merged

[MBL-1604] Show bonus in add-ons #2129

merged 9 commits into from
Aug 22, 2024

Conversation

ifosli
Copy link
Contributor

@ifosli ifosli commented Aug 21, 2024

📲 What

Show bonus support selection on the add-ons screen. Note that the continue button is only enabled if the amount is valid. The confirm details screen uses the bonus support passed in as its initial selection.

👀 See

Jira

Invalid amount case Navigating to/from confirm details
Screenshot 2024-08-21 at 10 57 53 AM Simulator Screen Recording - iPhone 15 - 2024-08-21 at 13 08 18

✅ Acceptance criteria

  • Bonus support shows on the add-ons screen and is propagated to the next step of checkout. So far, it's only actually used in the confirm details screen.

⏰ TODO

  • I didn't test voiceover for this but since it's only moving known components, I'm planning to skip that for now and test it during QA instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mainly just copied from our current tests - take a look commit by commit to just see the changes

@ifosli ifosli self-assigned this Aug 21, 2024
@ifosli ifosli marked this pull request as ready for review August 21, 2024 22:00
@ifosli ifosli requested a review from scottkicks August 21, 2024 22:00
@ifosli ifosli changed the title [MBL-1604] Bonus in addons [MBL-1604] Show bonus in add-ons Aug 21, 2024
Copy link
Contributor

@scottkicks scottkicks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Just a couple of minor comments

public let selectedShippingRule: ShippingRule?
public let selectedQuantities: SelectedRewardQuantities
public let selectedLocationId: Int?
public let refTag: RefTag?
public let context: PledgeViewContext

// Convenience initializer to allow `bonusSupport` to default to `nil`.
// TODO: Delete this when cleaning up the noShippingAtCheckout feature.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you haven't done so, let's log this in a ticket. Gotta keep track of the tech debt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, good call!

Comment on lines -274 to -275
guard userIsBackingProject(project) else { return minValue }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we need this guard here anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we ever needed this guard. It looks like it's here to protect against developer error more than anything. (If the user isn't backing the project, we always set bonus support to 0 to start.)

The reason I removed it is because the thing it's saying ("if the user isn't already backing the project, change the bonus support to start at the min value") is wrong in a world where the confirm details screen uses the bonus support set on the add-ons screen as its initial value. Keeping it would reset the bonus support we see on the confirm details page. Deleting this guard means that the confirm details page, while not actually providing value to the UI, isn't doing anything silly either.

I'm okay with reverting this change and keeping the guard if you'd rather! But note that if we do that, then getting rid of bonus support on the confirm details page (or getting rid of the entire confirm details page) is definitely launch blocking.

@ifosli ifosli merged commit 4db92f0 into main Aug 22, 2024
5 checks passed
@ifosli ifosli deleted the bonusInAddons branch August 22, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants