feat(wallet): ecash gets the real payment success screen, with copyable proof
Demo images / Build & push demo images (push) Failing after 2m37s
Demo images / Build & push demo images (push) Failing after 2m37s
Redeeming ecash reported success as one line of small green text, while an on-chain or Lightning payment got the full moment — amount, verb, and the identifiers you can copy. That asymmetry matters most for ecash: it leaves no public ledger entry, so if the payment is ever questioned there is nothing to look up afterwards. Whatever isn't copyable at that instant is simply gone. The success pane is extracted from SendBitcoinModal into a shared PaymentSuccessPane so Cashu and Fedimint show the *same* screen rather than a lookalike, and the copyable-row treatment is defined once. Each caller passes the identifiers its protocol actually has; ecash receive now shows the issuing mint (newly returned by wallet.ecash-receive) and the redeemed token itself, clamped so a long token doesn't flood the pane. Also: the test-ecash switch is a proper toggle (role="switch", keyboard focusable) rather than a checkbox — it selects which purse the wallet is looking at, so it should read as a mode you are in. SendBitcoinModal still carries its own copy of the markup; consolidating it onto the shared component is a follow-up, deliberately not done in the same change as the money-path wiring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
ffec7d3114
commit
f4a1c47429
@@ -36,16 +36,26 @@
|
||||
: 'Real, spendable sats.' }}
|
||||
</p>
|
||||
</div>
|
||||
<label class="flex items-center gap-2 cursor-pointer shrink-0">
|
||||
<div class="flex items-center gap-2 shrink-0">
|
||||
<span class="text-white/60 text-xs">Test mode</span>
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="ecashIsTest"
|
||||
<!-- Switch, not a checkbox: this changes which purse the wallet
|
||||
is looking at, so it should read as a mode you are in. -->
|
||||
<button
|
||||
type="button"
|
||||
role="switch"
|
||||
:aria-checked="ecashIsTest"
|
||||
aria-label="Test mode"
|
||||
:disabled="switchingNetwork"
|
||||
class="h-4 w-4 accent-orange-500"
|
||||
@change="setEcashNetwork(($event.target as HTMLInputElement).checked)"
|
||||
/>
|
||||
</label>
|
||||
class="relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus:ring-2 focus:ring-orange-400/60"
|
||||
:class="ecashIsTest ? 'bg-orange-500' : 'bg-white/15'"
|
||||
@click="setEcashNetwork(!ecashIsTest)"
|
||||
>
|
||||
<span
|
||||
class="inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform"
|
||||
:class="ecashIsTest ? 'translate-x-6' : 'translate-x-1'"
|
||||
></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="ecashIsTest" class="mt-2 text-xs text-orange-200">
|
||||
Your real ecash balance is safe and untouched — it reappears when you turn test mode off.
|
||||
|
||||
Reference in New Issue
Block a user