fix(base): auto-logout ignora le letture del solo calibro (#37 punto 2)

L'inattività contava mousemove/mousedown/keypress/touchstart/scroll. Il
numpad fa preventDefault() su ogni cifra/Enter letta dal calibro USB, il che
sopprime anche il keypress successivo: un operatore che lavora solo di
calibro non generava alcuna attività e veniva disconnesso a metà task.
Aggiunto 'keydown' alla lista: scatta comunque, a prescindere dal
preventDefault() di un handler successivo sullo stesso evento.

Test: rendering di una pagina con auto_logout_minutes impostato, verifica
che l'elenco eventi contenga 'keydown'.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-21 22:46:45 +02:00
parent 31fa78bdfd
commit f739f963c7
2 changed files with 32 additions and 1 deletions
+5 -1
View File
@@ -138,7 +138,11 @@
self.showWarning = false;
}
};
['mousemove','mousedown','keypress','touchstart','scroll'].forEach(function(evt) {
// 'keydown', not just 'keypress': the numpad calls preventDefault() on every
// digit/Enter it reads from the USB caliper, which also suppresses the
// keypress that would otherwise follow - an operator working only from the
// caliper produced no activity at all and was logged out mid-task (#37.2).
['mousemove','mousedown','keydown','keypress','touchstart','scroll'].forEach(function(evt) {
window.addEventListener(evt, handler, { passive: true });
});
},