From 7fe89e097b235838b1dd4d199b21795b85a6a850 Mon Sep 17 00:00:00 2001
From: "2569718930@qq.com" <2569718930@qq.com>
Date: Sat, 21 Mar 2026 18:17:03 +0800
Subject: [PATCH] Clarify sidebar current and peak temperature labels
---
frontend/components/dashboard/CitySidebar.tsx | 27 +++++++++++++------
frontend/lib/i18n.ts | 4 +++
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/frontend/components/dashboard/CitySidebar.tsx b/frontend/components/dashboard/CitySidebar.tsx
index 4450251e..cfffb03b 100644
--- a/frontend/components/dashboard/CitySidebar.tsx
+++ b/frontend/components/dashboard/CitySidebar.tsx
@@ -165,6 +165,23 @@ export function CitySidebar() {
const summary = store.citySummariesByName[city.name];
const snapshot = detail || summary;
const isActive = store.selectedCity === city.name;
+ const tempSymbol = snapshot?.temp_symbol || "°C";
+ const currentTempText =
+ snapshot?.current?.temp != null
+ ? t("sidebar.currentTemp", {
+ temp: `${snapshot.current.temp}${tempSymbol}`,
+ })
+ : t("common.na");
+ const peakTempText =
+ detail?.current?.max_so_far != null &&
+ detail.current.max_temp_time
+ ? t("sidebar.peakTempAt", {
+ temp: `${detail.current.max_so_far}${tempSymbol}`,
+ time: detail.current.max_temp_time,
+ })
+ : detail?.current?.max_temp_time
+ ? t("sidebar.peakAt", { time: detail.current.max_temp_time })
+ : "";
return (
);
diff --git a/frontend/lib/i18n.ts b/frontend/lib/i18n.ts
index 0dc97b06..f6b20eff 100644
--- a/frontend/lib/i18n.ts
+++ b/frontend/lib/i18n.ts
@@ -21,6 +21,8 @@ const MESSAGES: Record> = {
"header.langEn": "EN",
"sidebar.title": "监控城市",
+ "sidebar.currentTemp": "当前 {temp}",
+ "sidebar.peakTempAt": "峰值 {temp} @ {time}",
"sidebar.peakAt": "峰值 @ {time}",
"sidebar.group.high": "高风险",
"sidebar.group.medium": "中风险",
@@ -180,6 +182,8 @@ const MESSAGES: Record> = {
"header.langEn": "EN",
"sidebar.title": "Monitored Cities",
+ "sidebar.currentTemp": "Current {temp}",
+ "sidebar.peakTempAt": "Peak {temp} @ {time}",
"sidebar.peakAt": "Peak @ {time}",
"sidebar.group.high": "High Risk",
"sidebar.group.medium": "Medium Risk",