Kiosk: live-force reset to welcome screen, configurable inactivity timeout

Kiosk's SSE connection now stays open for the whole session instead of
closing the moment a booking is pushed, so a staff-triggered Reset (from
the extension/Terminals popup or the Devices admin page) now actually
forces the tablet back to the welcome screen immediately, discarding
whatever was mid-entry — not just flipping its status in the DB with
nothing listening tablet-side. Removed the two now-redundant/harmful
pushIdle() calls in routes/checkin.js's own submit success/failure paths,
which would otherwise race the confirmation/error screen now that the
stream stays open. Added a confirm() prompt before Reset on both trigger
surfaces since it's now a real interruption, not just an unstick.

Also made the tablet's inactivity auto-cancel timeout configurable from
Settings (checkin_inactivity_timeout_minutes, default 5, same as the old
hardcoded value) instead of a fixed constant, read via the existing
token-gated GET /api/checkin/:token response.
This commit is contained in:
jtricerolph 2026-10-09 12:19:53 +00:00
parent 790431c446
commit 5180adf8d2
10 changed files with 84 additions and 14 deletions

View file

@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Send to Check-In Tablet",
"version": "0.2.0",
"version": "0.2.1",
"description": "Pushes the currently open NewBook booking to a check-in tablet — standalone from NewBook Assistant, see project_checkin memory.",
"permissions": ["cookies", "storage", "activeTab", "webNavigation"],

View file

@ -214,6 +214,12 @@ function renderTablets(el, devices, baseUrl, apiKey) {
el.querySelectorAll('.reset-btn').forEach(btn => {
btn.addEventListener('click', async () => {
// Reset now pushes a live 'idle' event straight to the tablet
// (2026-10-09, see tablet-checkin's Kiosk.tsx) rather than only
// flipping its status server-side — if a guest is mid check-in on it,
// this sends them back to the welcome screen immediately and discards
// whatever they'd filled in.
if (!confirm('Reset this tablet? If a guest is mid check-in, this returns them to the welcome screen immediately and loses anything they’ve entered.')) return;
btn.disabled = true;
btn.textContent = '…';
try {