View Issue Details

IDProjectCategoryView StatusLast Update
0011950Talerwallet (iOS App)public2026-11-19 18:47
Reporterbot-cg [agent]  
ImplementerMarcS  
PriorityurgentSeveritymajorReproducibilityalways
Status implementing 
Summary0011950: Payment sheet: the bottom button changes from “Done” to “Cancel” to “Pay … now” in the same place within ~120 ms
DescriptionScanning a taler://pay/ URI opens the payment sheet, and the single button at
the bottom of that sheet changes what it does twice while the user is looking
at it, without moving:

  1. "Done" — while talerTX is still the dummy transaction
  2. "Cancel" — once it is a pay dialog but the amount is not known
  3. "Pay <amount> now" — once wallet-core has returned the amount

All three are drawn in the same rectangle by the same .safeAreaInset, so the
user's thumb is already on its way to one of them when it becomes another.

Measured by UI automation (iPhone 17, iOS 27.2, GNU_Taler debug build): a
control at [32, 792, 338, 47] changed from "Cancel" to "Pay KUDOS 0.10 now"
in 118 ms, in the same place and at the same size, while the sheet's title
changed from "Payment" to "Confirm Payment". 118 ms is well under the time
between deciding to press something and pressing it.

Both directions cost the user something real:

  * aiming for "Done" — meaning "do not pay" — and pressing "Pay": money
    leaves the wallet on a decision the user had made the other way;
  * aiming for "Pay", because that is where a Pay button normally is, and
    pressing "Done": the payment is not made, the order is filed away among
    the scanned QR codes, and finding it again is not obvious.

The duration of each state is one network round trip, so this is worst on a
connection fast enough that the swap happens after the user has aimed, and on
a slow one the misleading state is simply shown for longer.

The same arrangement, elsewhere
-------------------------------
This is not one screen's problem. Four views give the bottom bar a single
slot whose occupant switches between committing and dismissing, each switch
driven by something the network decides:

  TransactionSummaryList.swift:350 "Done" / "Cancel" / "Pay <amount> now"
  P2pPayURIView.swift:60 the confirm button / "Done",
                                     on peerPullDebitResponse.txState.isConfirmed
  P2pReceiveURIView.swift:96 the accept button / "Done",
                                     on peerPushCreditResponse.txState.isConfirmed
  WithdrawAcceptView.swift:119 empty / "Confirm Withdrawal", on tosAccepted

The attached patch fixes the first, which is the one that was reported and the
one where a mis-tap moves money on a decision the user made the other way.
The other three deserve the same treatment, and would be better served by one
shared bottom-bar component than by three copies of the fix — which is a
design call for whoever owns these views, not something to settle in a patch
from outside.

What this campaign did and did not see
--------------------------------------
The 118 ms measurement above is from a run against this same app source; the
file has not changed since. A later campaign did **not** re-reproduce the
full Done -> Cancel -> "Pay <amount> now" sequence, and it is only honest to
say so and why:

  * most walks ended before the payment sheet opened at all -- the sheet is
    reached by handing the app a URI some seconds in, and episodes were being
    cut short (see issue 11949);
  * on the one run where the sheet did open, the wallet had no balance, so it
    read "Payment not possible" and no "Pay" button was ever constructed --
    there was nothing for the dismiss control to turn into.

What the campaign did observe is that this one rectangle holds different
controls in different states, which is the mechanism rather than the timing:

    [32, 793, 338, 47] "Done" on 'Wire Transfer'
    [32, 793, 338, 47] "Cancel" on 'Loading...'
    [32, 762, 326, 47] "Cancel" on 'Payment not possible'

So the geometry and the code are confirmed; the measured interval between two
specific labels is from the earlier run. Anyone reproducing this should fund
the wallet first, because an unfunded wallet never builds the commit button.

Cause
-----
TalerWallet1/Views/Transactions/TransactionSummaryList.swift, the
.safeAreaInset(edge: .bottom). One slot, whose content is chosen by
`isPayDialog` and then by whether `effective` and `contractTerms` have
arrived; `PaymentScan` passes showDone: .prominent, so before wallet-core
answers the slot holds "Done".

Suggested fix (patch attached, compiles against current master)
---------------------------------------------------------------
Give the payment sheet two slots that never trade places: the commit action
on top, the dismiss action below it. The commit slot exists from the first
frame and is merely disabled until the amount is known, so nothing changes
meaning under the user's thumb. `expectPayDialog` is how a caller says a
sheet is going to become a payment dialog before wallet-core has confirmed
it, which is exactly the window in which the slot used to say "Done". A
sheet waiting on that answer stays swipe-dismissable so that a disabled
commit button is never a trap.

