UX 审查修复:统一修正术语、图表"现在"标记、专业术语解释、异常行动建议
P0-1 术语统一: - WeatherDecisionBand 改用"上修/下修/维持"替代"偏高温/暂不追/等待确认" - 与 AI 后端提示词使用的术语体系一致 P0-9 图表"现在"标记: - chart-utils.ts 导出 currentIndex - AiCityTemperatureChart 在 currentIndex 处绘制竖线(蓝色虚线) P0-13 专业术语解释: - DataFreshnessBar 新增 labelTitle 属性(hover tooltip) - METAR → "机场气象观测报文" / "Meteorological Aerodrome Report" - HKO → "香港天文台官方实测" / "Hong Kong Observatory official readings" P0-16 异常行动建议: - primaryReason 追加行动指引(实测突破→建议关注偏高温区间等待确认 / 峰值已过→建议避免追高 / 观测过旧→建议等待新报文) P1-8 DEB 路径分段样式: - 过去部分实线(已确定),未来部分虚线(预测不确定) P1-11 HistoryChart 单位: - tooltip 使用 temp_symbol 替代硬编码 ° Tested: npx tsc --noEmit
This commit is contained in:
@@ -109,7 +109,6 @@ export function AiCityTemperatureChart({ detail }: { detail: CityDetail }) {
|
||||
>["datasets"] = [
|
||||
{
|
||||
borderColor: "rgba(100, 116, 139, 0.72)",
|
||||
borderDash: [6, 4],
|
||||
borderWidth: 1.6,
|
||||
data: chartData.datasets.debPast.map(
|
||||
(value, index) => value ?? chartData.datasets.debFuture[index],
|
||||
@@ -117,6 +116,10 @@ export function AiCityTemperatureChart({ detail }: { detail: CityDetail }) {
|
||||
fill: false,
|
||||
label: forecastLabel,
|
||||
pointRadius: 0,
|
||||
segment: {
|
||||
borderDash: (ctx: { p0DataIndex: number }) =>
|
||||
chartData.currentIndex != null && ctx.p0DataIndex < chartData.currentIndex ? [] : [6, 4],
|
||||
},
|
||||
spanGaps: true,
|
||||
tension: 0.28,
|
||||
},
|
||||
@@ -148,6 +151,23 @@ export function AiCityTemperatureChart({ detail }: { detail: CityDetail }) {
|
||||
showLine: false,
|
||||
});
|
||||
|
||||
const ci = chartData.currentIndex;
|
||||
if (ci != null && ci >= 0 && ci < (chartData.times?.length || 0)) {
|
||||
datasets.push({
|
||||
backgroundColor: "rgba(77, 163, 255, 0.5)",
|
||||
borderColor: "rgba(77, 163, 255, 0.5)",
|
||||
borderDash: [3, 4],
|
||||
borderWidth: 1.2,
|
||||
data: [
|
||||
{ x: ci, y: chartData.max },
|
||||
{ x: ci, y: chartData.min },
|
||||
],
|
||||
label: "Now",
|
||||
pointRadius: 0,
|
||||
showLine: true,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
data: {
|
||||
datasets,
|
||||
@@ -165,7 +185,7 @@ export function AiCityTemperatureChart({ detail }: { detail: CityDetail }) {
|
||||
borderColor: "rgba(77, 163, 255, 0.38)",
|
||||
borderWidth: 1,
|
||||
},
|
||||
},
|
||||
} as Record<string, unknown>,
|
||||
responsive: true,
|
||||
scales: {
|
||||
x: {
|
||||
|
||||
Reference in New Issue
Block a user