From bc09a3753c44cb03afa5e9ece78791f331f42753 Mon Sep 17 00:00:00 2001
From: "2569718930@qq.com" <2569718930@qq.com>
Date: Fri, 17 Apr 2026 20:40:17 +0800
Subject: [PATCH] Fix today analysis modal routing
---
.../dashboard/FutureForecastModal.tsx | 18 +++++++++++++-----
.../components/dashboard/PanelSections.tsx | 10 +++++++++-
frontend/hooks/useDashboardStore.tsx | 18 ++++++++++++++++++
frontend/lib/dashboard-types.ts | 3 +++
4 files changed, 43 insertions(+), 6 deletions(-)
diff --git a/frontend/components/dashboard/FutureForecastModal.tsx b/frontend/components/dashboard/FutureForecastModal.tsx
index 8cbdf4c0..7d145fbe 100644
--- a/frontend/components/dashboard/FutureForecastModal.tsx
+++ b/frontend/components/dashboard/FutureForecastModal.tsx
@@ -287,12 +287,18 @@ function getTrendMetricVisual(metric: {
return null;
}
-function DailyTemperatureChart({ dateStr }: { dateStr: string }) {
+function DailyTemperatureChart({
+ dateStr,
+ forceToday = false,
+}: {
+ dateStr: string;
+ forceToday?: boolean;
+}) {
const store = useDashboardStore();
const { locale, t } = useI18n();
const detail = store.selectedDetail;
const view = detail ? getFutureModalView(detail, dateStr, locale) : null;
- const isToday = detail ? dateStr === detail.local_date : false;
+ const isToday = forceToday || (detail ? dateStr === detail.local_date : false);
const todayChartData = useMemo(
() => (detail && isToday ? getTemperatureChartData(detail, locale) : null),
[detail, isToday, locale],
@@ -711,7 +717,9 @@ export function FutureForecastModal() {
};
}, [dateStr, detail]);
- const isToday = dateStr === detail.local_date;
+ const isToday =
+ store.forecastModalMode === "today" ||
+ (store.forecastModalMode == null && dateStr === detail.local_date);
const detailDepth = detail.detail_depth || "full";
const isFullDetailReady = detailDepth === "full";
const isStructureSyncing = store.loadingState.futureDeep || !isFullDetailReady;
@@ -1713,7 +1721,7 @@ export function FutureForecastModal() {
: "今日气温路径(锚点观测 + 模型)"}
-
+
{locale === "en-US" ? "Base" : "基准"} · {baseCaseBucket || "--"}
{locale === "en-US" ? "Upside" : "上修"} · {intradayMeteorology.upside_bucket || "--"}
@@ -1891,7 +1899,7 @@ export function FutureForecastModal() {
{t("future.targetTempTrend")}
-
+
diff --git a/frontend/components/dashboard/PanelSections.tsx b/frontend/components/dashboard/PanelSections.tsx
index 825c7166..ade0f3f2 100644
--- a/frontend/components/dashboard/PanelSections.tsx
+++ b/frontend/components/dashboard/PanelSections.tsx
@@ -1020,7 +1020,11 @@ export function ForecastTable() {
daily.map((day, index) => {
const isToday = day.date === data.local_date || index === 0;
const isSelected =
- store.futureModalDate === day.date ||
+ (isToday &&
+ store.forecastModalMode === "today" &&
+ Boolean(store.futureModalDate)) ||
+ (store.forecastModalMode !== "today" &&
+ store.futureModalDate === day.date) ||
store.selectedForecastDate === day.date;
return (