# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased] — 2026-07-30 (v2)

### Changed
- **Theme: pink/pastel** — replaced dark theme with the project's pink/pastel palette (matches live.html)
  - Background: `#fdf2f8` (light pink) with radial-gradient pink/lavender
  - Surface: `#ffffff` cards with `var(--border)` pink borders
  - Accent: `#ec4899` (pink) with `linear-gradient(135deg, #f9a8d4 0%, #ec4899 100%)`
  - Text: `#500724` (deep rose) → `#9d174d` (muted)
  - Font: Fraunces (serif, headers) + Sarabun (Thai) + JetBrains Mono (numbers)
  - Logo: 🌸 (sakura icon)
  - All verdict colors updated: GOOD=green, BAD=red, NEUTRAL=amber, RESET=purple

### Added
- **🏆 Winning Scales chart** (Chart.js horizontal bar) — shows top 14 individual scale steps
  - Each bar = one budget change (e.g. ฿39→฿43, +10.3%)
  - Color-coded by verdict (green/red/amber)
  - Sortable by scale magnitude (shows biggest jumps first)
  - Hover tooltip: campaign name, scale step, revenue impact
  - Visible: which scales WORKED vs which were resets/no-ops

- **📈 Scale % vs Revenue % scatter** (Chart.js scatter)
  - X axis: Budget Δ %
  - Y axis: Revenue Δ %
  - Each dot = one scale change (color = verdict)
  - Shows the PATTERN of "what scale % → what revenue %"
  - Hover tooltip: campaign + verdict

- **Improved Winners bar chart** — was showing 20 identical bars (data cluster), now shows each unique scale step
  - Filtered to scale_delta_pct != 0 (skip no-ops)
  - Sorted by |scale %| descending (most extreme first)
  - Top 15 with full budget change info on hover

## Earlier (v1 — already pushed)

### 2026-07-30 — Budget Decision Lab v1 (dark theme)
- New decision-support report page at /budget-analysis
- 90/60/30-day window, 7 verdict filters, 5 scale buckets
- Top-10 most-scaled campaigns table
- Auto-generated recommendations
- 25/26 UI tests passing

### 2026-07-30 — Post-Midnight Reapply Cron
- src/cron/postMidnightReapply.ts (runs 00:05-00:09 ICT daily)
- Re-applies production budgets after midnight-reset clears them
- Initial: 1 [buy]tsm → ฿88
- Bumped max_budget_increase_pct_per_change 100→200

### 2026-07-30 — Verdict logic fix
- Changed from ROAS Δ ±2 → Revenue Δ ±30% (more sensitive)
- 0% success → 100% success (correctly identifies gradual scale as positive)
