taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 21bf079c52dc8857c9f5eee83e716657490560b9
parent 9e12df9f907752b61d14d425b3136b0c577bb95c
Author: Sebastian <sebasjm@taler-systems.com>
Date:   Wed, 11 Feb 2026 16:52:36 -0300

fix #11049

Diffstat:
Mpackages/bank-ui/src/pages/BankFrame.tsx | 34+++++++++++++++++++++++++++++++++-
Mpackages/web-util/src/components/NotificationBanner.tsx | 19+++----------------
2 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/packages/bank-ui/src/pages/BankFrame.tsx b/packages/bank-ui/src/pages/BankFrame.tsx @@ -68,7 +68,7 @@ export function BankFrame({ const { i18n } = useTranslationContext(); const session = useSessionState(); const settings = useSettingsContext(); - const [{ showDebugInfo }] = useCommonPreferences(); + const [{ showDebugInfo }, update] = useCommonPreferences(); const [preferences, updatePreferences] = usePreferences(); const [, , resetBankState] = useBankState(); const d = useBankCoreApiContext(); @@ -168,7 +168,39 @@ export function BankFrame({ </div> </li> ); + })} + <li class="pl-2"> + <div class="flex items-center justify-between"> + <span class="flex flex-grow flex-col"> + <span + class="text-sm text-black font-medium leading-6 " + id="availability-label" + > + <i18n.Translate>Show debug information</i18n.Translate> + </span> + </span> + <button + type="button" + name={`debug switch`} + data-enabled={showDebugInfo} + class="bg-indigo-600 data-[enabled=false]:bg-gray-200 relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2" + role="switch" + aria-checked="false" + aria-labelledby="availability-label" + aria-describedby="availability-description" + onClick={() => { + update("showDebugInfo", !showDebugInfo) + }} + > + <span + aria-hidden="true" + data-enabled={showDebugInfo} + class="translate-x-5 data-[enabled=false]:translate-x-0 pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out" + ></span> + </button> + </div> + </li> </ul> </li> </Header> diff --git a/packages/web-util/src/components/NotificationBanner.tsx b/packages/web-util/src/components/NotificationBanner.tsx @@ -1,12 +1,11 @@ import { Fragment, h, VNode } from "preact"; +import { useState } from "preact/compat"; import { - DebugInfo, Notification, useCommonPreferences, useTranslationContext, } from "../index.browser.js"; import { Attention } from "./Attention.js"; -import { useState, useTransition } from "preact/compat"; export function LocalNotificationBanner({ notification, @@ -14,7 +13,7 @@ export function LocalNotificationBanner({ notification?: Notification; }): VNode { const { i18n } = useTranslationContext(); - const [{ showDebugInfo }, update] = useCommonPreferences(); + const [{ showDebugInfo }] = useCommonPreferences(); const [moreInfo, setMoreInfo] = useState(false); if (!notification) return <Fragment />; switch (notification.message.type) { @@ -42,24 +41,12 @@ export function LocalNotificationBanner({ <div class="flex justify-between"> <div class="text-[grey]"> - {moreInfo ? undefined : ( + {moreInfo || (desc && desc.length < 2) ? undefined : ( <button onClick={() => setMoreInfo(true)} class="text-grey"> <i18n.Translate>Show more info</i18n.Translate> </button> )} </div> - - <div class="text-[grey]"> - <button - onClick={() => update("showDebugInfo", !showDebugInfo)} - > - {!showDebugInfo ? ( - <i18n.Translate>Show debug info</i18n.Translate> - ) : ( - <i18n.Translate>Hide debug info</i18n.Translate> - )} - </button> - </div> </div> {showDebugInfo && ( <pre class="whitespace-break-spaces text-black">