View Issue Details

IDProjectCategoryView StatusLast Update
0012002Talermerchant portal webuipublic2026-11-18 17:07
Reporterbot-cg [agent]  
CommunicatorCM_7  
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
Target Version1.6Fixed in Version1.6 
Summary0012002: Merchant portal: dialogs, PIN/code prompts and single-purpose forms open without keyboard focus on the obvious field
DescriptionNoticed first in merchant account creation: the email/SMS code (PIN) steps have one input, but focus stays on the submit button, so typing the code does nothing. An audit of the whole portal found the same problem across dialogs, prompts and create forms (children of this issue).

Three root causes in this package: (1) TanCodeInputGroup, shared by sign-up, sign-in 2FA and the 'Confirm it is you' MFA screen, never focuses its input; the old portal's fix for this (0011487, e157ed6e2) was lost when e38ceeaba replaced the legacy portal. (2) ui/Modal.tsx picks its initial focus with one querySelector over a selector list, which matches in document order, so the title's close button always wins and [autofocus] is never honoured. (3) Hand-built overlays and create pages have no focus logic at all.

Also part of the patch set, not a bug on master: tutorial chapters render live previews of real screens, so once screens focus a field on mount, opening a chapter would pull the reader's focus into a preview and scroll the page by thousands of pixels. LiveComponentPreview keeps preview content inert while it mounts (unless the reader's focus is already inside), which is committed before the screen changes.

Why this keeps happening: Preact does not implement autoFocus. It only sets the HTML autofocus attribute, which browsers honour once per document (initial load), so in these single-page apps a field rendered later, such as a dialog, a wizard step or a new route, stays unfocused unless code calls focus() on mount. Several components accept a `focus` prop that nothing passes or nothing acts on.

Each child issue describes one dialog/screen/component, with before/after screenshots and a patch. All fixes are on branch dev/bots/autofocus (durian); the commit ids are added as a note here. Rules followed: focus the only input of a PIN/code prompt; the first empty field of a create/edit form or step; the safe choice (Cancel) of a confirmation without input, never the destructive action; keep overview/list pages and review-and-pay steps unfocused; focus once on mount or step change, never on re-render.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

The plan

IDSummaryStatusLocked byEstimated effort (hours)
0012003Merchant portal: verification-code (PIN) steps and sign-in/sign-up/reset forms open without keyboard focus closed
0012004Merchant: every Modal dialog opens on its close button instead of its first field, and ignores [autofocus] closed
0012005Merchant: 'Pair a till' dialog does not focus Device Name, and its credential step drops focus (Escape stops working) closed
0012006Merchant: Bank monitoring dialog stays on its close button after its settings load closed
0012007Merchant: 'Point this portal at a different server' page does not focus the server address closed
0012008Merchant: first-run 'Set up this merchant server' form does not focus Business name closed
0012009Merchant: admin 'Reset merchant account password' page does not focus New password closed
0012010Merchant: admin 'Create merchant account' form does not focus Account ID closed
0012011Merchant: 'Create New Product' does not focus Product Name closed
0012012Merchant: 'Create Machine Access' does not focus 'Used for' closed
0012013Merchant: 'Add offline payment device' does not focus Name closed
0012014Merchant: 'Add a bank account' does not focus the IBAN closed
0012015Merchant: 'Create New Order' does not focus the amount closed
0012016Merchant: Grant Refund screen does not focus the refund amount closed
0012017Merchant: Schedule a Report form does not focus its Description field closed
0012018Merchant: Add/Edit Product Group and Money Pot dialogs focus the close button instead of the identifier closed
0012019Merchant: Delete Order confirmation leaves focus behind the overlay (and Escape does nothing) closed
0012020Merchant: Remove bank account confirmation does not take focus (and Escape does nothing) closed
0012021Merchant: Templates list 'Delete template' and 'Show QR' dialogs leave focus on the row menu behind them closed
0012022Merchant PoS: ad-hoc item and quick-refund dialogs, and the paid screen, do not focus what they ask for closed
0012023Merchant: 'You have been signed out' page does not focus 'Sign In Again' closed
This issue (hours)
Its children (hours)0
Together (hours)0
Nothing is missing: the plan can be finished.

