v0.2.6-pre.003-fix.001

This commit is contained in:
2026-08-20 21:23:09 +02:00
parent f9f9ac79b6
commit 0e72914237
18 changed files with 409 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-wallet-desk/frontend/ts/main.ts
// version: 2
// version: 3
import "bootstrap";
import DataTable from "datatables.net-bs5";
@@ -55,6 +55,33 @@ function activateView(viewId: ViewId, source: "startup" | "user"): void {
frontendTrace("main", "Wallet Desk view DOM updated", { viewId, source });
}
function bindFrontendInteractions(): void {
document.addEventListener(
"click",
event => {
const source = event.target;
if (!(source instanceof Element)) {
return;
}
const control = source.closest<HTMLElement>('button, a, input, select, textarea, [role="button"], [role="tab"], [data-view], [data-shell-action]');
if (!control) {
return;
}
frontendTrace("main", "Frontend control clicked", {
controlId: control.id || null,
controlType: control instanceof HTMLButtonElement ? control.type : null,
disabled: control instanceof HTMLButtonElement ? control.disabled : control.getAttribute("aria-disabled") === "true",
role: control.getAttribute("role"),
shellAction: control.dataset.shellAction ?? null,
tagName: control.tagName.toLowerCase(),
viewId: control.dataset.view ?? null,
});
},
true,
);
frontendTrace("main", "Frontend control interaction logger installed");
}
function bindNavigation(): void {
document.querySelectorAll<HTMLButtonElement>("[data-view]").forEach(button => {
button.addEventListener("click", () => {
@@ -159,6 +186,7 @@ function bindShellActions(): void {
async function initializeMain(): Promise<void> {
const windowLabel = getCurrentWindow().label;
frontendInfo("main", "Wallet Desk main frontend loaded", { windowLabel });
bindFrontendInteractions();
bindNavigation();
bindShellActions();
initializeWalletTable();