From 76d5a0abe828482097bc4d5a8dfcfb90cbe1d12a Mon Sep 17 00:00:00 2001
From: "2569718930@qq.com" <2569718930@qq.com>
Date: Wed, 20 May 2026 07:55:47 +0800
Subject: [PATCH] refactor: remove redundant telegram pricing, align daily
forecast date, and hide sunrise/sunset from UI
---
frontend/components/account/AccountCenter.tsx | 17 --------
.../dashboard/FutureForecastTodayCards.tsx | 36 -----------------
.../dashboard/FutureForecastTodayLayout.tsx | 3 --
web/analysis_service.py | 40 ++++++++++++++++---
4 files changed, 34 insertions(+), 62 deletions(-)
diff --git a/frontend/components/account/AccountCenter.tsx b/frontend/components/account/AccountCenter.tsx
index e264ce04..dbb7533e 100644
--- a/frontend/components/account/AccountCenter.tsx
+++ b/frontend/components/account/AccountCenter.tsx
@@ -3015,23 +3015,6 @@ export function AccountCenter() {
{copy.telegramHint}
- {backend?.telegram_pricing?.is_group_member ? (
-
-
- Telegram 群成员价格
-
-
- 已验证群成员身份,当前会员价{" "}
- {backend.telegram_pricing.amount_usdc ?? "5"}U。
-
-
-
- 当前价格: {backend.telegram_pricing.amount_usdc ?? "5"}U
- · 群成员
-
-
-
- ) : null}
{TELEGRAM_TOPICS_GROUP_URL &&
diff --git a/frontend/components/dashboard/FutureForecastTodayCards.tsx b/frontend/components/dashboard/FutureForecastTodayCards.tsx
index f1824f3a..0b800569 100644
--- a/frontend/components/dashboard/FutureForecastTodayCards.tsx
+++ b/frontend/components/dashboard/FutureForecastTodayCards.tsx
@@ -29,9 +29,6 @@ export function FutureAnchorStatusCard({
currentTempText,
weatherSummary,
obsTime,
- daylightProgress,
- sunrise,
- sunset,
topObservedTemp,
tempSymbol,
gapToBaseBucket,
@@ -41,9 +38,6 @@ export function FutureAnchorStatusCard({
currentTempText: string;
weatherSummary: WeatherSummaryView;
obsTime?: string | null;
- daylightProgress: DaylightProgressView | null;
- sunrise?: string | null;
- sunset?: string | null;
topObservedTemp: number | string | null | undefined;
tempSymbol: string;
gapToBaseBucket: number | null;
@@ -74,28 +68,6 @@ export function FutureAnchorStatusCard({
@{obsTime || "--"}
- {daylightProgress ? (
-
-
- {locale === "en-US" ? "Solar Window" : "昼夜进度"}
-
- {daylightProgress.phase} {Math.round(daylightProgress.percent)}%
-
-
-
-
- {sunrise || "--"}
- {sunset || "--"}
-
-
- ) : null}
-
-
);
diff --git a/frontend/components/dashboard/FutureForecastTodayLayout.tsx b/frontend/components/dashboard/FutureForecastTodayLayout.tsx
index 1f76f9b0..4d4a4a9a 100644
--- a/frontend/components/dashboard/FutureForecastTodayLayout.tsx
+++ b/frontend/components/dashboard/FutureForecastTodayLayout.tsx
@@ -94,9 +94,6 @@ export function FutureForecastTodayLayout(props: FutureForecastTodayLayoutProps)
currentTempText={currentTempText}
weatherSummary={weatherSummary}
obsTime={detail.current?.obs_time}
- daylightProgress={daylightProgress}
- sunrise={detail.forecast?.sunrise}
- sunset={detail.forecast?.sunset}
topObservedTemp={topObservedTemp}
tempSymbol={detail.temp_symbol}
gapToBaseBucket={gapToBaseBucket}
diff --git a/web/analysis_service.py b/web/analysis_service.py
index 427ae0ce..ad099ea5 100644
--- a/web/analysis_service.py
+++ b/web/analysis_service.py
@@ -1239,11 +1239,26 @@ def _analyze(
# ── 3. Daily forecast ──
daily = om.get("daily", {})
- dates = daily.get("time", [])[:5]
- maxtemps = daily.get("temperature_2m_max", [])[:5]
- sunrises = daily.get("sunrise", [])
- sunsets = daily.get("sunset", [])
- sunshine = daily.get("sunshine_duration", [])
+ all_dates = daily.get("time", [])
+ all_maxtemps = daily.get("temperature_2m_max", [])
+ all_sunrises = daily.get("sunrise", [])
+ all_sunsets = daily.get("sunset", [])
+ all_sunshine = daily.get("sunshine_duration", [])
+
+ start_idx = 0
+ if local_date_str in all_dates:
+ start_idx = all_dates.index(local_date_str)
+ else:
+ for idx, d in enumerate(all_dates):
+ if d >= local_date_str:
+ start_idx = idx
+ break
+
+ dates = all_dates[start_idx : start_idx + 5]
+ maxtemps = all_maxtemps[start_idx : start_idx + 5]
+ sunrises = all_sunrises[start_idx : start_idx + 5]
+ sunsets = all_sunsets[start_idx : start_idx + 5]
+ sunshine = all_sunshine[start_idx : start_idx + 5]
om_today = _sf(maxtemps[0]) if maxtemps else None
forecast_daily = _dedupe_forecast_daily(
@@ -2067,7 +2082,20 @@ def _analyze_summary(city: str, force_refresh: bool = False) -> Dict[str, Any]:
om_daily = (open_meteo.get("daily") or {}) if isinstance(open_meteo, dict) else {}
om_hourly = (open_meteo.get("hourly") or {}) if isinstance(open_meteo, dict) else {}
- maxtemps = om_daily.get("temperature_2m_max", [])[:5]
+
+ all_dates = om_daily.get("time", [])
+ all_maxtemps = om_daily.get("temperature_2m_max", [])
+
+ start_idx = 0
+ if local_date_str in all_dates:
+ start_idx = all_dates.index(local_date_str)
+ else:
+ for idx, d in enumerate(all_dates):
+ if d >= local_date_str:
+ start_idx = idx
+ break
+
+ maxtemps = all_maxtemps[start_idx : start_idx + 5]
om_today = _sf(maxtemps[0]) if maxtemps else None
nws_high = _sf((nws or {}).get("today_high")) if isinstance(nws, dict) else None
mgm_high = _sf((mgm or {}).get("today_high")) if isinstance(mgm, dict) else None