fix: PatternLab save UX — color-coded toasts + meaningful error feedback

- handleSave now shows a red toast "Lancez d'abord un backtest" instead of
  silently returning when activeRun is null (was completely invisible to user)
- All toasts now color-coded: green (emerald) for success, red for errors
- list_runs now includes context_snapshot so market data table shows when
  loading a historical run from the right panel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-22 22:30:47 +02:00
parent 33097e1812
commit f2dd859ba0
2 changed files with 28 additions and 20 deletions

View File

@@ -168,7 +168,7 @@ def list_runs():
conn = get_conn()
rows = conn.execute("""SELECT id, preset_id, theme, analysis_date, horizon_days,
assets, status, created_at, evaluated_at,
outcome, ai_result
outcome, ai_result, context_snapshot
FROM backtest_lab_runs ORDER BY created_at DESC LIMIT 100""").fetchall()
conn.close()
return [_row_to_dict(r) for r in rows]