Move weather summaries out of the dashboard utility bulk

Weather labels, METAR translation, risk badges, and hero meta chips were still embedded in dashboard-utils even though panel, modal, and detail views use them as focused presentation helpers. This moves them into weather-summary-utils while keeping dashboard-utils re-export compatibility.

Constraint: Preserve existing weather/METAR/risk/hero meta wording.

Rejected: Move airport narrative in the same pass | it has broader AI narrative coupling and should be separated independently.

Confidence: high

Scope-risk: narrow

Reversibility: clean

Tested: TypeScript diagnostics for weather-summary-utils, dashboard-utils, PanelSections, DetailPanel, and FutureForecastModal

Tested: npm run build

Not-tested: Visual snapshot of every weather icon/label combination.
This commit is contained in:
2569718930@qq.com
2026-04-28 12:17:42 +08:00
parent 5dc39b1573
commit a77d613c2b
5 changed files with 208 additions and 193 deletions
@@ -13,11 +13,9 @@ import { CityDetail } from "@/lib/dashboard-types";
import { trackAppEvent } from "@/lib/app-analytics";
import { getTodayPolymarketUrl } from "@/lib/polymarket-market-links";
import { getTemperatureChartData } from "@/lib/chart-utils";
import {
getCityProfileStats,
getRiskBadgeLabel,
} from "@/lib/dashboard-utils";
import { getCityProfileStats } from "@/lib/dashboard-utils";
import { normalizeObservationSourceLabel } from "@/lib/source-labels";
import { getRiskBadgeLabel } from "@/lib/weather-summary-utils";
function DetailMiniTemperatureChart({ detail }: { detail: CityDetail }) {
const { locale, t } = useI18n();
@@ -26,11 +26,11 @@ import {
import { getTemperatureChartData } from "@/lib/chart-utils";
import {
getFutureModalView,
getWeatherSummary,
} from "@/lib/dashboard-utils";
import { getModelView, getProbabilityView } from "@/lib/model-utils";
import { getTodayPaceView } from "@/lib/pace-utils";
import { dashboardClient } from "@/lib/dashboard-client";
import { getWeatherSummary } from "@/lib/weather-summary-utils";
import {
normalizeObservationSourceCode,
normalizeObservationSourceLabel,
@@ -13,16 +13,16 @@ import {
ProbabilityBucket,
} from "@/lib/dashboard-types";
import { getTemperatureChartData } from "@/lib/chart-utils";
import {
getHeroMetaItems,
getRiskBadgeLabel,
getWeatherSummary,
} from "@/lib/dashboard-utils";
import { getModelView, getProbabilityView } from "@/lib/model-utils";
import {
normalizeObservationSourceCode,
normalizeObservationSourceLabel,
} from "@/lib/source-labels";
import {
getHeroMetaItems,
getRiskBadgeLabel,
getWeatherSummary,
} from "@/lib/weather-summary-utils";
function EmptyState({ text }: { text: string }) {
return (