diff --git a/TalerWallet1/Views/Balances/PendingRowView.swift b/TalerWallet1/Views/Balances/PendingRowView.swift index c42bfd39..98dea900 100644 --- a/TalerWallet1/Views/Balances/PendingRowView.swift +++ b/TalerWallet1/Views/Balances/PendingRowView.swift @@ -29,7 +29,36 @@ struct PendingRowView: View { let outTitle1 = String(localized: "TitleOutgoing_Full", defaultValue: "Pending\toutgoing", comment: "`Pending outgoing´ in Balances - set exactly 1 \\t for line break") + /// Why this row is waiting for the *user* rather than for the network. + /// + /// The badge already said this -- as a 􀋃 the size of a full stop, with + /// no text, inside an `accessibilityHidden(true)` HStack. A glyph and a + /// colour cannot carry "you have to do something" on their own, so a + /// transfer blocked on a legitimization check and one that is merely + /// slow read identically on the screen the user is left on. + var actionNeeded: String? { + if needsKYC { + return String(localized: "Legitimization required", comment: "TxMinorState heading") + } + if shouldConfirm { + return String(localized: "Needs bank authorization", comment: "pending row hint") + } + return nil + } + var body: some View { + VStack(alignment: .leading, spacing: 2) { + amountLine + if let actionNeeded { + Text(actionNeeded) + .talerFont(.subheadline) + .foregroundColor(WalletColors().attention) + .frame(maxWidth: .infinity, alignment: .leading) + } + } + } + + @ViewBuilder var amountLine: some View { let pendingColor = WalletColors().pendingColor(incoming) let iconBadge = PendingIconBadge(foreColor: pendingColor, done: false, incoming: incoming, shouldConfirm: shouldConfirm, needsKYC: needsKYC) diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift b/TalerWallet1/Views/Transactions/TransactionRowView.swift index 236c96b8..27244c15 100755 --- a/TalerWallet1/Views/Transactions/TransactionRowView.swift +++ b/TalerWallet1/Views/Transactions/TransactionRowView.swift @@ -102,6 +102,17 @@ struct TransactionRowView: View { var isWorking: Bool { transaction.isWorking } var pending: Bool { transaction.isPending || common.isFinalizing } var needsKYC: Bool { transaction.isPendingKYC || transaction.isPendingKYCauth } + /// The visible twin of this row's `accessibilityValue`. + var actionNeeded: String? { + guard donePendingDialog else { return nil } + if needsKYC { + return String(localized: "Legitimization required", comment: "TxMinorState heading") + } + if shouldConfirm { + return String(localized: "Needs bank authorization", comment: "pending row hint") + } + return nil + } var doneOrPending: Bool { done || pending } var donePendingDialog: Bool { doneOrPending || transaction.isDialog } var shouldConfirm: Bool { transaction.shouldConfirm } @@ -272,6 +283,15 @@ struct TransactionRowView: View { #if TALER_NIGHTLY .overlay { Color.clear.border(green) } #endif + // The row already put this in its accessibilityValue, so + // VoiceOver was told why the transaction is stuck and the screen + // was not. Shown only for the two states that are waiting for + // the user, so an ordinary row's layout is unchanged. + if let actionNeeded { + Text(actionNeeded) + .talerFont(.subheadline) + .foregroundColor(WalletColors().attention) + } } ZStack { row diff --git a/TalerWallet1/Views/Transactions/TransactionTypeDetail.swift b/TalerWallet1/Views/Transactions/TransactionTypeDetail.swift index 75efbdfb..d60906c5 100755 --- a/TalerWallet1/Views/Transactions/TransactionTypeDetail.swift +++ b/TalerWallet1/Views/Transactions/TransactionTypeDetail.swift @@ -134,6 +134,14 @@ struct TransactionTypeDetail: View { KYCauth(stack: stack.push(), common: common) } else if transaction.isPendingKYC { KYCbutton(kycUrl: common.kycUrl) + if common.kycUrl == nil { + // KYCbutton renders nothing at all without a URL, + // so without this the detail view -- the one place + // that explains why the deposit is stuck -- would + // be silent about it. PendingWithdrawalDetails + // has had this fallback all along. + Text("Legitimization procedure required", comment: "KYC") + } } ThreeAmountsSheet(stack: stack.push(), scope: scope, @@ -224,6 +232,10 @@ struct TransactionTypeDetail: View { let details = p2pTransaction.details if transaction.isPendingKYC { KYCbutton(kycUrl: common.kycUrl) + if common.kycUrl == nil { + // Same gap as the deposit case: no URL, no view. + Text("Legitimization procedure required", comment: "KYC") + } } if !transaction.isDone { ExpiresView(expiration: details.info.expiration)