fix: Trades du cycle — show suggested trade details for non-logged patterns

For patterns added in the cycle but below log threshold, display the
recommended_trade (underlying + strategy + score) from scoreMap instead
of just the pattern name. Pattern name moves to secondary small italic line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-19 22:35:26 +02:00
parent 38c9aadb6b
commit bbc9461a8b

View File

@@ -651,14 +651,38 @@ export default function Dashboard() {
<div className="text-[8px] text-slate-600 italic truncate mt-0.5 ml-4">{p.name}</div>
</>
) : (
<div className="flex items-center gap-1.5 text-[10px]">
<span className="text-slate-700 shrink-0"></span>
<span className="text-slate-600 truncate flex-1 italic">{p.name}</span>
{score !== null && (
<span className={clsx('font-mono shrink-0 text-[9px]', scoreColor(score))}>{score}</span>
)}
<span className="text-[8px] text-slate-700 shrink-0">non loggé</span>
</div>
<>
{/* Suggested trade from scoreMap — primary */}
{(() => {
const sp = scoreMap[p.id]
const rec = sp?.recommended_trade ?? sp?.trade_rankings?.[0]
const underlying = rec?.underlying ?? rec?.ticker ?? null
const strategy = rec?.strategy ?? rec?.trade_type ?? null
const evVal: number | null = rec?.ev_net ?? rec?.ev ?? null
const isBearS = strategy?.toLowerCase().includes('put') || strategy?.toLowerCase().includes('bear')
return (
<>
<div className="flex items-center gap-1.5 text-[10px]">
<span className="text-slate-600 shrink-0">{isBearS ? '🐻' : '🐂'}</span>
<span className={clsx('font-mono font-bold w-10 truncate shrink-0', underlying ? 'text-slate-400' : 'text-slate-700')}>
{underlying ?? '—'}
</span>
<span className="text-slate-600 truncate flex-1">{strategy ?? 'trade suggéré'}</span>
{evVal !== null && (
<span className="font-mono text-[9px] text-slate-600">
EV{evVal >= 0 ? '+' : ''}{evVal.toFixed(2)}
</span>
)}
{score !== null && (
<span className={clsx('font-mono shrink-0 font-bold', scoreColor(score))}>{score}</span>
)}
<span className="text-[8px] text-slate-700 shrink-0">non loggé</span>
</div>
<div className="text-[8px] text-slate-700 italic truncate mt-0.5 ml-4">{p.name}</div>
</>
)
})()}
</>
)}
</div>
)