Add a header, a theme toggle and visible checkboxes

Three pieces of chrome that were missing or misleading.

A header with the bowl mark and the app name, on every page. The page title
bar below it is no longer sticky: on a phone a tall sticky header eats the
screen, and the bottom tab bar already handles navigation.

A theme toggle, remembered per device in localStorage, because a shared
instance with no accounts should let the kitchen phone and the laptop
disagree. Dark by default, and the default lives in the server-rendered
markup so it survives with JavaScript off and never flashes. The button shows
the theme that is on — moon while dark, sun while light — rather than the one
a click would bring, and its label names the state before the action. Both
icons ship on every page and CSS picks one, so the server never needs to know
what this device chose. Following the system was considered and dropped: a
third state costs a control harder to read than the choice is worth.

The checkbox chips no longer hide the native control behind opacity: 0. With
only a background colour to go on there was no way to tell "Tarjoillaan
lisukkeiden kanssa" on from off. Colour is not a state indicator; a checkbox
is. This covers the side, category and has_sides chips alike.

Smoke checks cover the parts that would regress silently: that dark is the
no-JS default, and that both theme icons are present for CSS to choose from.
This commit is contained in:
Esa Kataja
2026-09-05 19:05:41 +03:00
parent 0538d61ba6
commit 15495ec0c0
6 changed files with 189 additions and 29 deletions
+3 -7
View File
@@ -24,15 +24,11 @@ Working:
- **Ruoat** — add, edit and delete mains and sides, or import a whole bundle
by paste or file upload. Deletes are soft, so old log entries keep showing
the dish they used.
- **Light / dark**, remembered per device, dark by default. The button shows
the theme that is on — moon while dark, sun while light — not the one a
click would bring.
Still to build:
- **UI polish.** Checkbox chips hide the native control and signal state only
through background colour, so "Tarjoillaan lisukkeiden kanssa" gives no
clear read of on versus off. Show a real checkbox. Same applies to the
category and side chips.
- Light / dark theme switch, saved per device (PRD §7.4).
- A proper app header.
- Stage 2: the seven-meal suggester, which starts once there is history to
weight against.