# Changelog — Shoe Customizer

## 0.4.1 — Phase 1b fix (2026-07-25)

- **Fix: paid options / size run wouldn't save** in the builder. The "Re-sync zones from seed"
  form was nested inside the main Save form, which HTML forbids — the browser dropped the inner
  tag and its hidden `action=sc_resync_zones` input leaked into the Save form, so clicking **Save
  shoe** fired the *re-sync* handler instead (the tell-tale `sc_msg=resynced`) and your options
  never persisted. The re-sync form is now a sibling of the Save form, wired to its button via the
  HTML5 `form=` attribute — layout unchanged, Save now saves.

## 0.4.0 — Phase 1b (2026-07-24)

**Priced options, size runs & logo upload.** Three storefront features in one release.

### New for customers
- **Paid option groups** — add-ons beyond the base colour path (swatch / buttons / dropdown /
  custom text), each with its own price. The running price updates live and required choices are
  enforced before checkout. Conditional groups can be shown only when another choice is made.
- **Size-run grid** — a quantity box per size; the total pairs becomes the order line quantity,
  with a **2-pair minimum** per line.
- **Logo upload** — a customer uploads a PNG/JPG logo (≤5 MB) and **drags to position / drags the
  corner to resize** it live within a defined print area on the shoe.

### New for store admins (no-code builder)
- **Options** editor — repeater of option groups + choices with `+A$` deltas, target zone +
  colour for swatch options, a *required* flag, and one *show-only-when* visibility rule per group.
- **Size run** editor — one size per line (seeded US 6–13).
- **Logo print area** — draw the allowed rectangle for a logo on any zone.
- **Re-sync zones from seed** — refresh a seeded shoe's base image + zone slices from the bundled
  artwork without disturbing price, product mapping, palette, options, sizes or print areas.

### Under the hood
- New secured upload endpoint (`SC_Upload`): nonce-gated, 5 MB cap, real-image + PNG/JPG allowlist
  (no SVG), bytes **re-encoded** through the WP image editor to defuse polyglot/EXIF payloads,
  randomised filename under `uploads/shoe-customizer/logos/`.
- Cart/order integration re-validates and **re-prices every design server-side** — option ids,
  size codes, logo ownership, required choices and the size total are all checked against the
  shoe's own config; the browser is never trusted for price or quantity.
- Design rendering: overlay editing chrome (print-area outline + drag handle) is drawn on a
  separate canvas so it never bakes into the mockup.
- No schema change — `sc_db_version` stays at `1`.

### Display refinements
- Dark colours no longer crush stitching detail on overlays (luminance-tuned tint floor).
- Dunk **laces** and **lace guard** are now separately colourable zones.

---

## 0.3.3 — Phase 3

WooCommerce cart/order integration: design JSON + mockup on the line item, server-side price,
buy-path guard (customizer is the only way to buy a shoe product).

## 0.1.0 — Phase 1

Data model, no-code admin builder, config REST endpoint, seed importer.
