feat: kiosk setup improvements + webapp scale indicator fixes
kiosk setup wizard: - Scale step: ask user to power on the scale before scanning (new 'Accendi la bilancia' card with 'Bilancia accesa → Cerca' button) - BLE scan: filter results to only show compatible scales (scaleScore>0) hiding clearly non-scale BLE devices from the list - After device selection: run a live connection test — connect to the scale, display the live weight, ask 'Corrisponde al peso sulla bilancia?' with ✅ Sì / ❌ Riprova / Skip buttons before confirming the device webapp: - Scale indicator not live on first load: scaleInit() was firing before syncSettingsFromDB() resolved; fixed by chaining .then(scaleInit) - Scale icon green-on-green: connected state dot changed from #22c55e (green, invisible on dark-green header) to white with green border+glow, visible on any background color
This commit is contained in:
@@ -284,18 +284,19 @@ body {
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-radius: 50%;
|
||||
border: 1.5px solid #0f172a;
|
||||
background: #475569;
|
||||
transition: background 0.4s, box-shadow 0.4s;
|
||||
border: 1.5px solid rgba(0,0,0,0.35);
|
||||
background: #94a3b8;
|
||||
transition: background 0.4s, box-shadow 0.4s, border-color 0.4s;
|
||||
pointer-events: none;
|
||||
}
|
||||
.scale-status-connected .scale-status-dot { background: #22c55e; box-shadow: 0 0 5px #22c55eaa; }
|
||||
/* Connected: white dot with green glow — always visible regardless of header color */
|
||||
.scale-status-connected .scale-status-dot { background: #ffffff; border-color: #22c55e; box-shadow: 0 0 6px #22c55e; }
|
||||
.scale-status-connected .scale-icon-emoji { filter: none; opacity: 1; }
|
||||
.scale-status-searching .scale-status-dot { background: #f59e0b; animation: scaleStatusPulse 1.4s infinite; }
|
||||
.scale-status-searching .scale-status-dot { background: #f59e0b; border-color: rgba(0,0,0,0.35); animation: scaleStatusPulse 1.4s infinite; }
|
||||
.scale-status-searching .scale-icon-emoji { filter: none; opacity: 0.85; }
|
||||
.scale-status-disconnected .scale-status-dot { background: #475569; }
|
||||
.scale-status-disconnected .scale-status-dot { background: #64748b; border-color: rgba(0,0,0,0.35); }
|
||||
.scale-status-disconnected .scale-icon-emoji { filter: grayscale(0.5); opacity: 0.55; }
|
||||
.scale-status-error .scale-status-dot { background: #ef4444; box-shadow: 0 0 5px #ef4444aa; }
|
||||
.scale-status-error .scale-status-dot { background: #ef4444; border-color: rgba(0,0,0,0.35); box-shadow: 0 0 5px #ef4444aa; }
|
||||
.scale-status-error .scale-icon-emoji { filter: none; opacity: 1; }
|
||||
@keyframes scaleStatusPulse {
|
||||
0%, 100% { box-shadow: 0 0 3px #f59e0b88; }
|
||||
|
||||
+3
-2
@@ -12177,13 +12177,14 @@ async function _initApp() {
|
||||
localStorage.removeItem('_bgBringSyncTs');
|
||||
localStorage.setItem('_bgBringSyncReset_v1', '1');
|
||||
}
|
||||
syncSettingsFromDB();
|
||||
syncSettingsFromDB().then(() => {
|
||||
scaleInit(); // connect to smart scale gateway if configured (needs settings)
|
||||
});
|
||||
showPage('dashboard');
|
||||
initInactivityWatcher();
|
||||
initSpesaMode();
|
||||
initScreensaverShortcuts();
|
||||
startBgShoppingRefresh();
|
||||
scaleInit(); // connect to smart scale gateway if configured
|
||||
_injectKioskOverlay(); // kiosk X / refresh buttons (only when running inside Android WebView)
|
||||
|
||||
// Hide preloader once the dashboard is rendered
|
||||
|
||||
Reference in New Issue
Block a user