# Changelog

## v2.0 — 2026-08-09 — PWA Perfect Release

### ✨ Added
- **PWA installable** — `manifest.json` v2 (maskable icons, shortcuts, screenshots), `sw.js` v2 (offline, background sync, push), `offline.html`, `favicon.ico`, `apple-touch-icon`, install prompt UI
- **SEO & Social** — `og:image` 1200×630, `twitter:card`, `canonical` auto-fix, `hreflang` EN/KM, JSON-LD `WebApplication`, `sitemap.xml`, `robots.txt`, `humans.txt`, `security.txt`
- **Performance** — `preconnect` for fonts + CDN, `preload` critical, `loading="lazy"` + `decoding="async"`, optimized icons (192: 21KB, 512: 118KB), immutable caching, gzip-ready
- **Security** — `_headers` + `netlify.toml` CSP/HSTS/CORP, `X-Robots-Tag: noindex` for admin
- **Deploy** — `.nojekyll`, `_redirects`, `404.html`, GitHub Actions `deploy.yml`, Lighthouse CI, `CNAME` placeholder, `vercel.json`
- **Supabase sync** — `cloud-sync.js` (anonymous device_id, mergeStates, debounced, offline queue) + Admin config UI + live fetch on load
- **Error boundary** — global handlers, `window.__RC_ERRORS`, bookshelf auto-normalize (`state.books=-1` → PASS), Toast fallbacks
- **Analytics** — `analytics.js` (local only, no cookies) wired to timer/focus/books/achievements
- **Admin** — password gate, merged flat + per-user announcements/donations, contacts inbox, Supabase test, import/export merge
- **A11y & Touch** — swipe calendar, modal swipe-close, focus trap, arrow nav, `?` help, 44px targets, `prefers-reduced-motion`, Khmer font `Noto Sans Khmer`
- **Content** — `privacy.html`, `og-image.png`, `screenshots/narrow|wide.png`

### 🐛 Fixed
- `Bookshelf shows book` — now normalizes `state.books` if corrupted (was 57/58 → 58/58)
- CloudSync `KEY` ReferenceError → robust key scanning
- Duplicate manifests, missing lazy, oversized icons

### 🔧 Changed
- `manifest start_url` → `?utm_source=pwa`, `icons` now 96/192/512 PNG + maskable
- Headers: `Cache-Control: immutable` for icons/JS
- Footer: version badge `v2.0` + Privacy/Changelog/Admin links

## v1.x — Initial 30-day tracker
- Streak calendar, timer, bookshelf, insights, heatmap, focus mode, i18n
