feat(buy-sell): align quote card with the DFX web widget - #255
Open
joshuakrueger-dfx wants to merge 16 commits into
Open
feat(buy-sell): align quote card with the DFX web widget#255joshuakrueger-dfx wants to merge 16 commits into
joshuakrueger-dfx wants to merge 16 commits into
Conversation
The wallet's local FeeDto type only declared rate/fixed/network/min/dfx/ total, missing bank/bankFixed/bankVariable/platform/networkStart that the DFX API's FeeDto already sends (api/.../fee.dto.ts). The bank fee was silently unreadable in the app despite being in every response.
Purely additive: PrimaryButton's new icon prop is optional, existing callers are unaffected.
- Presets fixed to 50/100/250/500, moved above the amount input
- Quote card collapsed by default: shield icon, effective rate
('1 {asset} ~ {price} {currency} incl. fees', using exchangeRate
directly - verified against the amount/estimatedAmount ratio in the
quote fixtures, not just the field name), fee-total badge, chevron
- Bank fee row added now that FeeDto carries it
- 'You receive' row highlighted in the accent color
- Static SEPA payment-method row above the CTA (Buy only)
- CTA now names the target asset with a trailing arrow icon
Buy and Sell mirror each other except presets and the payment-method
row, which are Buy-only by design (Sell trades a crypto amount, not a
fiat preset, and has no payment-method choice before confirming).
BuyScreenImpl's CTA test now expects 'buy.title BTC' instead of the old common.continue placeholder; Icon and PrimaryButton get coverage for the new arrow-right variant and icon slot.
The wallet's local FeeDto type only declared rate/fixed/network/min/dfx/ total, missing bank/bankFixed/bankVariable/platform/networkStart that the DFX API's FeeDto already sends (api/.../fee.dto.ts). The bank fee was silently unreadable in the app despite being in every response.
Purely additive: PrimaryButton's new icon prop is optional, existing callers are unaffected.
- Presets fixed to 50/100/250/500, moved above the amount input
- Quote card collapsed by default: shield icon, effective rate
('1 {asset} ~ {price} {currency} incl. fees', using exchangeRate
directly - verified against the amount/estimatedAmount ratio in the
quote fixtures, not just the field name), fee-total badge, chevron
- Bank fee row added now that FeeDto carries it
- 'You receive' row highlighted in the accent color
- Static SEPA payment-method row above the CTA (Buy only)
- CTA now names the target asset with a trailing arrow icon
Buy and Sell mirror each other except presets and the payment-method
row, which are Buy-only by design (Sell trades a crypto amount, not a
fiat preset, and has no payment-method choice before confirming).
BuyScreenImpl's CTA test now expects 'buy.title BTC' instead of the old common.continue placeholder; Icon and PrimaryButton get coverage for the new arrow-right variant and icon slot.
Verifies the icon prop is truly additive (absent by default, hidden during loading) instead of only asserting both texts render.
joshuakrueger-dfx
marked this pull request as ready for review
September 1, 2026 14:07
joshuakrueger-dfx
requested review from
Danswar,
TaprootFreak and
davidleomay
as code owners
September 1, 2026 14:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not symptom-driven: proactive redesign requested by JK, phase 2 of aligning the mobile Buy/Sell screens with the DFX web widget (dfx.swiss). Not a reported bug.
Scale: 2 screens (Buy, Sell), affects every user going through the buy/sell flow — this is the primary conversion path of the app.
Smaller fix considered: N/A — this is already scoped down to layout/data-plumbing plus the required state coverage for this phase. Explicitly out of scope for this PR: wallet-switcher bottom sheet, swap icon between buy/sell, hamburger-menu restructuring, and live rate countdown — each is its own follow-up phase.
Summary
FeeDto(wallet-side type) synced with the backend's actual response shape — it was missingbank,bankFixed,bankVariable,platform,networkStart, so the bank fee was silently unreadable despite being in every API response (verified against~/DFXswiss/api'sfee.dto.ts, not guessed).fees.bank).PrimaryButtongot an additive, optionaliconslot).Caught and fixed my own spec mistake before landing: the first pass had the quote-card headline backwards (
1 {currency} ≈ {crypto amount} {asset}instead of the widget's1 {asset} ≈ {price} {currency}). Verified the correct source field (exchangeRate, used directly — notrate, not inverted) against the actual amount/estimatedAmount ratio in the existing test fixtures before landing, not just against the field name.Test plan
npm run typecheck— 0 errorsnpm run lint— 0 errors (existing warnings only)npm run format— passednpx jest --coverage --runInBand— 107/107 suites, 1395/1395 tests; 99.83% lines, 99% floornpm run check:matrix— 63 referenced paths, 17 flags, 37 screensnpm run check:coverage-floorand per-file floors — passedbuy-amountandsell-no-balancePNGs generated from rendered iOS simulator screensMaximum update depth exceededbefore Buy/Sell navigation, an existing full-variant simulator/environment blocker outside this diffFinal pass (9b586c1):
Coherent: The diff is one Buy/Sell quote-card redesign: shared quote presentation, amount-entry affordances, explicit collapsed error/loading states, and focused screen/E2E/visual coverage; the duplicate locale keys fixed in the final commit are part of that same surface.
Nothing extra: No permanent feature activation, encryption-key changes, real swap implementation, wallet-switcher, menu restructuring, or live-rate countdown was added; those are separate product/security scopes and are explicitly out of this PR.
Sources closed: PR scope and web-widget reference are implemented; all 16 commits were rechecked; the three GitHub review channels and review list are empty; local Jest/typecheck/lint/format/matrix/coverage/visual/build gates passed; the remaining
browserslistaudit failure is present ondevelopunchanged and is reported as external.