Relationships

parent of 0012003 closed Merchant portal: verification-code (PIN) steps and sign-in/sign-up/reset forms open without keyboard focus 
parent of 0012004 closed Merchant: every Modal dialog opens on its close button instead of its first field, and ignores [autofocus] 
parent of 0012005 closed Merchant: 'Pair a till' dialog does not focus Device Name, and its credential step drops focus (Escape stops working) 
parent of 0012006 closed Merchant: Bank monitoring dialog stays on its close button after its settings load 
parent of 0012007 closed Merchant: 'Point this portal at a different server' page does not focus the server address 
parent of 0012008 closed Merchant: first-run 'Set up this merchant server' form does not focus Business name 
parent of 0012009 closed Merchant: admin 'Reset merchant account password' page does not focus New password 
parent of 0012010 closed Merchant: admin 'Create merchant account' form does not focus Account ID 
parent of 0012011 closed Merchant: 'Create New Product' does not focus Product Name 
parent of 0012012 closed Merchant: 'Create Machine Access' does not focus 'Used for' 
parent of 0012013 closed Merchant: 'Add offline payment device' does not focus Name 
parent of 0012014 closed Merchant: 'Add a bank account' does not focus the IBAN 
parent of 0012015 closed Merchant: 'Create New Order' does not focus the amount 
parent of 0012016 closed Merchant: Grant Refund screen does not focus the refund amount 
parent of 0012017 closed Merchant: Schedule a Report form does not focus its Description field 
parent of 0012018 closed Merchant: Add/Edit Product Group and Money Pot dialogs focus the close button instead of the identifier 
parent of 0012019 closed Merchant: Delete Order confirmation leaves focus behind the overlay (and Escape does nothing) 
parent of 0012020 closed Merchant: Remove bank account confirmation does not take focus (and Escape does nothing) 
parent of 0012021 closed Merchant: Templates list 'Delete template' and 'Show QR' dialogs leave focus on the row menu behind them 
parent of 0012022 closed Merchant PoS: ad-hoc item and quick-refund dialogs, and the paid screen, do not focus what they ask for 
parent of 0012023 closed Merchant: 'You have been signed out' page does not focus 'Sign In Again' 

Activities

bot-cg [agent]

2026-11-10 23:55

updater   ~0030389

Fixes for this issue and all its children are on branch dev/bots/autofocus (durian), rebased on master bf2e571a2:

  e4cfe1bd2 web-util: honour the focus flag in forms and dialogs
  c0c3962de merchant web UI: keep tutorial previews from taking focus
  4693f4f1d merchant web UI: focus the code field in verification steps
  8a4eb4219 merchant web UI: start dialogs and create forms on their first field
  b48f5dd89 bank web UI: focus the field each page and dialog asks for
  216b033fe wallet web UI: focus the amount or field each form asks for first
  908d48a85 anastasis web UI: focus the first field of three setup steps
  dbbabcf82 exchange AML web UI: focus the password, search and decision fields
  21293f654 exchange KYC web UI: focus the first fillable field of a requirement form
  eaec0bcf6 challenger web UI: focus the address form and stop re-focusing the PIN
  150044e2b auditor web UI: move focus into the suppress dialog and the menu drawer

Merchant commits: c0c3962de (tutorial preview guard; must precede the screen changes), 4693f4f1d (0012003, code steps), 8a4eb4219 (the remaining children).

Tests: merchant web UI unit suite 719/720; the one failure, "the storybook does not mount the portal shell", fails identically on unmodified master. tsc clean. Every child's before/after was measured in headless Chromium (screenshots attached to each child).

bot-codex-florian-dold

2026-11-13 09:14

manager   ~0030511

commit 10db8ad6d183a3adc89525e6a261606adf63c8f9
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    merchant web UI: restore page focus on browser history navigation
    
    Focus the destination heading or task field on navigation. Save stable
    control keys in history entries and use restoreTarget on Back/Forward.
    Query-only changes leave focus where it is.
    
    Assisted-by: LLM

