feat: mp-3076-kiva-credit-tip-toggle - #7188
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
dyersituations
left a comment
There was a problem hiding this comment.
Changes look good, and I tested it locally, but I want to get at least one more set of eyes on the changes before I approve due to this being such a critical part of Kiva. @infante-jaime thanks for digging into the questions I added comments for!
thanks for reviewing! good questions make better code. |
|
@infante-jaime probably is not related but I saw the toggle first then I decided
|
| </div> | ||
| </div> | ||
|
|
||
| <kiva-credit-tip-toggle |
There was a problem hiding this comment.
(optional) no a big issue just check the gab I keep seeing 16px, mocks has 8px > https://www.figma.com/design/H0RJzgOoeuFmdH8ggDX2c1/Donations-from-deposits?node-id=122-4616&m=dev and margin-top 16px not 8px
actually as weird as it looks is how it is in dev checking with design if we can update that by taking the toggle space |
|
the feature and integration looks good, great job @infante-jaime, just an edge case to confirm (already commented) here my TCs executed: Legend: ✅ OK (tested & passing)
|
|
@infante-jaime the spacing issues are not currently affecting control? Just want to make sure if this gets merged that the non-experiment/current experience isn't changed. We'll be releasing |
This shouldnt be an issue by design there are no ui changes for the control just in the experiment and in this particular case is the toggle spacing. So I guess we are good to go and any layout concerns can be addressed here |
|
🎉 This PR is included in version 3.92.0-rc.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 3.92.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |









MP-3076 — Checkout: balance-toward-tip toggle (variant b)
Adds the checkout toggle that lets lenders choose whether their Kiva Credit pays
the tip, for the tip-from-balance experiment (epic MP-3000). The UI persists the
preference and renders the backend-owned manifest — no client-side allocation math.
6 files, +413/−3. Layout/cosmetic changes that were originally in this PR have
been split out to MP-3154 at review request.
How it works
The toggle —
KivaCreditTipToggle.vueRenders in the tip row for variant
bwhen the lender is logged in, has balanceState is read from
Manifest.applyKivaCreditToDonation(added toinitializeCheckout); changes call the mergedupdateKivaCreditDonationPreferencemutation, which returns the rebuilt manifest with totals, then emit the existing
refreshtotals. Failures toast and refresh so a stale basket recovers.Tracking fires
basket / click / tip-from-balance-toggle-on|offon explicitchanges only — nothing fires for the default state.
Seeding the default-off — the eng call the ticket left open
Treatment has to default OFF, but
applyKivaCreditToDonationis aBoolean!thatcan't distinguish "never chose" from "chose yes", so the value alone can't drive
seeding. On the first eligible render of a variant-b basket still reading
true,the component fires the mutation once with
falseand records the basket id in akvtipseededcookie; a marked basket is never re-seeded, so an explicit lenderchoice is never overwritten. The toggle stays hidden until the manifest and the
rendered state agree.
Known edge case: clearing that cookie while the preference is ON re-seeds it off
on the next eligible render. Accepted trade-off of client-side seeding.
Assignment — read once in
CheckoutPage.created()and provided to descendantsvia
provide/inject, following the existingcustomTipDefaultVersionpattern inthe same file. No exposure tracking here; MP-3077 owns that.
Testing
10 specs covering control, seeding, re-seed protection, each hide condition,
tip-zero reappearance, persistence + tracking, and the failure/revert path.
Full suite green (330 files / 5,166 tests); ESLint, Stylelint and GraphQL lint clean.
Manually verified on dev: seeding fires exactly once per basket, the choice
survives reloads, on/off events fire, $0-tip hides and restores, control unchanged.
Before launch (not in this PR)
uiexp.checkout_tip_from_balance_toggleplus appendingcheckout_tip_from_balance_toggletoui.active_experiments. No space afterthe comma — the resolver splits on
,without trimming, so a leading spacemakes the key silently unmatched. Dev is configured.
EXP-MP-3006-Aug2026vs a rename) still needs settlingin the epic before MP-3077 wires exposure.
text-secondaryis #505050 (gray-600) while@kiva/kv-tokensships#757575 — the label uses
tw-text-gray-600to match the design.