From d8ca1ca24d84bbf7be2a2179fa33f7365b571668 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Thu, 23 Apr 2026 04:55:53 +0800 Subject: [PATCH] Clarify current market opportunities --- .../components/dashboard/Dashboard.module.css | 36 ++++---- .../dashboard/PolyWeatherDashboard.tsx | 85 ++++++++++--------- 2 files changed, 63 insertions(+), 58 deletions(-) diff --git a/frontend/components/dashboard/Dashboard.module.css b/frontend/components/dashboard/Dashboard.module.css index 87fdcb05..6ab726e5 100644 --- a/frontend/components/dashboard/Dashboard.module.css +++ b/frontend/components/dashboard/Dashboard.module.css @@ -2278,6 +2278,26 @@ grid-template-columns: repeat(5, minmax(0, 1fr)); } +.root :global(.opportunity-empty-state) { + display: flex; + min-height: 132px; + align-items: center; + justify-content: center; + border: 1px dashed rgba(34, 211, 238, 0.2); + border-radius: 16px; + background: + radial-gradient( + circle at 50% 0%, + rgba(34, 211, 238, 0.08), + transparent 44% + ), + rgba(7, 12, 22, 0.72); + color: rgba(148, 163, 184, 0.9); + font-size: 13px; + font-weight: 800; + letter-spacing: 0.04em; +} + .root :global(.opportunity-card) { position: relative; min-width: 0; @@ -2421,22 +2441,6 @@ filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.22)); } -/* Market-closed opportunity card — dimmed state */ -.root :global(.opportunity-card.market-closed) { - opacity: 0.6; - border-style: dashed; -} - -.root :global(.opportunity-card.market-closed:hover) { - opacity: 0.82; -} - -.root :global(.opportunity-market-status) { - color: rgba(251, 191, 36, 0.8); - font-size: 10px; - font-weight: 700; -} - @keyframes home-panel-enter { from { opacity: 0; diff --git a/frontend/components/dashboard/PolyWeatherDashboard.tsx b/frontend/components/dashboard/PolyWeatherDashboard.tsx index d924d586..b292b241 100644 --- a/frontend/components/dashboard/PolyWeatherDashboard.tsx +++ b/frontend/components/dashboard/PolyWeatherDashboard.tsx @@ -282,7 +282,7 @@ function buildDashboardSummaryCards( return [ { key: "opportunities", - title: locale === "en-US" ? "Today's Opportunities" : "今日机会分布", + title: locale === "en-US" ? "Current Opportunities" : "当前机会分布", items: [ { label: locale === "en-US" ? "High risk" : "高风险", @@ -1147,8 +1147,13 @@ function OpportunityStrip({ snapshots }: { snapshots: CitySnapshot[] }) { [locale, snapshots], ); - // Always show top 5 cities by score, regardless of market tradability - const items = useMemo(() => snapshots.slice(0, 5), [snapshots]); + const items = useMemo( + () => + snapshots + .filter((snapshot) => snapshot.tradableOpportunity) + .slice(0, 5), + [snapshots], + ); // Always render: summary cards should be visible even without tradable opportunities if (!snapshots.length) return null; @@ -1186,28 +1191,26 @@ function OpportunityStrip({ snapshots }: { snapshots: CitySnapshot[] }) { ))} - {items.length > 0 && ( - <> -
-
- - {locale === "en-US" - ? "Today's Top Opportunities" - : "今日最佳机会"} - - - {locale === "en-US" - ? "Market question · YES/NO · Edge · Trend" - : "市场问题 · YES/NO 价格 · Edge · 小趋势线"} - -
- - {locale === "en-US" ? "View all" : "查看全部"} - -
-
- {items.map( - ({ city, detail, summary, tradableOpportunity }, index) => { +
+
+ + {locale === "en-US" + ? "Current Best Markets" + : "当前最佳机会市场"} + + + {locale === "en-US" + ? "Live market question · YES/NO · Edge · Trend" + : "当前市场问题 · YES/NO 价格 · Edge · 小趋势线"} + +
+ + {locale === "en-US" ? "View all" : "查看全部"} + +
+ {items.length > 0 ? ( +
+ {items.map(({ city, detail, summary }, index) => { const symbol = getTempSymbol(city, summary, detail); const debPrediction = summary?.deb?.prediction ?? detail?.deb?.prediction; @@ -1222,7 +1225,6 @@ function OpportunityStrip({ snapshots }: { snapshots: CitySnapshot[] }) { city.risk_level || summary?.risk?.level || detail?.risk?.level; - const marketClosed = !tradableOpportunity; const marketBucket = detail?.market_scan?.temperature_bucket; const marketQuestion = detail?.market_scan?.primary_market?.question || @@ -1235,19 +1237,20 @@ function OpportunityStrip({ snapshots }: { snapshots: CitySnapshot[] }) { detail?.market_scan?.sparkline?.length ? detail.market_scan.sparkline : [ - Number(summary?.current?.temp ?? detail?.current?.temp ?? 0), + Number( + summary?.current?.temp ?? detail?.current?.temp ?? 0, + ), Number(debPrediction ?? 0), - Number(detail?.forecast?.today_high ?? debPrediction ?? 0), + Number( + detail?.forecast?.today_high ?? debPrediction ?? 0, + ), ], ); return ( ); - }, - )} -
- + })} +
+ ) : ( +
+ {locale === "en-US" + ? "No active opportunity market right now." + : "当前暂无可交易机会市场"} +
)} );