commit 8447cc2a3d1725364327ef9331628f7c59dd3968
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    merchant web UI: send wizard focus changes through requestFocus
    
    Keep the existing step, validation and review-edit targets. Request
    focus after revealing the requested control.
    
    Assisted-by: LLM

commit bdcd9f94c2c1e3c0c8649255029c53c3b9a011de
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    merchant web UI: focus PoS item, refund and next-sale controls
    
    Focus the item description on entry, the refund amount after loading,
    and Start New Sale after payment. Leave focus on Cancel if no refund
    amount can be entered.
    
    Issue: https://bugs.taler.net/n/12022
    Assisted-by: LLM

commit 073d2e7f48bb3ba51738e900ae533a2e0dc80876
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    merchant web UI: use shared focus handling for custom dialogs
    
    Move pairing, account removal, order deletion and template overlays to
    Modal. Keep their content and dismissal behavior, and mark the intended
    field in report-group dialogs.
    
    Issue: https://bugs.taler.net/n/12005
    Issue: https://bugs.taler.net/n/12018
    Issue: https://bugs.taler.net/n/12019
    Issue: https://bugs.taler.net/n/12020
    Issue: https://bugs.taler.net/n/12021
    Assisted-by: LLM

commit e9ea0e569eda3ba61fd39a1617c7a970967326cd
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    merchant web UI: focus creation and refund forms
    
    Choose the first field for products, devices, access, bank accounts,
    orders and reports. Wait for refund and bank-monitoring data before
    focusing their controls; select the suggested order amount.
    
    Issue: https://bugs.taler.net/n/12006
    Issue: https://bugs.taler.net/n/12011
    Issue: https://bugs.taler.net/n/12012
    Issue: https://bugs.taler.net/n/12013
    Issue: https://bugs.taler.net/n/12014
    Issue: https://bugs.taler.net/n/12015
    Issue: https://bugs.taler.net/n/12016
    Issue: https://bugs.taler.net/n/12017
    Assisted-by: LLM

commit 460b2808ea3a4cd62a07cd9e9cb4ddced399872c
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    merchant web UI: focus merchant account and server setup forms
    
    Start account creation, password reset and server setup on the first
    field the user needs to fill.
    
    Issue: https://bugs.taler.net/n/12007
    Issue: https://bugs.taler.net/n/12008
    Issue: https://bugs.taler.net/n/12009
    Issue: https://bugs.taler.net/n/12010
    Assisted-by: LLM

commit 4bf1b24fba1731d01ba25153beef6d53e0bbd103
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    merchant web UI: focus authentication fields and code steps
    
    Focus the field each authentication step asks for. Use the challenge ID
    to focus a new code prompt without remounting it or reacting to
    countdowns.
    
    Issue: https://bugs.taler.net/n/12003
    Issue: https://bugs.taler.net/n/12023
    Assisted-by: LLM

commit c58cf2ae54417fe5d5cab9075ff3d88e52f3796b
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    merchant web UI: share dialog and menu focus handling
    
    Let Modal choose its initial target and use DialogFocusScope for Tab,
    Escape and restoration. Keep confirmations on their safe action and pass
    the row menu trigger through menu-to-dialog handoffs.
    
    Issue: https://bugs.taler.net/n/12004
    Assisted-by: LLM

commit d8eedea1529d070bd176c70e365ac963615a5d56
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:16 2026 +0100

    web UIs: keep previews from taking keyboard focus
    
    FocusPolicy blocks automatic focus until the reader interacts with a
    preview. The policy follows components through portals.
    
    Issue: https://bugs.taler.net/n/12002
    Issue: https://bugs.taler.net/n/12024
    Assisted-by: LLM

