From 277b5ad9c6496c28c6aea2c06e32350dd8bf0a16 Mon Sep 17 00:00:00 2001 From: tinkle-community Date: Tue, 30 Jun 2026 16:13:59 +0800 Subject: [PATCH] refactor: drop equity curve + AI rationale panels, rebalance dashboard footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove the equity curve (only ever 2 points → a meaningless straight line); also drop the now-unused equity-history SWR poll and path calc - Remove the Latest Decision / AI rationale panel (redundant with Execution Log) - Rebalance the footer: Market Net Inflow + By Symbol now form one two-column row (1.5fr / 1fr) instead of full-width inflow + a lonely by-symbol column --- .../components/terminal/TerminalDashboard.tsx | 86 +++---------------- 1 file changed, 10 insertions(+), 76 deletions(-) diff --git a/web/src/components/terminal/TerminalDashboard.tsx b/web/src/components/terminal/TerminalDashboard.tsx index 7b242508..1a014eec 100644 --- a/web/src/components/terminal/TerminalDashboard.tsx +++ b/web/src/components/terminal/TerminalDashboard.tsx @@ -102,11 +102,6 @@ export function TerminalDashboard({ () => api.getFullStats(traderId!, true), { refreshInterval: 30000, shouldRetryOnError: false } ) - const { data: equity } = useSWR( - traderId ? ['equity-history', traderId] : null, - () => api.getEquityHistory(traderId!, true), - { refreshInterval: 30000, shouldRetryOnError: false } - ) const { data: history } = useSWR( traderId ? ['pos-history', traderId] : null, () => api.getPositionHistory(traderId!, 50, true), @@ -222,23 +217,6 @@ export function TerminalDashboard({ } } - const equityPath = useMemo(() => { - if (!equity || equity.length < 2) return null - const vals = equity.map((e: { total_equity: number }) => e.total_equity) - const min = Math.min(...vals) - const max = Math.max(...vals) - const span = max - min || 1 - const W = 680 - const H = 80 - return vals - .map((v: number, i: number) => { - const x = (i / (vals.length - 1)) * W - const y = H - ((v - min) / span) * (H - 10) - 5 - return `${i === 0 ? 'M' : 'L'}${x.toFixed(1)},${y.toFixed(1)}` - }) - .join(' ') - }, [equity]) - const recentTrades = (history?.positions ?? []).slice(0, 8) const symbolStats = useMemo( () => (history?.symbol_stats ?? []).slice().sort((a, b) => b.total_trades - a.total_trades).slice(0, 6), @@ -485,37 +463,17 @@ export function TerminalDashboard({
- {/* equity curve */} - {equityPath && ( - <> -
- Equity curve - Account equity curve · all {equity?.length ?? 0} pts -
-
- - - - -
-
- - )} - - {/* market net inflow — real Vergex flow-markets via claw402 */} -
-
- Market net inflow - Market net inflow · {flow?.data?.window || '1h'} · Vergex - {flowItems.length} markets -
- -
-
- - {/* by-symbol stats | latest decision */} -
+ {/* market net inflow (Vergex) · by-symbol history — balanced two-column footer */} +
+
+ Market net inflow + Market net inflow · {flow?.data?.window || '1h'} · Vergex + {flowItems.length} markets +
+ +
+
By symbol By-symbol history · trades/win/pnl @@ -533,30 +491,6 @@ export function TerminalDashboard({
)) :
No symbol history.
}
-
-
- Latest decision - AI rationale - {latest && {fmtTime(latest.timestamp)}{latest.decisions?.[0]?.confidence != null ? ` · conf ${latest.decisions[0].confidence}` : ''}} -
- {latest ? ( - <> -
- {(latest.decisions ?? []).slice(0, 5).map((d, i) => ( - {d.action} {baseLabel(d.symbol)} - ))} -
-

- {latest.decisions?.[0]?.reasoning || latest.cot_trace?.slice(0, 320) || 'No reasoning recorded.'} -

- {(latest.execution_log ?? []).length > 0 && ( -
- {(latest.execution_log ?? []).slice(0, 3).map((l, i) =>
{l}
)} -
- )} - - ) :
No decisions recorded yet.
} -