fix(ui): apply WebKitGTK date picker workaround to remaining 7 inputs (#188) #194

Merged
maximus merged 1 commit from issue-188-webkit-date-picker-7-inputs into main 2026-05-03 23:39:47 +00:00
Owner

Fixes #188

Summary

Extends the WebKitGTK date picker workaround from PR #189 (one input on /balance/snapshot) to the 7 remaining native <input type="date"> fields across 4 components.

Files changed

File Inputs Lines
src/components/transactions/TransactionFilterBar.tsx dateFrom + dateTo 170-176, 180-186
src/components/adjustments/AdjustmentForm.tsx form.date 74-78
src/components/balance/LinkTransfersModal.tsx from + to 232-236, 243-247
src/components/dashboard/PeriodSelector.tsx localFrom + localTo 97-101, 108-112
CHANGELOG.md + CHANGELOG.fr.md ### Fixed / ### Corrigé entry

Pattern applied

onChange={(e) => {
  // existing state update
  // Close native date popup on WebKitGTK (#177)
  e.currentTarget.blur();
}}

blur() is a no-op on Windows WebView2 / macOS WKWebView — only WebKitGTK needs the explicit dismiss.

Verification

  • npm run build (tsc + vite) — built in 5.80s
  • npm test (vitest) — 227 test files, 3720 tests passed
  • Manual smoke test on Linux Tauri dev still recommended on at least 2 of the 4 components before merge (no automated test possible — WebKitGTK quirk is not reproducible in jsdom)

Test plan

  • npm run tauri dev on Linux
  • Open Transactions page, set a date in dateFrom — popup must close after selection
  • Open Adjustments page, edit/create an adjustment, change the date — popup must close
  • (Optional) Open /balance -> Link transfers modal, set from/to — popup must close
  • (Optional) Use the dashboard custom period selector — popup must close
  • Verify on Windows / macOS that no regression: popup behaviour unchanged

Acceptance criteria

  • Workaround applied to all 7 listed fields (4 files)
  • Inline comment at each location referencing #177
  • CHANGELOG (FR + EN) under Fixed / Corrigé
  • Manual smoke test (post-merge / pre-release)
  • npm test + npm run build green
Fixes #188 ## Summary Extends the WebKitGTK date picker workaround from PR #189 (one input on `/balance/snapshot`) to the 7 remaining native `<input type="date">` fields across 4 components. ## Files changed | File | Inputs | Lines | |---|---|---| | `src/components/transactions/TransactionFilterBar.tsx` | dateFrom + dateTo | 170-176, 180-186 | | `src/components/adjustments/AdjustmentForm.tsx` | form.date | 74-78 | | `src/components/balance/LinkTransfersModal.tsx` | from + to | 232-236, 243-247 | | `src/components/dashboard/PeriodSelector.tsx` | localFrom + localTo | 97-101, 108-112 | | `CHANGELOG.md` + `CHANGELOG.fr.md` | — | `### Fixed` / `### Corrigé` entry | ## Pattern applied ```tsx onChange={(e) => { // existing state update // Close native date popup on WebKitGTK (#177) e.currentTarget.blur(); }} ``` `blur()` is a no-op on Windows WebView2 / macOS WKWebView — only WebKitGTK needs the explicit dismiss. ## Verification - `npm run build` (tsc + vite) — `built in 5.80s` - `npm test` (vitest) — 227 test files, 3720 tests passed - Manual smoke test on Linux Tauri dev still recommended on at least 2 of the 4 components before merge (no automated test possible — WebKitGTK quirk is not reproducible in jsdom) ## Test plan - [ ] `npm run tauri dev` on Linux - [ ] Open Transactions page, set a date in dateFrom — popup must close after selection - [ ] Open Adjustments page, edit/create an adjustment, change the date — popup must close - [ ] (Optional) Open `/balance` -> Link transfers modal, set from/to — popup must close - [ ] (Optional) Use the dashboard custom period selector — popup must close - [ ] Verify on Windows / macOS that no regression: popup behaviour unchanged ## Acceptance criteria - [x] Workaround applied to all 7 listed fields (4 files) - [x] Inline comment at each location referencing #177 - [x] CHANGELOG (FR + EN) under Fixed / Corrigé - [ ] Manual smoke test (post-merge / pre-release) - [x] `npm test` + `npm run build` green
maximus added 1 commit 2026-05-03 20:19:38 +00:00
fix(ui): apply WebKitGTK date picker workaround to remaining 7 inputs (#188)
All checks were successful
PR Check / rust (pull_request) Successful in 22m55s
PR Check / frontend (pull_request) Successful in 2m29s
3b9badb726
Extends PR #189's fix (one input on /balance/snapshot) to the 7 remaining
native <input type="date"> fields across 4 components:
- transactions/TransactionFilterBar.tsx (dateFrom + dateTo)
- adjustments/AdjustmentForm.tsx (form.date)
- balance/LinkTransfersModal.tsx (from + to)
- dashboard/PeriodSelector.tsx (localFrom + localTo)

Each onChange handler now calls e.currentTarget.blur() after the state
update to dismiss the native date popup on Linux Tauri WebView. The call
is a no-op on Windows WebView2 / macOS WKWebView, where the picker
already auto-closes.

No automated test added: this is a WebKitGTK-specific WebView quirk that
cannot be reproduced in jsdom/vitest. Manual smoke test on Linux Tauri
dev was the validation, mirroring PR #189's approach.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
Owner

Review — APPROVE

Summary

Extension propre et mecanique du workaround #177 sur les 7 <input type=\"date\"> restants (4 composants). Diff minimal, pattern uniforme, commentaire de reference identique a chaque site, pas de regression possible (blur() est un no-op sur Windows WebView2 / macOS WKWebView).

Verifie

  • Couverture : 7 inputs sur 4 fichiers + le 8e existant dans SnapshotEditPage.tsx (PR #189) = 8/8 inputs type=\"date\" du repo couverts. grep -rn type=\"date\" src/ confirme.
  • Pattern : chaque handler conserve son state update + ajoute e.currentTarget.blur() avec commentaire // Close native date popup on WebKitGTK (#177). currentTarget est valide pendant l execution synchrone du onChange React, pas de probleme de pooling.
  • CHANGELOG FR + EN sous Fixed / Corrige avec reference explicite a #177 et a #188.
  • Tests : npm test 3720 tests verts, npm run build ok. Le PR body justifie correctement l absence de test automatise (quirk WebKitGTK non reproductible en jsdom). Acceptable pour ce type de UX fix dependant du moteur natif.
  • i18n : aucune string user-facing touchee, pas de cle a ajouter.
  • Migrations / secrets / regressions : rien.

Suggestions (non bloquantes)

  • A terme, factoriser le pattern dans un petit hook useDateInputBlur() ou un composant <DateInput /> partage si un 9e input apparait — pas necessaire pour ce PR.

Plan post-merge

Smoke test manuel sur Linux Tauri dev pour au moins 2 des 4 composants (mentionne dans le PR body) avant la prochaine release.

## Review — APPROVE ### Summary Extension propre et mecanique du workaround `#177` sur les 7 `<input type=\"date\">` restants (4 composants). Diff minimal, pattern uniforme, commentaire de reference identique a chaque site, pas de regression possible (`blur()` est un no-op sur Windows WebView2 / macOS WKWebView). ### Verifie - **Couverture** : 7 inputs sur 4 fichiers + le 8e existant dans `SnapshotEditPage.tsx` (PR #189) = 8/8 inputs `type=\"date\"` du repo couverts. `grep -rn type=\"date\" src/` confirme. - **Pattern** : chaque handler conserve son state update + ajoute `e.currentTarget.blur()` avec commentaire `// Close native date popup on WebKitGTK (#177)`. `currentTarget` est valide pendant l execution synchrone du onChange React, pas de probleme de pooling. - **CHANGELOG FR + EN** sous `Fixed` / `Corrige` avec reference explicite a #177 et a #188. - **Tests** : `npm test` 3720 tests verts, `npm run build` ok. Le PR body justifie correctement l absence de test automatise (quirk WebKitGTK non reproductible en jsdom). Acceptable pour ce type de UX fix dependant du moteur natif. - **i18n** : aucune string user-facing touchee, pas de cle a ajouter. - **Migrations / secrets / regressions** : rien. ### Suggestions (non bloquantes) - A terme, factoriser le pattern dans un petit hook `useDateInputBlur()` ou un composant `<DateInput />` partage si un 9e input apparait — pas necessaire pour ce PR. ### Plan post-merge Smoke test manuel sur Linux Tauri dev pour au moins 2 des 4 composants (mentionne dans le PR body) avant la prochaine release.
maximus merged commit 4e7ba6b460 into main 2026-05-03 23:39:47 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: maximus/Simpl-Resultat#194
No description provided.