fix(hibp): move the progress pill off the sidebar and abort the scan on toggle-off

The pill was pinned to the left edge and covered the navigation, hiding Trash. It also kept counting after Breach check disabled, the workers carrying on with one network round-trip per entry.
This commit is contained in:
r-zakarya
2026-08-01 20:12:09 +01:00
parent fd03c1da25
commit 961d77534f
3 changed files with 12 additions and 1 deletions
+2
View File
@@ -361,6 +361,8 @@ l'éditeur slideover : créer + éditer une entrée, ajouter/retirer des tags,
- **ACTION** : dans *Vault health*, activer la vérification HIBP → attendre la fin du scan **sans quitter la vue**.
- **ATTENDU** : la carte *Pwned* et le score se mettent à jour **tout seuls** quand le scan finit.
- **ACTION 2** : désactiver HIBP → la catégorie *Pwned* retombe à 0 immédiatement.
- **ACTION 3** : relancer un scan et **désactiver HIBP en plein milieu**.
- **ATTENDU** : la pastille de progression (en bas, à droite de la barre latérale) **disparaît aussitôt** ; plus aucune requête réseau. Elle continuait à compter après « Breach check disabled », le scan poursuivant un aller-retour réseau par entrée.
- **Historique** : le cache santé était calculé **avant** l'arrivée des résultats et rien ne l'invalidait ensuite. La vue affichait `0 pwned` pendant que les cartes de la liste portaient déjà le drapeau ; il fallait sortir et revenir pour voir `2`. Symétrique à la désactivation, qui vidait `hibpResults` en laissant le tableau de bord compter des brèches disparues. `hibpCheckAllEntries` et le toggle invalident désormais `healthCache`.
### G4 · le score bouge par paliers de 10 — comportement attendu
+4 -1
View File
@@ -2347,7 +2347,9 @@ body[data-editor-position="center"]:has(#settingsPanel.is-open)::before {
stack bottom-right. Non-blocking: no backdrop, no pointer capture. */
.hibp-progress {
position: fixed;
left: 16px; bottom: 16px;
/* Clear of the 240px sidebar — pinned to the left edge it sat on top of the
navigation and hid Trash. Left of the toasts, which stack bottom-right. */
left: 256px; bottom: 16px;
z-index: 150;
display: flex; align-items: center; gap: 8px;
padding: 8px 12px;
@@ -2666,6 +2668,7 @@ body[data-editor-position="center"]:has(#settingsPanel.is-open)::before {
@media (max-width: 900px) {
.app-shell { grid-template-columns: 60px 1fr; }
.hibp-progress { left: 76px; } /* the sidebar collapses to 60px here */
.sidebar { padding: 12px 6px; }
.sidebar-brand span,
.nav-item > span:first-of-type,
+6
View File
@@ -989,6 +989,10 @@ async function hibpCheckAllEntries() {
for (let w = 0; w < CONCURRENCY; w++) {
workers.push((async () => {
while (queue.length) {
// Stop as soon as the user turns the check off: the scan is one
// network round-trip per entry, and it kept running (and kept
// counting in the pill) after "Breach check disabled".
if (!state.hibpEnabled) return;
const entry = queue.shift();
try {
const pwd = await decryptPwd(entry.encrypted_password, entry.iv);
@@ -1006,6 +1010,8 @@ async function hibpCheckAllEntries() {
}
await Promise.all(workers);
hibpProgress(null);
// Aborted by the toggle: it already cleared the results and refreshed.
if (!state.hibpEnabled) return;
// The health dashboard reads its "pwned" column from state.hibpResults, and
// its cache may well have been computed before these results landed — that
// is exactly what happens when HIBP is switched on from the health view