# Phase F4.1 — Drawing correction + chart foundation

**Base tag:** `v0.8.0` @ `4a8a8e5`  
**Release tag:** `v0.9.0` (see git log for commit hash)  
**Status:** Accepted for F4.1 scope (F5 not started)

## Goals

- Fix F4 manual failures: persistence scope bug, fib/rectangle two-click flow, pan/zoom pass-through, historical load trigger, move/select in chart coordinates.
- Extend drawing model v2 (`alertKey`, tool types) and grouped toolbar (21 tools).
- Full-chart (browser fullscreen) foundation; `lib/chart/chart-state.ts` for future layouts/alerts.
- No F5 live engine; no alert evaluation loops.

## Key implementation notes

- Drawing canvas uses `pointer-events: none`; interactions captured on `.chart-wrap` when a drawing hits or a draw tool is active.
- Older warehouse candles load when `getVisibleLogicalRange().from <= CHART_LOAD_OLDER_THRESHOLD_BARS`.
- Persistence key: `tradingbite:drawings:v1:{symbol}:{timeframe}`.
- `useDrawingStore`: saves previous scope before load; `drawingsScopeRef` prevents unmount/reload from writing M15 drawings into H1 keys; drawing layer stays mounted during warehouse reload (`loadState.status === "loading"`).

## F4.1 acceptance result

| Area | Result |
|------|--------|
| Drawing persistence (5 types, refresh) | PASS |
| Move / delete persistence | PASS |
| Symbol scoping | PASS |
| Timeframe storage isolation | PASS (`m15InH1Store: false`) |
| Timeframe H1 new drawing | Blocked — no EUR/USD H1 warehouse rows (API 404) |
| Multi-asset (BTC, ETH, XAU, NAS100) | PASS |
| SMA / S/R Finder 2.1 | PASS |
| Alert-ready architecture | Present (`alertKey`, `AlertReference`); no alert UI |
| Historical pan 800→1300+ | PARTIAL in harness; API order dupes/rev 0 |
| Full 21-tool regression | Spot-checked via temp harness groups (not TV pixel parity) |

## Known limitations

- EUR/USD H1 not in warehouse — use another symbol/timeframe or import H1 before H1 UI acceptance.
- Do not run `next build` while `next dev` is running (corrupts `.next` chunks → API 500).
- Temp Puppeteer harness lives under `%TEMP%\tb-puppet\f41-final\` (not committed).

## Rollback

```powershell
git checkout v0.8.0
```
