From 0d50a92b0edbf1542e99e3cd5397bce65848bff3 Mon Sep 17 00:00:00 2001 From: le king fu Date: Sat, 2 May 2026 15:55:57 -0400 Subject: [PATCH] fix(ui): close native date picker after selection on WebKitGTK (#177) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WebKitGTK (Linux Tauri WebView) does not auto-dismiss the native popup after a value commit — the user has to press Esc. Force-blur on change is a no-op on Edge Chromium WebView2 (Windows) and WKWebView (macOS), where the popup already closes. Scope narrowed to /balance/snapshot per issue body. Six other date inputs across the app share the same WebKitGTK bug; tracked in a follow-up issue rather than bundled here. Diagnostic: Ubuntu 24.04 + libwebkit2gtk-4.1-0 2.50.4-0ubuntu0.24.04.1. Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.fr.md | 1 + CHANGELOG.md | 1 + src/pages/SnapshotEditPage.tsx | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.fr.md b/CHANGELOG.fr.md index a752c7d..bbc5094 100644 --- a/CHANGELOG.fr.md +++ b/CHANGELOG.fr.md @@ -15,6 +15,7 @@ - Bilan : correction de l'erreur SQLite « misuse of aggregate function MIN() » au chargement de /balance avec des snapshots existants ; remplacement du pattern aggregate-in-WHERE par une window function ROW_NUMBER() dans getAccountsPeriodAnchor (#175). - Bilan : la sauvegarde d'un snapshot utilise désormais une transaction atomique BEGIN/COMMIT et valide toutes les lignes avant toute écriture en BDD, empêchant les snapshots orphelins lorsque la validation échoue. La migration v11 nettoie les orphelins existants (#176). +- Bilan : le sélecteur de date sur `/balance/snapshot` se ferme maintenant après la sélection sur Linux (WebKitGTK) au lieu de rester ouvert jusqu'à ce que l'utilisateur appuie sur Échap. Le contournement appelle `blur()` sur le champ après chaque changement — sans effet sur Windows WebView2 / macOS WKWebView, où le sélecteur se ferme déjà automatiquement (#177). ## [0.9.0] - 2026-04-29 diff --git a/CHANGELOG.md b/CHANGELOG.md index a402f42..15184ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Bilan: fix SQLite "misuse of aggregate function MIN()" error when loading /balance with existing snapshots; replaced aggregate-in-WHERE pattern with ROW_NUMBER() window function in getAccountsPeriodAnchor (#175). - Bilan: snapshot save now uses atomic BEGIN/COMMIT and validates all lines before any DB write, preventing orphan snapshot rows when validation fails. Migration v11 cleans existing orphans (#176). +- Bilan: snapshot date picker on `/balance/snapshot` now closes after a date is selected on Linux (WebKitGTK), instead of staying open until the user pressed Esc. Workaround calls `blur()` on the input after each change — no-op on Windows WebView2 / macOS WKWebView, where the picker already auto-closes (#177). ## [0.9.0] - 2026-04-29 diff --git a/src/pages/SnapshotEditPage.tsx b/src/pages/SnapshotEditPage.tsx index 5d7583b..a1682e2 100644 --- a/src/pages/SnapshotEditPage.tsx +++ b/src/pages/SnapshotEditPage.tsx @@ -155,6 +155,10 @@ export default function SnapshotEditPage() { } else { setSearchParams({}, { replace: true }); } + // WebKitGTK (Linux Tauri WebView) does not always dismiss the + // native date popup after a value commit — user has to hit + // Esc. Force-blur is a no-op on WebView2/WKWebView. See #177. + e.currentTarget.blur(); }} className="w-full px-3 py-2 rounded-lg border border-[var(--border)] bg-[var(--card)] text-sm focus:outline-none focus:ring-1 focus:ring-[var(--primary)] disabled:opacity-60" /> -- 2.45.2