You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: honor user display preferences across all UI surfaces
Phase A–H sweep: plumb user display preferences (units, currency,
decimal precision, gas unit, range type, locale, time/date format)
end-to-end through the entire frontend so user-facing values respect
Settings consistently. Telemetry ingestion remains unchanged — this
only affects how stored SI values are rendered.
Highlights:
- New/extended hooks: useFormatting (locale-aware currency + energy
cost), useUnits (distance/speed/temperature/pressure/energy/power/
duration), useDateFormat, usePreferredRange, usePressureFormat.
- New reusable Range format component and preferredRange helper.
- FormatterPrefsBridge syncs settings.decimal_precision into
fmtNumber/fmtInt/fmtPercent/fmtCompact/fmtWithUnit globals.
- chargingAggregation accepts currencySymbol; messages use fmtNumber.
- Removed Google Maps API Key field from Settings UI.
- Migrated 100+ user-visible surfaces to honor prefs: charging
cost/cards/charts/maps, dashboard widgets, year-review slides,
weekly digest, fleet/lifetime/timeline/true-cost analytics,
battery cells/projected range/sleep/energy, climate, maintenance,
drive-detail/trip-planner/shared-drive, system status (uptime,
SLO, Tesla API usage, scheduled maintenance, telemetry pipeline),
alert/notification surfaces, signal viewer, vehicle hero/detail.
- toFixed sweep on production numeric displays → fmtNumber/fmtPercent.
useFormatting.formatCurrency(amount) and formatEnergyCost(kwh) now
default to settings.decimal_precision instead of hardcoded 2. Callers
passing an explicit decimals value are unaffected. Several i18n keys
also changed to drop the hardcoded "$" prefix (currency symbol now
embedded in the substituted value via formatCurrency) — affected keys
live in SystemStatusPage templates and require translation re-keying
for non-English locales.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
description: `You've saved approximately $${fmtNumber(savings,0)} vs. gasoline based on ${fmtNumber(energy.total_energy_used_kwh,0)} kWh consumed over ${fmtNumber(energy.total_distance_km,0)} km. That's also ${fmtNumber(energy.co2_saved_kg,0)} kg of CO₂ saved!`,
286
+
description: `You've saved approximately ${formatCurrency(savings,0)} vs. gasoline based on ${fmtNumber(energy.total_energy_used_kwh,0)} kWh consumed over ${fmtNumber(energy.total_distance_km,0)} km. That's also ${fmtNumber(energy.co2_saved_kg,0)} kg of CO₂ saved!`,
286
287
trend: 'up',
287
288
trendGood: true,
288
289
severity: 'success',
@@ -319,11 +320,12 @@ function analyzeRangeOptimization(energy: EnergyStats, battery?: BatteryReport):
319
320
// ─── Main component ───────────────────────────────────────────
320
321
321
322
exportfunctionInsightsEngine({ data }: {data: InsightData}){
0 commit comments