fix: header 3-col layout, shopping_name migration, demo mode UI, kiosk buttons left

Header layout:
- Redesign header-content as 3-column flex (left / center / right)
- Add #header-left div: dedicated slot for kiosk buttons (empty by default)
- header-title: flex-shrink auto, no more position:absolute centering hack
- header-actions: flex:1 1 0 + justify-content:flex-end (right)
- header-left: flex:1 1 0 (left) — equal width balances the title visually

Kiosk exit/refresh buttons:
- _injectKioskOverlay() now appends to #header-left instead of
  insertBefore(firstChild) — buttons appear on LEFT, not mixed with center

DB migration:
- Add shopping_name TEXT DEFAULT '' to CREATE TABLE products schema
- Add ALTER TABLE migration in migrateDB() for existing databases
- Avoids repeated ALTER TABLE in seed code on every request

Demo mode UI:
- _applyDemoModeUI(): hides ⚙️ settings nav button in demo mode
- Suppresses first-run setup wizard when _demoMode === true
- Shows a small DEMO badge in header-left
- Called from both syncSettingsFromDB() and _initApp()
This commit is contained in:
dadaloop82
2026-05-04 12:52:29 +00:00
parent 77c2bd59a7
commit f625e55526
4 changed files with 50 additions and 13 deletions
+17 -7
View File
@@ -105,17 +105,23 @@ body {
}
.header-content {
position: relative;
display: flex;
align-items: center;
justify-content: flex-end;
width: 100%;
gap: 0;
}
/* Left zone: kiosk-only buttons (exit, refresh) — empty on normal browser */
.header-left {
flex: 1 1 0;
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
}
.header-title {
position: absolute;
left: 50%;
transform: translateX(-50%);
flex: 0 1 auto;
font-size: 1.3rem;
font-weight: 700;
cursor: pointer;
@@ -123,9 +129,10 @@ body {
align-items: baseline;
gap: 6px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
pointer-events: auto;
/* prevent title overlapping action buttons on small screens */
max-width: calc(100% - 200px);
text-align: center;
}
.header-version {
@@ -209,9 +216,12 @@ body {
}
.header-actions {
flex: 1 1 0;
display: flex;
gap: 10px;
align-items: center;
justify-content: flex-end;
min-width: 0;
}
/* ── Smart Scale status indicator in header ─────────────────────────── */