Move pace math out of the dashboard utility bulk

Pace-adjusted high calculations were embedded in dashboard-utils alongside chart, profile, and modal helpers. This moves the pure pace model and reusable HM time helpers into focused modules while keeping dashboard-utils re-export compatibility for older callers.

Constraint: Preserve existing pace wording, thresholds, and calculation output.

Rejected: Split all remaining dashboard-utils helpers at once | model/chart/modal helpers have wider call surfaces and should move in separate reversible passes.

Confidence: high

Scope-risk: narrow

Reversibility: clean

Tested: TypeScript diagnostics for pace-utils, time-utils, dashboard-utils, and FutureForecastModal

Tested: npm run build

Not-tested: Bundle analyzer size comparison.
This commit is contained in:
2569718930@qq.com
2026-04-28 11:45:34 +08:00
parent be41becb30
commit c476ad2123
8 changed files with 240 additions and 223 deletions
@@ -27,10 +27,10 @@ import {
getFutureModalView,
getModelView,
getProbabilityView,
getTodayPaceView,
getTemperatureChartData,
getWeatherSummary,
} from "@/lib/dashboard-utils";
import { getTodayPaceView } from "@/lib/pace-utils";
import { dashboardClient } from "@/lib/dashboard-client";
import {
normalizeObservationSourceCode,
@@ -11,8 +11,8 @@ import { getLocalizedCityName } from "@/lib/dashboard-home-copy";
import {
getModelView,
getProbabilityView,
getTodayPaceView,
} from "@/lib/dashboard-utils";
import { getTodayPaceView } from "@/lib/pace-utils";
import {
formatTemperatureValue,
normalizeTemperatureLabel,
@@ -1,5 +1,5 @@
import type { CityDetail, ScanOpportunityRow } from "@/lib/dashboard-types";
import { getTodayPaceView } from "@/lib/dashboard-utils";
import { getTodayPaceView } from "@/lib/pace-utils";
import { formatTemperatureValue } from "@/lib/temperature-utils";
import { getPeakWindowLabel } from "@/components/dashboard/scan-terminal/decision-utils";
@@ -21,7 +21,8 @@ import {
useCityMarketScan,
} from "@/components/dashboard/scan-terminal/use-ai-city-card-data";
import type { CityDetail, ScanOpportunityRow } from "@/lib/dashboard-types";
import { getModelView, getTodayPaceView } from "@/lib/dashboard-utils";
import { getModelView } from "@/lib/dashboard-utils";
import { getTodayPaceView } from "@/lib/pace-utils";
import { formatTemperatureValue } from "@/lib/temperature-utils";
function toFiniteDecisionNumber(value: unknown) {
@@ -1,5 +1,5 @@
import type { MarketScan, MarketTopBucket } from "@/lib/dashboard-types";
import { getTodayPaceView } from "@/lib/dashboard-utils";
import { getTodayPaceView } from "@/lib/pace-utils";
import {
formatTemperatureValue,
normalizeTemperatureLabel,