Files
meshcore-analyzer/public
Kpa-clawbot b654ac6c9f Fix #284: preserve home/theme data on partial FAQ save (#287)
## Fix: FAQ save no longer wipes other home page sections

Fixes #284

### Problem
Editing FAQ in the customizer and saving caused other home page sections
(steps, footer links, hero text) to disappear on reload. Colors could
also reset.

### Root cause
`initState()` in `customize.js` used `||` (OR) logic for the `home`
object — if localStorage had *any* `home.checklist`, it took that and
ignored the server config for other fields. Partial localStorage data
replaced the full server config instead of merging on top.

### Fix
Changed `initState()` to properly layer: `DEFAULTS → server config →
localStorage` for all sections. Each field merges independently — a
partial localStorage save (e.g., only checklist) no longer wipes steps,
footerLinks, or hero fields. Same merge pattern applied to all theme
sections for consistency.

### Files changed
- `public/customize.js` — `initState()` merge logic
- `public/index.html` — cache buster bump
- `test-frontend-helpers.js` — regression tests:
  1. Partial localStorage (checklist only) preserves steps/footerLinks
  2. Server config values survive partial local overrides
  3. Full localStorage properly overrides server config

### Testing
- `node test-frontend-helpers.js` 
- `node test-packet-filter.js` 
- `node test-aging.js` 

Co-authored-by: Kpa-clawbot <259247574+Kpa-clawbot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 18:14:59 -07:00
..
2026-03-18 19:34:05 +00:00