commit 66a3f3f16c0dde2feda831e29101ee60ba8ad656 parent 77059d755ede815e5d14a5f0c77d8e487023b864 Author: Florian Dold <dold@taler.net> Date: Fri, 13 Nov 2026 01:06:16 +0100 exchange web UIs: focus AML and KYC form fields Enable form focus for session unlock, account search, decision fields and KYC requirements. Focus new measure forms without changing edit mode. Issue: https://bugs.taler.net/n/12024 Assisted-by: LLM Diffstat:
6 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/packages/taler-exchange-aml-webui/src/components/NewMeasure.tsx b/packages/taler-exchange-aml-webui/src/components/NewMeasure.tsx @@ -272,7 +272,14 @@ function NormalMeasureForm({ </i18n.Translate> </p> </div> - <FormUI design={design} model={form.model} onSubmit={submitMeasure} /> + {/* Only a new measure needs a name typed first; when editing, the + name is locked and the next field is a list that pops open. */} + <FormUI + design={design} + model={form.model} + focus={addingNew} + onSubmit={submitMeasure} + /> <div class="flex flex-wrap gap-3 border-t border-gray-200 pt-5 dark:border-gray-700"> <button type="button" onClick={onCancel} class={secondaryButtonClass}> <i18n.Translate>Cancel</i18n.Translate> @@ -461,7 +468,14 @@ function VerificationMeasureForm({ return ( <div class="space-y-6"> - <FormUI design={design} model={form.model} onSubmit={submitMeasure} /> + {/* Only a new measure needs a name typed first; when editing, the + name is locked and the next field is a list that pops open. */} + <FormUI + design={design} + model={form.model} + focus={addingNew} + onSubmit={submitMeasure} + /> <div class="flex flex-wrap gap-3 border-t border-gray-200 pt-5 dark:border-gray-700"> <button type="button" onClick={onCancel} class={secondaryButtonClass}> <i18n.Translate>Cancel</i18n.Translate> diff --git a/packages/taler-exchange-aml-webui/src/components/UnlockSession.tsx b/packages/taler-exchange-aml-webui/src/components/UnlockSession.tsx @@ -143,6 +143,7 @@ export function UnlockSession({ officer }: { officer: OfficerLocked }): VNode { name="password" type="password" required + focus handler={handler.getUiFieldForAttribute("password")} /> </div> diff --git a/packages/taler-exchange-aml-webui/src/pages/Search.tsx b/packages/taler-exchange-aml-webui/src/pages/Search.tsx @@ -388,6 +388,7 @@ function XTalerBankForm({ <FormUI design={design} model={form.model} + focus onSubmit={() => { if (paytoUri) onSearch(paytoUri); }} @@ -430,6 +431,7 @@ function IbanForm({ <FormUI design={design} model={form.model} + focus onSubmit={() => { if (paytoUri) onSearch(paytoUri); }} @@ -473,6 +475,8 @@ export function WalletForm({ : undefined; return ( <div class="space-y-6"> + {/* No initial focus: the first field is the prefilled exchange + address, where typing would append to the default. */} <FormUI design={design} model={form.model} @@ -517,6 +521,7 @@ function GenericForm({ <FormUI design={design} model={form.model} + focus onSubmit={() => { if (paytoUri) onSearch(paytoUri); }} diff --git a/packages/taler-exchange-aml-webui/src/pages/decision/Justification.tsx b/packages/taler-exchange-aml-webui/src/pages/decision/Justification.tsx @@ -55,7 +55,7 @@ export function Justification(): VNode { return ( <div> - <FormUI design={design} model={form.model} /> + <FormUI design={design} model={form.model} focus /> <InvestigationStatusChoice current={currentInvestigationStatus} selected={investigationStatus} diff --git a/packages/taler-exchange-aml-webui/src/pages/decision/Rules.tsx b/packages/taler-exchange-aml-webui/src/pages/decision/Rules.tsx @@ -193,7 +193,7 @@ function RuleEditor({ <i18n.Translate>Add proposed rule</i18n.Translate> )} </h3> - <FormUI design={ruleFormDesign} model={ruleForm.model} /> + <FormUI design={ruleFormDesign} model={ruleForm.model} focus /> <div class="mt-4 flex justify-end gap-3"> <button type="button" diff --git a/packages/taler-exchange-kyc-webui/src/pages/FillForm.tsx b/packages/taler-exchange-kyc-webui/src/pages/FillForm.tsx @@ -161,7 +161,7 @@ function ShowForm({ return ( <div class="rounded-lg bg-white px-5 py-6 shadow m-4"> <div class="space-y-10 divide-y -mt-5 divide-gray-900/10"> - <FormUI model={handler} design={design} /> + <FormUI model={handler} design={design} focus /> </div> {preferences.showDebugInfo ? (