ios-oss icon indicating copy to clipboard operation
ios-oss copied to clipboard

[MBL-1721] Pledge Rewards Summary Table View Refactor

Open scottkicks opened this issue 1 year ago • 1 comments

📲 What

Instead of making the header text of each section a part of each cell, it'd be better to use actual table view header cells. We currently use a custom data source implementation that is overly complicated, somewhat difficult to understand, and not set up to easily define table view sections with UITableView headers.

I've built a new data source class that implements the UITableViewDiffableDataSource API. This approach comes with three main wins for us:

  • Simplifies the UI State
  • Removes the need for batch updates
  • Setups up for automatic animations if we want to take advantage in the future.

By applying a snapshot of all of the table data at once, we can more easily define sections and configure specific cell types for each.

These changes are behind the "No Shipping At Checkout" Feature Flag

🛠 How

  • Creates class NoShippingPledgeRewardsSummaryDiffableDataSource: UITableViewDiffableDataSource
  • Implement the new data source. This applies a snapshot that defines sections for the table as header, reward, addOns, and bonusSupport
  • Update table view cell styling. Includes some Prelude cleanup.

👀 See

No Reward Reward (no add-on) Reward + add on Reward + Bonus Support
No Reward reward (no addon) reward (addon) reward (addon + bonus support)

✅ Acceptance criteria

  • [x] crowdfund and late pledge pledges work as expected
  • [x] tables match our designs

⏰ TODO

  • [ ] Add snapshot tests onces issues are resolved

scottkicks avatar Oct 10 '24 17:10 scottkicks

1 Warning
:warning: Big PR

Generated by :no_entry_sign: Danger

nativeksr avatar Oct 10 '24 17:10 nativeksr

@ifosli addressed your comments. There are a bunch of new file changes now after renaming that struct. Should be easy enough to see each of your comments being addressed by commit though.

scottkicks avatar Oct 21 '24 20:10 scottkicks