fix(autofill): send the window back to the tray when the picker is dismissed

Cancelling left the window on the desktop, though it had only been restored to
ask which entry to fill. Quick-search already hides itself on Esc; this makes
the picker symmetric. Applies to all three hotkeys — the capture and the hide
both sit on the shared BridgeAutofillRequest / autofill/cancel paths, so full,
password-only and TOTP behave identically.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-27 21:11:43 +01:00
parent 3c84bdca49
commit a9e56c52b5
2 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -313,7 +313,7 @@ l'éditeur slideover : créer + éditer une entrée, ajouter/retirer des tags,
### H9 · retour au tray après un pick dans le picker ✅
- **ACTION** : app **au tray** → `Ctrl+Shift+L` depuis une autre app sur un titre à plusieurs candidats → le picker sort la fenêtre du tray → choisir une entrée.
- **ATTENDU** : le remplissage se fait puis l'app **repart au tray**, comme elle est venue.
- **Variantes** : match unique (pas de picker) → reste au tray ; app déjà visible → reste visible ; app **minimisée dans la barre des tâches** → n'est **pas** envoyée au tray (`not Self.Visible` est faux pour une fenêtre iconique) ; picker fermé sans choisir → l'app reste où elle est et le hotkey suivant n'hérite pas de l'état capturé.
- **Variantes** : match unique (pas de picker) → reste au tray ; app déjà visible → reste visible ; app **minimisée dans la barre des tâches** → n'est **pas** envoyée au tray (`not Self.Visible` est faux pour une fenêtre iconique) ; picker fermé par Esc sans choisir → l'app **repart au tray** elle aussi (symétrique de quick-search, qui se cache sur Esc) et le hotkey suivant n'hérite pas de l'état capturé.
- **Historique** : seul le chemin quick-search capturait « était cachée » (`LWasHidden`) et le faisait remonter via `hide_after` ; JS n'envoie jamais ce paramètre depuis le picker d'autofill, donc l'app restait sur le bureau. Capturé désormais côté Delphi dans `BridgeAutofillRequest`, au moment du hotkey — après, le picker a déjà détruit l'information.
### H7 · combo déjà pris par une autre application ✅
+7 -2
View File
@@ -1087,9 +1087,14 @@ begin
if FAutofillTargetHWND <> 0 then
SetForegroundWindow(FAutofillTargetHWND);
FAutofillTargetHWND := 0;
// Cancelled: the window stays wherever the user left it, and the captured
// state must not leak into the next hotkey.
// The window only came out of the tray to show the picker, so dismissing it
// puts it back — same as quick-search, which hides on Esc too. Done after
// handing focus to the target above.
if FAutofillHotkeyWasHidden then
begin
FAutofillHotkeyWasHidden := False;
FBridge.MinimizeToTray;
end;
LogLine('Autofill cancelled (no match or dismissed)');
end