taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

add-account-note-is-required-but-unmarked.md (4112B)


      1 <!--
      2   This file is part of GNU Taler
      3   (C) 2026 Taler Systems S.A.
      4 
      5   GNU Taler is free software; you can redistribute it and/or modify it under the
      6   terms of the GNU General Public License as published by the Free Software
      7   Foundation; either version 3, or (at your option) any later version.
      8 
      9   GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
     10   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11   A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 
     13   You should have received a copy of the GNU General Public License along with
     14   GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 -->
     16 
     17 # "Add account" is disabled until you fill a field called "Note"
     18 
     19 Found the slow way: two of this campaign's scenarios had been filling the
     20 add-account form correctly, submitting, and reporting success for rounds on end
     21 without ever adding an account. The button was disabled the whole time and
     22 nothing on the screen said why.
     23 
     24 **Severity: low**, but it costs the user the whole feature until they guess.
     25 
     26 ## What happens
     27 
     28 Open **Settings → Bank accounts → Add account**, pick **IBAN**, and fill in the
     29 two fields that look like the form:
     30 
     31 ```
     32 Account holder   Test Holder
     33 IBAN             DE89370400440532013000
     34 Postal code (optional)
     35 Town (optional)
     36 Note
     37 ```
     38 
     39 **Add account** stays greyed out. There is no message, and the two fields that
     40 *are* optional say so in their labels — which is exactly what makes "Note" read
     41 as optional too. Typing anything into it enables the button.
     42 
     43 ## Why
     44 
     45 The submit button requires the note, which the form calls an alias internally:
     46 
     47 ```kotlin
     48 // wallet/src/main/java/net/taler/wallet/accounts/AddAccountComposable.kt:245
     49 enabled = !formError && formAlias.isNotBlank(),
     50 ```
     51 
     52 ```kotlin
     53 // wallet/src/main/java/net/taler/wallet/accounts/AddAccountComposable.kt:229
     54 OutlinedTextField(
     55     value = formAlias,
     56     …
     57     label = { Text(stringResource(R.string.send_deposit_account_note)) },
     58     isError = formAlias.isBlank(),
     59 )
     60 ```
     61 
     62 and the label is the bare word:
     63 
     64 ```xml
     65 <!-- res/values/strings.xml:351 -->
     66 <string name="send_deposit_account_note">Note</string>
     67 ```
     68 
     69 while the genuinely optional fields are explicit:
     70 
     71 ```xml
     72 <!-- res/values/strings.xml:373,377 -->
     73 <string name="send_deposit_postal_code">Postal code (optional)</string>
     74 <string name="send_deposit_town">Town (optional)</string>
     75 ```
     76 
     77 The field does get an error outline (`isError = formAlias.isBlank()`), but it
     78 has that outline from the moment the form opens, before the user has done
     79 anything wrong, so it reads as decoration rather than as a complaint.
     80 
     81 It applies to every account type: `formAlias` is in the parent composable, so
     82 IBAN, x-taler-bank and Bitcoin accounts all need it.
     83 
     84 ## Reproduce by hand
     85 
     86 1. **Settings → Bank accounts → Add account**.
     87 2. Choose **IBAN**, type a holder name and `DE89370400440532013000`.
     88 3. **Add account** is disabled. Nothing explains it.
     89 4. Type one character into **Note** — the button enables.
     90 
     91 Expected: the label says the field is required (or the button explains what is
     92 missing), consistently with the "(optional)" labels beside it.
     93 
     94 ## Reproduce with the simulator
     95 
     96 ```bash
     97 ssh root@tripwire.taler.net
     98 cd /opt/taler-sim/driver
     99 SIM_WORKER=0 python3 -u suite.py bank_accounts deposit_methods
    100 ```
    101 
    102 Both scenarios now fill the note and check that the account appears in the
    103 list; before they did not, and both passed while adding nothing — which is the
    104 same vacuous-pass pattern as
    105 [`payto-link-only-accepts-iban.md`](payto-link-only-accepts-iban.md).
    106 
    107 ## Suggested fix
    108 
    109 Either label it `Note (required)` / `Account name`, or drop the requirement and
    110 fall back to something derived from the account (the IBAN, the Bitcoin address,
    111 the x-taler-bank account name) when the user leaves it blank — the label is
    112 stored as `KnownBankAccountInfo.label` and only used for display, so a
    113 sensible default costs nothing.
    114 
    115 Whichever way, a disabled button with no explanation is the part to remove: if
    116 the form cannot be submitted, it should say what is missing.