fix(hotkeys): a locked vault must not hand the foreground back
Both locked-vault paths cancelled the autofill with the default refocus, which returns the foreground to the captured target - right after Delphi had raised our window. Ctrl+Shift+Q flashed for a frame then Notepad took over; Ctrl+Shift+L moved the window twice because focusApp had to take it back.
This commit is contained in:
+3
-2
@@ -459,8 +459,9 @@ l'éditeur slideover : créer + éditer une entrée, ajouter/retirer des tags,
|
||||
- **ATTENDU** : accepté et actif immédiatement ; **refusé** s'il duplique un des 4 autres hotkeys ; *Reset to defaults* le remet à `Ctrl+Shift+T` ; le réglage survit à un redémarrage (synced via `settings_json`).
|
||||
|
||||
### H5 · coffre verrouillé ✅
|
||||
- **ACTION** : verrouiller → `Ctrl+Shift+T`.
|
||||
- **ATTENDU** : l'app revient au premier plan avec le focus sur le master password (même comportement que les autres hotkeys), pas de no-op silencieux.
|
||||
- **ACTION** : verrouiller → `Ctrl+Shift+T`, puis **`Ctrl+Shift+Q`**, depuis une autre application (Notepad).
|
||||
- **ATTENDU** : l'app revient au premier plan **et y reste**, focus sur le master password. Pas de no-op silencieux, et **aucun clignotement** : elle ne doit pas apparaître puis rendre la main à l'application de départ.
|
||||
- **Historique** : les deux chemins « coffre verrouillé » annulaient l'autofill avec le refocus **par défaut**, qui rend volontairement le premier plan à la fenêtre cible — juste après que Delphi ait affiché notre fenêtre. Sur `Ctrl+Shift+Q` ça se voyait comme un flash d'une frame avant le retour à Notepad ; sur `Ctrl+Shift+L` le `focusApp()` qui suit reprenait le focus, donc deux déplacements de fenêtre pour finir là où un seul suffit. Les deux passent maintenant `refocus=false` (cf. B17 : **un refus ne doit jamais déplacer une fenêtre**).
|
||||
|
||||
### 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.
|
||||
|
||||
+4
-1
@@ -253,7 +253,10 @@ async function autofillHandleRequest(windowTitle, kind) {
|
||||
if (!state.cryptoKey || state.locked || !state.token) {
|
||||
// Vault is locked — bring the app to the front so the user can
|
||||
// unlock immediately, rather than silently no-op'ing the hotkey.
|
||||
Bridge.cancelAutofill();
|
||||
// refocus=false: the default hands the foreground back to the target,
|
||||
// which focusApp would then have to take away again — two window moves
|
||||
// to end where one gets us, and the round trip is visible.
|
||||
Bridge.cancelAutofill(false);
|
||||
Bridge.focusApp();
|
||||
setTimeout(() => {
|
||||
const pwd = document.getElementById('loginPassword');
|
||||
|
||||
@@ -550,8 +550,12 @@ const Bridge = (() => {
|
||||
if (typeof toast === 'function')
|
||||
toast('Vault is locked — unlock to search', 'warning');
|
||||
// Tell Delphi we cancelled so the captured HWND doesn't
|
||||
// linger waiting for a never-coming /execute.
|
||||
if (forFill && Bridge.cancelAutofill) Bridge.cancelAutofill();
|
||||
// linger waiting for a never-coming /execute. refocus=false:
|
||||
// Delphi has just brought our window up and we put the cursor
|
||||
// in the master-password field — handing the foreground back
|
||||
// to the target would undo that, which read as a 1-frame flash
|
||||
// before the other application took over again.
|
||||
if (forFill && Bridge.cancelAutofill) Bridge.cancelAutofill(false);
|
||||
return;
|
||||
}
|
||||
if (typeof openQuickSearchModal === 'function')
|
||||
|
||||
Reference in New Issue
Block a user