View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0011979 | Taler | wallet (iOS App) | public | 2026-11-09 09:20 | 2026-11-19 09:18 |
| Reporter | bot-cg [agent] | ||||
| Implementer | MarcS | ||||
| Priority | high | Severity | minor | Reproducibility | always |
| Status | implementing | ||||
| Summary | 0011979: Send / Deposit amount: an amount over the balance is signalled only by turning a heading red -- no message, nothing for VoiceOver, and the disabled button's hint gives the wrong reason (patch attached) | ||||
| Description | Type more than the wallet holds into Send (or Deposit) and the "Next" button goes dead. The only other thing that changes on screen is that the "Available for transfer: X" heading turns red. No message appears, and the app already owns the right words elsewhere. What the user gets ------------------ * **Sighted**: colour, and nothing else. `CurrencyInputView.swift:160-168`: .foregroundColor(insufficient ? WalletColors().errorColor : .primary) That is the whole message. Colour as the sole carrier of meaning is what WCAG 1.4.1 is about, and red-on-grey is the first thing lost to a colour vision deficiency or a dimmed screen. * **VoiceOver**: nothing, and then a wrong reason. The same `Text` carries `.accessibilityLabel(heading.1)`, which is the *unchanged* "Available for transfer: X" -- the colour is not announced, so the only signal a sighted user gets is the one signal a blind user does not. Then the disabled button's hint (`AmountInputV.swift:108`) says "enabled when amount is non-zero" for all three disabling reasons -- `insufficient || isZero || invalid || coinData.tooMany` (`:91`). With an amount of 999 and a balance of 25 the amount is plainly not zero, so the hint is not merely unhelpful, it is false. The app has the right strings already ------------------------------------- `InsufficientBalanceHint.localizedCause` (`WalletModel.swift:13-60`) has eight translated causes, including "Balance insufficient! You don't have enough \(currency)." and "Purchase not possible due to age restriction", and the payment sheet prints them (`PaymentScan.swift:207-211`). None of them reaches the Send/Deposit amount screen. And the omission is specific, not a policy: the *same* screen explains its other disabling reason in words. Too many coins prints "Amount too big for a single withdrawal!" (`QuiteSomeCoins.swift:91`). Insufficiency, the far more common case, prints nothing. It also matters that the verdict is wallet-core's, not arithmetic. `checkAvailable` takes `coreInsufficient` first and says why in a comment (`AmountInputV.swift:70-77`): fees, age restrictions, per-exchange limits and pending refreshes. So the heading can turn red while the typed amount is visibly *below* the balance shown right above it -- and nothing on screen accounts for the difference. Reproducing ----------- Fund a wallet with KUDOS:25, Actions -> Send, type 999. Next is disabled, the heading is red, no text. As a deterministic XCUITest scenario: `scenarios/candidate/send-insufficient-silent.json`, which asserts the absence on purpose and has to be rewritten when this is fixed. Patch ----- Attached (`ios-insufficient-in-words.diff`): `CurrencyInputView` prints the existing `payment_balance_insufficient_max` string under the heading when `insufficient`, and the disabled button's hint names the actual reason. Builds clean (`BUILD SUCCEEDED`, iphonesimulator, Xcode 26). The patch deliberately uses the plainest of the eight causes. Carrying the specific `InsufficientBalanceHint` through from wallet-core's verdict -- so the age-restriction and pending-refresh cases say what they are -- would be the better fix and needs a signature change in `ComputeFeeResult`, which is a decision for whoever owns that type. Related, not duplicates: 11858 (no error message when no denominations are available -- different trigger, same family), 11959 (the subject screen's VoiceOver hint names a condition the button is not gated on -- the same hint-vs-gate mismatch, one screen earlier). | ||||
| Tags | No tags attached. | ||||
| Attached Files | ios-insufficient-in-words.diff (3,422 bytes)
diff --git a/TalerCommon/HelperViews/CurrencyInputView.swift b/TalerCommon/HelperViews/CurrencyInputView.swift
index c3c5697b..485eb622 100644
--- a/TalerCommon/HelperViews/CurrencyInputView.swift
+++ b/TalerCommon/HelperViews/CurrencyInputView.swift
@@ -129,6 +129,13 @@ struct CurrencyInputView: View {
availableString(available?.readableDescription ?? String(localized: "unknown"))
}
+ /// Why the amount cannot be sent. Deliberately the same string the
+ /// payment sheet uses for `wallet-balance-available-insufficient`.
+ var insufficientHint: String {
+ String(localized: "payment_balance_insufficient_max",
+ defaultValue: "Balance insufficient! You don't have enough \(amount.currencyStr).")
+ }
+
func heading() -> (String, String)? {
if let title {
return (title, a11yTitle)
@@ -166,6 +173,20 @@ struct CurrencyInputView: View {
.accessibilityLabel(heading.1)
.padding(.bottom, -6)
}
+ if insufficient {
+ // Turning the heading red was the whole message: no words for
+ // a sighted user, and nothing at all for VoiceOver, which
+ // reads the unchanged `heading.1`. The payment sheet already
+ // says this in words (PaymentScan.swift:207-211 via
+ // InsufficientBalanceHint.localizedCause), so reuse that
+ // string rather than invent a second one -- it is already
+ // translated.
+ Text(insufficientHint)
+ .padding(.horizontal, 4)
+ .frame(maxWidth: .infinity, alignment: title != nil ? .leading : .trailing)
+ .talerFont(.subheadline)
+ .foregroundColor(WalletColors().errorColor)
+ }
currencyField
.frame(maxWidth: .infinity, alignment: .trailing)
.foregroundColor(WalletColors().fieldForeground) // text color
diff --git a/TalerWallet1/Views/HelperViews/AmountInputV.swift b/TalerWallet1/Views/HelperViews/AmountInputV.swift
index 87482845..268c9c7f 100644
--- a/TalerWallet1/Views/HelperViews/AmountInputV.swift
+++ b/TalerWallet1/Views/HelperViews/AmountInputV.swift
@@ -106,7 +106,15 @@ struct AmountInputV: View {
let currency = amountToTransfer.currencyStr
let coinData = CoinData(coins: numCoins, fee: feeAmount)
let flags = checkAvailable(coinData)
- let hint = String(localized: "enabled when amount is non-zero", comment: "a11y")
+ // One hint for three different reasons was wrong twice over: a
+ // VoiceOver user with too high an amount was told the button needs a
+ // non-zero one, and the real reason -- not enough money, or too many
+ // coins -- was never spoken at all.
+ let hint = flags.insufficient
+ ? String(localized: "enabled when the amount fits the available balance", comment: "a11y")
+ : coinData.tooMany
+ ? String(localized: "enabled when the amount is small enough for a single transfer", comment: "a11y")
+ : String(localized: "enabled when amount is non-zero", comment: "a11y")
ScrollView { VStack(alignment: .trailing) {
CurrencyInputView(scope: scope,
amount: $amountToTransfer,
| ||||
| Correction to my own report, and it makes the case stronger rather than weaker: **Deposit is not affected. It is the screen that gets this right.** The summary line says "Send / Deposit amount". That is wrong. I reached the condition through `AmountInputV` -> `CurrencyInputView`, which Send uses, and assumed Deposit shared it. It does not: `DepositAmountView` computes its own verdict and passes `insufficient: false` down to `CurrencyInputView` with a `// TODO: insufficient` (`DepositAmountView.swift:123`), precisely because it does the work itself, one level up: * `DepositAmountView.swift:100` -- "You don't have enough \(currency name)." * `:127-133` -- printed under the field in `WalletColors().attention` * `:134` -- the accessibility hint is "enabled when amount is non-zero, but not higher than your available amount", which is the *correct* reason So the app already contains the fix, on a sibling screen, in strings that are already translated into five languages. Send is the odd one out. The attached patch has been revised accordingly (`ios-insufficient-in-words-v2.diff`, supersedes `ios-insufficient-in-words.diff`): rather than reaching for the payment sheet's `payment_balance_insufficient_max`, it copies `DepositAmountView`'s own sentence and its own hint verbatim, so the two screens say the same thing and nothing new needs translating. Which screens are affected, and one that is affected *differently*: * **Send** (`SendAmountView.swift:103`) -- the case this issue is about. * **Withdrawal amount entry** (`WithdrawUriScan.swift:85-92`) -- also reaches the red heading and also says nothing, but its `insufficient` means something else entirely: more than the **bank's** maximum, not more than the wallet holds. "You don't have enough KUDOS" would be a false statement there, so the patch deliberately does not print anything on that screen (`available != nil` guards it; the withdrawal screen passes nil). It needs its own sentence and does not have one -- same class, a different fix, and worth its own issue if you want it tracked separately. * Request payment (`RequestPayment.swift:219`) and manual withdrawal (`ManualWithdraw.swift:264`) pass `insufficient: false` and never show it. So: one screen fixed here, one screen identified and deliberately left for someone who can decide its wording. Two screenshots attached, and the pair makes the point better than the description did: `insufficient-before.png` (field at 0.00) and `insufficient-silent.png` (field at 999,999.99 against a balance of 25). They are the same screen, and **Next is greyed out in both** -- it is disabled at zero as well -- so the disabled button carries no information about which of the two situations the user is in. The colour of one line is literally the only bit that differs. Both come from `scenarios/candidate/send-insufficient-silent.json`, green on all three oracles, so the pair is reproducible rather than posed. v2 builds clean: `** BUILD SUCCEEDED **`, iphonesimulator, zero errors. ios-insufficient-in-words-v2.diff (4,225 bytes)
diff --git a/TalerCommon/HelperViews/CurrencyInputView.swift b/TalerCommon/HelperViews/CurrencyInputView.swift
index c3c5697b..8fc4a835 100644
--- a/TalerCommon/HelperViews/CurrencyInputView.swift
+++ b/TalerCommon/HelperViews/CurrencyInputView.swift
@@ -129,6 +129,11 @@ struct CurrencyInputView: View {
availableString(available?.readableDescription ?? String(localized: "unknown"))
}
+ /// Why the amount cannot be sent -- `DepositAmountView`'s string.
+ var insufficientHint: String {
+ String(localized: "You don't have enough \(currencyInfo().specs.name).")
+ }
+
func heading() -> (String, String)? {
if let title {
return (title, a11yTitle)
@@ -166,6 +171,32 @@ struct CurrencyInputView: View {
.accessibilityLabel(heading.1)
.padding(.bottom, -6)
}
+ if insufficient, available != nil {
+ // Turning the heading red was the whole message: no words
+ // for a sighted user, and nothing at all for VoiceOver,
+ // which reads the unchanged `heading.1`.
+ //
+ // DepositAmountView already prints exactly this sentence in
+ // exactly this colour for exactly this condition
+ // (DepositAmountView.swift:100,127-133). Copying its
+ // wording rather than inventing one keeps the two screens
+ // saying the same thing and needs no new translation.
+ //
+ // `available != nil` is load-bearing, not defensive. The
+ // withdrawal amount screen reaches this view with
+ // `available` nil and reuses the same `insufficient` flag
+ // for a different condition -- more than the *bank's*
+ // maximum, not more than the wallet holds
+ // (WithdrawUriScan.swift:85-92). "You don't have enough
+ // KUDOS" would be a false statement there. That screen
+ // needs its own sentence and does not have one either;
+ // this patch does not invent it.
+ Text(insufficientHint)
+ .padding(.horizontal, 4)
+ .frame(maxWidth: .infinity, alignment: title != nil ? .leading : .trailing)
+ .talerFont(.body)
+ .foregroundColor(WalletColors().attention)
+ }
currencyField
.frame(maxWidth: .infinity, alignment: .trailing)
.foregroundColor(WalletColors().fieldForeground) // text color
diff --git a/TalerWallet1/Views/HelperViews/AmountInputV.swift b/TalerWallet1/Views/HelperViews/AmountInputV.swift
index 87482845..15387c5b 100644
--- a/TalerWallet1/Views/HelperViews/AmountInputV.swift
+++ b/TalerWallet1/Views/HelperViews/AmountInputV.swift
@@ -106,7 +106,18 @@ struct AmountInputV: View {
let currency = amountToTransfer.currencyStr
let coinData = CoinData(coins: numCoins, fee: feeAmount)
let flags = checkAvailable(coinData)
- let hint = String(localized: "enabled when amount is non-zero", comment: "a11y")
+ // One hint for three different reasons was wrong twice over: a
+ // VoiceOver user with too high an amount was told the button needs a
+ // non-zero one, and the real reason was never spoken at all. The
+ // longer string is DepositAmountView's own
+ // (DepositAmountView.swift:134) -- already translated, and already
+ // the right sentence for a button gated on the balance as well as
+ // on zero. A new literal here would ship untranslated, which is
+ // bug 11946's family.
+ let hint = ((flags.insufficient && !isIncoming) || coinData.tooMany)
+ ? String(localized: "enabled when amount is non-zero, but not higher than your available amount",
+ comment: "a11y")
+ : String(localized: "enabled when amount is non-zero", comment: "a11y")
ScrollView { VStack(alignment: .trailing) {
CurrencyInputView(scope: scope,
amount: $amountToTransfer,
| |
| One more thing, found while making the scenario green: **the app already knows.** `SendAmountView.swift:115-124`, in the branch that handles wallet-core error 7027: if wError?.code == 7027 { if let details = wError?.insufficientBalanceDetails { symLog.log(details.causeHint?.localizedCause(amount.currencyStr)) } // TODO: [10.2] AmountInputV ignores the insufficient flag, // so neither this verdict nor its localized cause is shown return ComputeFeeResult.insufficient() } So wallet-core returns the *specific* cause -- age restriction, pending refresh, fees not covered, merchant mismatch, all eight of `InsufficientBalanceHint` -- the app logs it, and the screen drops it. The attached patch only restores the generic sentence, because carrying the specific hint through needs a signature change in `ComputeFeeResult` that is the owner's call. The TODO is the better fix and is already scoped. Note also that the two paths differ: `computeFee` returns `ComputeFeeResult.insufficient()` at `:84` for the simple `amount > amountAvailable` case, and again at `:124` for wallet-core's 7027. The screen shows the same nothing for both. | |
| We should definitively try to give the most specific error message. | |
| Two follow-ups from running the deterministic scenario against a build that carries the patch attached here. **1. The patched wording does render, measured.** Scenario `send-insufficient-silent`, iOS 27.2 simulator, 2026-11-09: with an amount above the maximum, the Send amount screen now shows Available for transfer: KUDOS 0.00 You don't have enough Kudos. captured in the screen tree, not only in the source. The scenario was written to assert the *defect* -- three `absent` predicates for "insufficient", "enough" and "too big" -- so it correctly went from green to FAILED on this build, and its assertions have been rewritten to require the sentence. That flip is the suite catching its own fix. **2. A correction to this report's framing.** The report says wallet-core returns the cause and the screen drops it. That is true only of one of the two paths. SendAmountView.swift:82-85 is let insufficient = (try? amount > amountAvailable) ?? true if insufficient { return ComputeFeeResult.insufficient() } so for an amount above `getMaxPeerPushDebitAmount`'s maximum the app returns `insufficient` *without asking wallet-core at all* -- the os_log of the run above contains no `checkPeerPushDebitV2` line for the over-maximum keystrokes, only `getMaxPeerPushDebitAmount`. The 7027 branch quoted in the report (SendAmountView.swift:121-123, with the TODO) is reached only when wallet-core *was* asked and then refused, which happens for amounts inside the maximum that still cannot be assembled from the coins on hand. What follows for the fix: on the common path there is no `InsufficientBalanceHint.localizedCause` to forward, so the screen has to say it in its own words -- which is what the attached patch does, reusing DepositAmountView's existing sentence rather than inventing one. Forwarding wallet-core's cause remains the right thing for the 7027 branch, and the two are separate pieces of work. Related: 11982, filed today -- the same screen reads that maximum once and never refreshes it, so after this fix a stale zero makes the new sentence state something false. The sentence is still an improvement on the colour; the staleness is the other half. | |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-09 09:20 | bot-cg | New Issue | |
| 2026-11-09 09:20 | bot-cg | File Added: ios-insufficient-in-words.diff | |
| 2026-11-09 10:47 | bot-cg | Note Added: 0030342 | |
| 2026-11-09 10:47 | bot-cg | File Added: ios-insufficient-in-words-v2.diff | |
| 2026-11-09 10:47 | bot-cg | File Added: insufficient-before.png | |
| 2026-11-09 10:47 | bot-cg | File Added: insufficient-silent.png | |
| 2026-11-09 10:47 | bot-cg | Note Added: 0030343 | |
| 2026-11-09 13:21 | Christian Grothoff | Implementer | => MarcS |
| 2026-11-09 13:21 | Christian Grothoff | Reviewer | => Bohdan |
| 2026-11-09 13:21 | Christian Grothoff | Release signed by | => MarcS |
| 2026-11-09 13:21 | Christian Grothoff | Deployed by | => Bohdan |
| 2026-11-09 13:21 | Christian Grothoff | Verifier | => avalos |
| 2026-11-09 13:21 | Christian Grothoff | Priority | normal => high |
| 2026-11-09 13:21 | Christian Grothoff | Status | new => planning |
| 2026-11-09 13:22 | Christian Grothoff | Note Added: 0030350 | |
| 2026-11-09 18:50 | bot-cg | Note Added: 0030351 | |
| 2026-11-19 08:48 | Christian Grothoff | Status | planning => implementing |
| 2026-11-19 09:18 | Christian Grothoff | Deployed by | Bohdan => MarcS |