[MBL-1721] Pledge Rewards Summary Table View Refactor
📲 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, andbonusSupport - Update table view cell styling. Includes some Prelude cleanup.
👀 See
| No Reward | Reward (no add-on) | Reward + add on | Reward + 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
@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.