feat: expandable inline rows in Journal + journal/maturity params in Config

- JournalDeBord: trade rows now expand inline (full-width) instead of
  PostmortemPanel appearing below the whole table. Click anywhere on a
  row to toggle. Period selector extended to 15/30/60/90j.
- Config: added Rétention Journal (30/60/90/180j) and Seuil Maturité
  (20/30/35/50%) controls, wired to the Appliquer button.
- Backend: journal_retention_days and maturity_threshold_pct read from
  config table; seeded at startup with defaults 90d / 35%. get_status()
  now returns both values so Config page can initialise correctly.
- cycle.py: CycleConfigRequest accepts and validates both new params.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-18 10:08:16 +02:00
parent 8446876eb0
commit abee090881
5 changed files with 94 additions and 25 deletions

View File

@@ -44,6 +44,8 @@ class CycleConfigRequest(BaseModel):
similarity_threshold: Optional[float] = None
min_ev_threshold: Optional[float] = None
min_score_threshold: Optional[int] = None
journal_retention_days: Optional[int] = None
maturity_threshold_pct: Optional[int] = None
@router.post("/config")
@@ -67,6 +69,14 @@ def update_cycle_config(req: CycleConfigRequest):
if not (0 <= req.min_score_threshold <= 100):
raise HTTPException(400, "min_score_threshold must be between 0 and 100")
set_config("min_score_threshold", str(req.min_score_threshold))
if req.journal_retention_days is not None:
if not (7 <= req.journal_retention_days <= 365):
raise HTTPException(400, "journal_retention_days must be between 7 and 365")
set_config("journal_retention_days", str(req.journal_retention_days))
if req.maturity_threshold_pct is not None:
if not (5 <= req.maturity_threshold_pct <= 75):
raise HTTPException(400, "maturity_threshold_pct must be between 5 and 75")
set_config("maturity_threshold_pct", str(req.maturity_threshold_pct))
# Restart scheduler to pick up changes
restart_scheduler()