commit 0db14837db18a79a4bee3ca81c0137bc20c01f92
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:14 2026 +0100

    web-util: restore dialog openers and coordinate nested dialogs
    
    DialogFocusScope adds Escape handling and opener restoration to a focus
    scope. Hooks provide the same behavior for existing wrappers. Menus
    restore focus without trapping it; native dialogs retain browser Tab
    handling.
    
    After an initial request succeeds, discard the other eligible requests,
    including ones tried earlier while their controls were unavailable. Keep
    requests blocked by a modal and requests waiting after fallback focus.
    
    Issue: https://bugs.taler.net/n/12002
    Issue: https://bugs.taler.net/n/12024
    Issue: https://bugs.taler.net/n/12034
    Assisted-by: LLM

commit c1ee0c1022645200e605a3f36ab4910a3750c180
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:11 2026 +0100

    web-util: focus pages and form steps when their controls are ready
    
    FocusScope queues one initial focus request when a page, form or step
    opens. It waits for loading and cancels the request if the user moves
    focus. useFocusTarget retries pending focus when a control mounts.
    
    Explicit requestFocus calls run immediately and return success or
    failure.
    
    Issue: https://bugs.taler.net/n/12002
    Issue: https://bugs.taler.net/n/12024
    Assisted-by: LLM

commit fdb0b892c5ea5e4869edcc8b83fb43a707be2126
Author: Florian Dold <dold@taler.net>
Date: Fri Nov 13 01:06:08 2026 +0100

    web-util: add helpers for initial focus and modal keyboard handling
    
    Find controls that can receive focus, skipping hidden, disabled and
    inert elements. Choose a dialog's initial focus from an explicit target,
    an editable field, or its first control.
    
    Handle Escape on the active dialog. For custom modals, keep Tab inside
    and make the rest of the page inert so it cannot receive clicks or
    focus. Restore the previous inert state on close. Let the browser handle
    Tab in native dialogs, and allow focus to leave menus.
    
    Issue: https://bugs.taler.net/n/12002
    Issue: https://bugs.taler.net/n/12024
    Assisted-by: LLM

Issue History

Date ModifiedUsernameFieldChange
2026-11-10 23:41bot-cgNew Issue
2026-11-10 23:41bot-cgRelationship addedparent of 0012003
2026-11-10 23:41bot-cgRelationship addedparent of 0012019
2026-11-10 23:41bot-cgRelationship addedparent of 0012018
2026-11-10 23:41bot-cgRelationship addedparent of 0012017
2026-11-10 23:41bot-cgRelationship addedparent of 0012016
2026-11-10 23:41bot-cgRelationship addedparent of 0012015
2026-11-10 23:41bot-cgRelationship addedparent of 0012014
2026-11-10 23:41bot-cgRelationship addedparent of 0012013
2026-11-10 23:41bot-cgRelationship addedparent of 0012012
2026-11-10 23:41bot-cgRelationship addedparent of 0012011
2026-11-10 23:41bot-cgRelationship addedparent of 0012010
2026-11-10 23:41bot-cgRelationship addedparent of 0012009
2026-11-10 23:41bot-cgRelationship addedparent of 0012008
2026-11-10 23:41bot-cgRelationship addedparent of 0012007
2026-11-10 23:41bot-cgRelationship addedparent of 0012006
2026-11-10 23:41bot-cgRelationship addedparent of 0012005
2026-11-10 23:41bot-cgRelationship addedparent of 0012004
2026-11-10 23:41bot-cgRelationship addedparent of 0012023
2026-11-10 23:41bot-cgRelationship addedparent of 0012022
2026-11-10 23:41bot-cgRelationship addedparent of 0012021
2026-11-10 23:41bot-cgRelationship addedparent of 0012020
2026-11-10 23:55bot-cgNote Added: 0030389
2026-11-11 16:26Christian GrothoffSeverityminor => trivial
2026-11-13 09:14bot-codex-florian-doldNote Added: 0030511
2026-11-13 09:14bot-codex-florian-doldStatusnew => closed
2026-11-13 09:14bot-codex-florian-doldResolutionopen => fixed
2026-11-18 17:02Christian GrothoffTarget Version => 1.6
2026-11-18 17:07Christian GrothoffFixed in Version => 1.6