diff --git a/TODO.md b/TODO.md index b1aaaee..36597f7 100644 --- a/TODO.md +++ b/TODO.md @@ -148,7 +148,66 @@ bird photo appears in a browser. - [ ] Three themes — light, dark, blue — as design tokens → CSS custom properties, persisted per user - [ ] Auth: session cookies, Argon2id, CSRF, RBAC per SPEC §3.1 (viewer / editor / admin), `audit_log` on every mutation - [ ] **Auth-checked image serving** — the app authorizes, Caddy serves the bytes. An unguessable URL is not access control -- [ ] Optional TOTP 2FA (see open Q14) +- [ ] TOTP 2FA — see 3.0 for the policy + +### 3.0 UI decisions (2026-09-21) + +**Language: German and English, both, from the first component (Q11).** i18n is +nearly free on day one and miserable to retrofit. `taxa` already carries +`name_de` and `name_en`; `users.locale` already exists and defaults to `de`. +Rule: no user-facing string literal in a component, ever — every one goes +through the translation catalogue, including the first one. + +**Theme "blue" is a dark navy (Q13).** Tokens below. Light and dark stay +conventional; blue is the distinctive one. Contrast targets WCAG AA (≥4.5:1 for +body text) — check it when the tokens land, do not assume it. + +| Token | Blue | +|---|---| +| `--bg` | `#0B1220` | +| `--surface` | `#111C2E` | +| `--surface-raised` | `#17253B` | +| `--border` | `#22344F` | +| `--text` | `#E6EDF7` | +| `--text-muted` | `#9FB3CE` | +| `--accent` | `#4C8DFF` | +| `--accent-hover` | `#6BA1FF` | +| `--success` / `--warning` / `--danger` | `#3DD68C` / `#F0B429` / `#F2545B` | + +**2FA: build TOTP now, optional per user, enforced for `admin` (Q14).** The +reasoning matters more than the setting, because "the UI does not need it" and +"I need access from outside" describe the *same* surface — whatever is reachable +from outside is the UI. What differs is the path: + +- Over **Tailscale** (the SPEC §0 decision): the network layer already demands an + enrolled device, and Tailscale enforces 2FA at your identity provider. UI 2FA + is then belt-and-braces. +- Over a **public domain** (SPEC §1.2, "design for, do not build"): UI 2FA stops + being optional. + +Build it now regardless, because retrofitting 2FA means reopening the login +flow, the session model, the user model and the audit log at once — the four +places you least want to revisit. `users.totp_secret` already exists. Enforce +for `admin`; leave it opt-in for `viewer`/`editor` on the LAN. A +`require_2fa` server setting flips the whole thing on the day you go public. + +**Stack stays React + TypeScript (Q16), with the learning curve taken seriously.** +No TS experience, but willing to learn. The gallery is genuinely a client-side +app — a virtualised grid and the keyboard-driven labelling loop — and that is +the thing HTMX would fight later. So: plain function components, no exotic +generics, no state-management library beyond TanStack Query, and comments that +explain the TypeScript rather than assuming it. **Fallback if it stops being +fun:** SPEC §5's Jinja2 + HTMX frontend is still a valid target and the API does +not change. Deciding to switch is not a failure; discovering it three months in +would be. + +**Placeholder data: generated, not downloaded.** A seed command +(`poorbird seed --captures 500`) synthesises captures with realistic burst +structure, pre-trigger flags, timestamps and species spread. Reasons: no image +licensing question at all, no binary blobs in git, and it can produce the +*volume* the virtualised grid actually needs to be tested against. Real photos +prove nothing about a gallery that a generated one does not — until Phase 2 +brings real captures, which is the only test that counts. ### 3.1 Two things the UI must not get wrong @@ -204,7 +263,8 @@ Scope is device → server, watched internally. Public relay stays out (SPEC C3) ## Still open (from SPEC §10) -Answered and closed: Q1 (Option B), Q2 (XIAO ESP32S3 Sense), Q4 (internal first), Q5 (x86 thin client). +Answered and closed: Q1 (Option B), Q2 (XIAO ESP32S3 Sense), Q4 (internal first), +Q5 (x86 thin client), **Q11, Q13, Q14 and Q16 — see Phase 3.0**. Void under mains power: Q10 (battery chemistry). | # | Question | Blocks |