taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 333d04ace7a3714d731c4a84a4df004a02c18779
parent e55e4f53dd6365f05078500991a529866f0ece4e
Author: Florian Dold <dold@taler.net>
Date:   Tue,  3 Nov 2026 09:27:00 +0100

wallet-webui: remove balance keeping cost display

Diffstat:
Mpackages/wallet-webui/src/screens/BalanceScreen.tsx | 29+++--------------------------
Mpackages/wallet-webui/test/screens.test.tsx | 7+++----
2 files changed, 6 insertions(+), 30 deletions(-)

diff --git a/packages/wallet-webui/src/screens/BalanceScreen.tsx b/packages/wallet-webui/src/screens/BalanceScreen.tsx @@ -114,7 +114,9 @@ export function RefreshBalanceDetails(props: { onDismiss?: (id: string) => void; }) { const refresh = props.balance.refresh; - if (!refresh) return null; + if (!refresh || (!refresh.risks.length && !refresh.recoveries.length)) { + return null; + } return ( <div class="mt-4 max-w-xl space-y-3 break-words text-sm"> {refresh.risks.map((r, index) => ( @@ -156,31 +158,6 @@ export function RefreshBalanceDetails(props: { )} </div> ))} - <details class="rounded-lg border border-outlineVariant p-3"> - <summary class="cursor-pointer font-semibold">{ - /* Translators: The cost of renewing digital cash to keep it spendable over time, not a bank-account maintenance fee. */ i18n.str`Cost of keeping this balance` - }</summary> - {refresh.bound !== undefined ? ( - <p class="mt-2">{ - /* Translators: %1$s is a monetary upper bound on renewal costs for the current balance under the assumptions shown below; it is not a bill or an expected charge. */ i18n.str`Conditional upper bound over 365 days: ${refresh.bound}.` - }</p> - ) : ( - <div class="mt-2"> - <p>{ - /* Translators: The wallet cannot calculate an upper bound for annual digital-coin renewal costs. */ i18n.str`Annual cost bound unavailable.` - }</p> - {refresh.unavailableReasons.map((r) => ( - <p key={r}>{r}</p> - ))} - </div> - )} - <p class="mt-2">{ - /* Translators: Withdrawing adds digital cash to this wallet, usually funded by a bank transfer; it does not cash out the wallet to a bank account. */ i18n.str`This is an upper bound, not an expected charge. It assumes compatible coins remain continuously available with today's values, fees and lifetime bounds, and that renewal finishes before withdrawal validity ends.` - }</p> - <p class="mt-2">{ - /* Translators: An exchange is a GNU Taler service issuing and redeeming digital cash, not an action that converts one currency into another. */ i18n.str`Future exchange offerings are a projection, not a promise. The bound covers keeping the current balance without payments or additional withdrawals. It excludes initial withdrawal fees, payment-related renewal, and losses from expiration or outages.` - }</p> - </details> </div> ); } diff --git a/packages/wallet-webui/test/screens.test.tsx b/packages/wallet-webui/test/screens.test.tsx @@ -4528,7 +4528,7 @@ test("incomplete storage discovery never offers empty initialization", async () await window.happyDOM.abort(); }); -test("DD71 details show independent risk, recovery and conditional costs", async () => { +test("DD71 details show risk and recovery without balance costs", async () => { const window = installDom(); const { render, cleanup, act } = await import("@testing-library/preact"); const { RefreshBalanceDetails } = @@ -4567,11 +4567,10 @@ test("DD71 details show independent risk, recovery and conditional costs", async />, ); assert.equal(view.getAllByRole("status").length, 2); - assert.match( + assert.doesNotMatch( view.container.textContent!, - /Conditional upper bound over 365 days/, + /Cost of keeping this balance|Conditional upper bound over 365 days/, ); - assert.match(view.container.textContent!, /not an expected charge/); assert.match(view.container.textContent!, /Sep 12, 2026/); await act(() => { view.getByRole("button", { name: "Dismiss" }).click();