From 2d9040dbaee62f75165fc760e2c4a96d3d330de8 Mon Sep 17 00:00:00 2001 From: OpenSquared Date: Fri, 24 Jul 2026 21:26:41 +0200 Subject: [PATCH] feat: cockpit --- frontend/src/components/TradeRankList.tsx | 2 +- frontend/src/pages/Dashboard.tsx | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/TradeRankList.tsx b/frontend/src/components/TradeRankList.tsx index e73210a..0b30eea 100644 --- a/frontend/src/components/TradeRankList.tsx +++ b/frontend/src/components/TradeRankList.tsx @@ -34,7 +34,7 @@ export default function TradeRankList({ trades, mode, title, linkTo, toggle, tic const isBear = t.strategy?.toLowerCase().includes('put') || t.strategy?.toLowerCase().includes('bear') const entryDate = t.entry_date ? t.entry_date.slice(0, 10) : null return ( -
+
{i + 1} {isBear ? '🐻' : '🐂'} diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 58fc77e..3f1b749 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -228,14 +228,18 @@ export default function Dashboard() { } const underlyingDisplayName = (underlying: string): string => { if (!underlying) return underlying - const upper = underlying.toUpperCase() - const watchlistTickers = new Set(((watchlistItems as any[]) ?? []).map(w => w.ticker.toUpperCase())) + const upper = underlying.trim().toUpperCase() + const watchlistTickers = new Set(((watchlistItems as any[]) ?? []).map(w => String(w.ticker).trim().toUpperCase())) const baseTicker = upper.replace(/(=X|=F)$/, '') - if (watchlistTickers.has(upper)) return upper - if (watchlistTickers.has(baseTicker)) return baseTicker - const alias = UNDERLYING_ALIASES[upper] - if (alias && watchlistTickers.has(alias)) return alias - return underlying + let resolved = underlying + if (watchlistTickers.has(upper)) resolved = upper + else if (watchlistTickers.has(baseTicker)) resolved = baseTicker + else { + const alias = UNDERLYING_ALIASES[upper] + if (alias && watchlistTickers.has(alias)) resolved = alias + } + console.warn('[TradesOverview] underlyingDisplayName', { raw: underlying, upper, baseTicker, watchlistTickers: Array.from(watchlistTickers), resolved }) + return resolved } // Patterns from the last cycle only (filter by created_at >= cycle started_at)