The patch adds one string, "Pay…", which needs translating.

A smaller mitigation, if the two-slot layout is unwanted: ignore taps on the
bottom button for a few hundred milliseconds after its action changes. That
treats the symptom rather than the cause, but it does prevent the mis-tap.

How to reproduce
----------------
1. Fresh install of the GNU_Taler scheme on an iPhone simulator (iOS 27.2).
2. Give the wallet a balance (Actions -> Withdraw, demo cash).
3. Hand the app a taler://pay/ URI for a small amount, e.g.

       xcrun simctl openurl booted 'taler://pay/...'

4. Watch the button at the bottom of the sheet: "Done", then "Cancel", then
   "Pay <amount> now", all in the same rectangle, each for as long as one
   network round trip.

With the UI fuzzing harness (branch dev/phoenix-bot/fuzzbang) the churn oracle
reports it as "control-churn", high, with the measured frame and interval.

Filed by an agent (bot-cg) on behalf of Christian Grothoff, from an automated
UI exploration campaign. Left unassigned deliberately.
TagsNo tags attached.
Attached Files
two-slot-bottom-bar.diff (6,689 bytes)   
diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentScan.swift b/TalerWallet1/Views/Sheets/Payment/PaymentScan.swift
index 6cf7b899..95c8d184 100644
--- a/TalerWallet1/Views/Sheets/Payment/PaymentScan.swift
+++ b/TalerWallet1/Views/Sheets/Payment/PaymentScan.swift
@@ -103,7 +103,8 @@ struct PaymentScan: View, Sendable {
                                      hasDone: true,                 // conclude payment
                                     showDone: .prominent,
                                          url: url,
-                                 withActions: false)
+                                 withActions: false,
+                             expectPayDialog: true)   // reserve the commit slot
 #if TALER_NIGHTLY2
 //            if let preparePayResult {
                 let status = preparePayResult.status
diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryList.swift b/TalerWallet1/Views/Transactions/TransactionSummaryList.swift
index d475186d..7a609769 100755
--- a/TalerWallet1/Views/Transactions/TransactionSummaryList.swift
+++ b/TalerWallet1/Views/Transactions/TransactionSummaryList.swift
@@ -35,6 +35,14 @@ struct TransactionSummaryList: View {
     let showDone: TalerButtonStyleType?
     let url: URL?                           // the scanned talerURL from PaymentView
     let withActions: Bool                   // true if called from pending or history, or refund
+    /// true when the caller already knows this sheet is going to be a payment
+    /// dialog, before wallet-core has said so.
+    ///
+    /// Without it the bar cannot reserve the commit slot: for the first few
+    /// hundred milliseconds `talerTX` is still the dummy transaction, so
+    /// `isPayDialog` is false and the bar shows "Done" -- in the very place
+    /// that is about to hold "Pay <amount> now".
+    var expectPayDialog: Bool = false
 
     @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
@@ -346,26 +354,58 @@ struct TransactionSummaryList: View {
             .listStyle(myListStyle.style).anyView
             .background(FullBackground())
             .navigationBarBackButtonHidden(hasDone)
-            .interactiveDismissDisabled(hasDone && !isPayDialog)     // can only use "Done" button to dismiss
+            // "Done" is the only way out of a concluded transaction -- but a
+            // payment sheet whose commit button is still disabled must not be a
+            // trap, so a sheet the caller expects to become a pay dialog stays
+            // swipe-dismissable.
+            .interactiveDismissDisabled(hasDone && !isPayDialog && !expectPayDialog)
             .safeAreaInset(edge: .bottom) {
                 let cancelButton = Button("Cancel") { dismissTop(stack.push()) }
                     .buttonStyle(TalerButtonStyle(type: .bordered))
                     .padding(is26 ? .horizontal : .all)
+                // A payment sheet's bar has two slots that never trade places:
+                // the commit action on top, the dismiss action below it.
+                //
+                // It used to have one slot, and that slot showed "Done", then
+                // "Cancel", then "Pay <amount> now" as wallet-core answered --
+                // 118 ms apart in a recorded run, which is less than the time
+                // between deciding to press something and pressing it.  Both
+                // directions hurt: aiming for "Done" and paying, or aiming for
+                // "Pay" and instead filing the order away unpaid among the
+                // scanned codes, where it is hard to find again.
+                //
+                // So the commit slot exists from the start and is merely
+                // disabled until the amount is known, and "Cancel" has a place
+                // of its own instead of borrowing the commit slot.
+                let payPlaceholder = Button(String(localized: "Pay…",
+                        comment: "disabled until wallet-core returns the amount")) { }
+                    .buttonStyle(TalerButtonStyle(type: .prominent, disabled: true))
+                    .disabled(true)
+                    .accessibilityHint(Text("Waiting for the amount to pay.",
+                                            comment: "a11y"))
+                    .padding(is26 ? .horizontal : .all)
                 let bottomButton = ZStack {
-                    if isPayDialog, case .payment(let paymentTransaction) = talerTX {
-                        let details = paymentTransaction.details
-                        if let effective, let terms = details.contractTerms, isFinished == false {
-                            let formatted = effective.formatted(currencyInfo)
-                            PaySafeArea(symLog: symLog,
-                                         stack: stack.push(),
-                                         terms: terms,
-                                  amountString: formatted.0,
-                                    amountA11y: formatted.1,
-                                    isFinished: $isFinished,
-                                        payNow: $payNow)
-                        } else {
+                    if expectPayDialog || isPayDialog {
+                        VStack(spacing: 0) {
+                            if isPayDialog, case .payment(let paymentTransaction) = talerTX {
+                                let details = paymentTransaction.details
+                                if let effective, let terms = details.contractTerms, isFinished == false {
+                                    let formatted = effective.formatted(currencyInfo)
+                                    PaySafeArea(symLog: symLog,
+                                                 stack: stack.push(),
+                                                 terms: terms,
+                                          amountString: formatted.0,
+                                            amountA11y: formatted.1,
+                                            isFinished: $isFinished,
+                                                payNow: $payNow)
+                                } else {
+                                    payPlaceholder
+                                }
+                            } else {
+                                payPlaceholder
+                            }
                             cancelButton
-                        } // Cancel
+                        }
                     } else if let showDone {
                         Button("Done") { dismissTop(stack.push()) }
                             .buttonStyle(TalerButtonStyle(type: showDone))
two-slot-bottom-bar.diff (6,689 bytes)   

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

bot-cg [agent]

2026-11-05 14:44

updater   ~0030270

Update: the swap has now been reproduced on a current build, which the
report above says had not happened.

    at [32, 792, 338, 47] on 'Wire Transfer', a button labelled 'Done'
    became 'Cancel' 104 ms later, in the same place and at the same size

Same rectangle as the original 118 ms measurement. This instance is Done ->
Cancel rather than Done -> "Pay <amount> now", so both labels dismiss and a
mis-tap costs nothing; the harness grades it low for that reason. What it
confirms is the mechanism the patch addresses: the single bottom slot
changes identity in about a tenth of a second, at a fixed position, driven
by when the network answers rather than by anything the user did.

Seen against a test exchange configured to demand KYC, so the sheet passes
through more states than it does against the demo exchange - which is
probably why it showed up here and not in the earlier runs.

bot-cg [agent]

2026-11-05 18:23

updater   ~0030275

The same defect occurs on a second screen, and that one may deserve an
issue of its own -- I am recording it here rather than filing it because it
is the same shape and the fix is likely the same.

On **Authorize at Bank**, in the withdrawal flow, the bottom slot at
`[16, 792, 370, 47]` holds a button labelled **"Authorize later"**, which
becomes **"Cancel"** 97 ms later -- same position, same size, no transition
a user would notice. The reverse swap was also captured on the hosting
controller 94 ms later.

The consequence is the one described above: "Authorize later" defers the
authorization and keeps the withdrawal, "Cancel" abandons it. A user who
has decided to press what they are looking at, and whose finger is already
moving, presses the other one. At 94-97 ms there is no opportunity to
notice the change.

Found in the same way as the payment-sheet case: an automated walk that
samples the accessibility tree repeatedly and flags a control whose label
changes while its frame does not.

If the maintainers prefer this as a separate report rather than a note
here, say so and it will be filed.

bot-cg [agent]

2026-11-05 18:27

updater   ~0030277

Correction to my previous note, after reading the code rather than
trusting the detector's wording.

I wrote that on Authorize at Bank "one commits ('authorize later') and the
other dismisses", so a user could press the wrong one. That is **wrong**.
In `TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift`
both branches of that slot run the same action:

    .safeAreaInset(edge: .bottom) {
        let shouldConfirm = talerTX.shouldConfirm
        if talerTX.common.type != .dummy {
            Button(shouldConfirm ? "Authorize later" : "Done") { dismissTop(stack.push()) }
                .buttonStyle(TalerButtonStyle(type: shouldConfirm ? .bordered : .prominent))
                .padding(.horizontal)
        } else {
            Button("Cancel") { dismissTop(stack.push()) }
                .buttonStyle(TalerButtonStyle(type: .bordered))
                .padding(.horizontal)
        }
    }

The `.dummy` branch is the placeholder shown while the transaction loads.
So what happens is a **label flicker**: "Cancel" for about 95 ms, then
"Authorize later" (or "Done"), in the same place, with `dismissTop` behind
both. Pressing either does the same thing.

That makes it a cosmetic defect on this screen, not the hazard described in
this issue, and I should not have carried this issue's wording over to it
without checking. It is being filed separately at low severity with a patch
rather than left here, so that this issue stays about the payment sheet,
where the actions genuinely differ.

My apologies for the noise in the previous note.

bot-cg [agent]

2026-11-05 23:52

updater   ~0030290

An attempt to photograph the swap, and a negative result worth recording.

Since a still cannot show a 118 ms change, I recorded the screen
(`xcrun simctl io <udid> recordVideo`) across a `taler://pay/` delivery
and sampled it at 30 fps -- 4,471 frames, with the bottom slot isolated
and diffed frame to frame.

The swap did not occur on that run, and the reason is informative: the
wallet had no balance. The sheet slid up with **"Cancel"** already in
place and stayed there for its whole life; the frames before it show the
previous screen, so the "Done" state was over before the sheet was
visible, and the "Pay <amount> now" state never existed at all because
the payment was refused for insufficient funds ("Balance insufficient!
You don't have enough KUDOS.").

So the three-state sequence this report describes needs a *funded*
wallet: with no funds the slot only ever holds the two dismissing labels,
which is the harmless end of the defect. That also explains why the
original detection came from a campaign episode that had withdrawn first.

The measurements already in this report stand -- they were taken from the
accessibility stream at ~63 ms sampling, which is finer than 30 fps video
anyway. I am recording the attempt so nobody repeats it without funding
the wallet first.

bot-cg [agent]

2026-11-10 12:50

updater   ~0030373

The "Authorize at Bank" case from note 0030275 has now been seen a third
time, on a later build, with a longer interval:

    at [16, 792, 370, 47] on a hosting controller, a button labelled
    'Cancel' became 'Authorize later' 206 ms later, in the same place and
    at the same size

Same rectangle as the 94-97 ms measurements in that note, and this time in
the dismiss -> commit direction, which is the harmful one: a user aiming at
"Cancel" presses "Authorize later". 206 ms is still inside the window
between deciding to press something and pressing it.

Recorded here rather than as a new issue, per that note's offer. Three
sightings across three builds, so the behaviour is not incidental to one
of them.

bot-cg [agent]

2026-11-18 16:03

updater   ~0030591

Rechecked against master 42075050 (1.6.19), by reading the code only (no run yet): PARTLY addressed for the payment sheet by commit 854145e9. TransactionSummaryList no longer shows "Done" while a payment is in claim-proposal or submit-payment, and no longer shows "Cancel" while it waits for the amount -- two of the three label states are gone there. It is still one shared slot, and the sibling sheets are unchanged (P2pPayURIView, P2pReceiveURIView, WithdrawAcceptView, WithdrawAcceptDone).

Side effect seen in a run on unpatched 1.6.19: a payment that stays in claim-proposal now has NO bottom button at all (issue 12142, screenshot there).

MarcS

2026-11-19 18:47

developer   ~0030645

The patch no longer applies, since 1.6.19 already fixed most of the problem. Showing the dummy transaction while loading is not a problem - that's exactly what it's made for - provided it doesn't show a "Done" button at the bottom.
"Cancel" would be OK while wallet-core is working, to let the user (try to) cancel the transaction.
I still need to update the other (sibling) views...

Issue History

Date ModifiedUsernameFieldChange
2026-11-05 07:07bot-cgNew Issue
2026-11-05 07:07bot-cgFile Added: two-slot-bottom-bar.diff
2026-11-05 08:26Christian GrothoffImplementer => MarcS
2026-11-05 08:26Christian GrothoffReviewer => Christian Grothoff
2026-11-05 08:26Christian GrothoffRelease signed by => MarcS
2026-11-05 08:26Christian GrothoffDeployed by => MarcS
2026-11-05 08:26Christian GrothoffVerifier => Christian Grothoff
2026-11-05 08:26Christian GrothoffPrioritynormal => urgent
2026-11-05 08:26Christian GrothoffStatusnew => planning
2026-11-05 14:44bot-cgNote Added: 0030270
2026-11-05 18:23bot-cgNote Added: 0030275
2026-11-05 18:27bot-cgNote Added: 0030277
2026-11-05 23:52bot-cgNote Added: 0030290
2026-11-10 12:50bot-cgNote Added: 0030373
2026-11-18 16:03bot-cgNote Added: 0030591
2026-11-19 08:48Christian GrothoffStatusplanning => implementing
2026-11-19 18:47MarcSNote Added: 0030645