Skip to content

Muse spark - #109

Merged
atulmgupta merged 68 commits into
mainfrom
muse-spark
Sep 15, 2026
Merged

atulmgupta merged 68 commits into
mainfrom
muse-spark

Conversation

@atulmgupta

Copy link
Copy Markdown
Contributor

Description

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would break existing functionality)
  • Documentation update
  • Infrastructure / CI change

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing tests pass locally
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Screenshots (if applicable)

atulmgupta and others added 30 commits September 7, 2026 11:10
Two related charging-accuracy fixes:

1. Charge energy delta baselines now use State() strictly before StartedAt instead of at StartedAt, since Fleet Telemetry can emit the session-start batch after energy has already begun accumulating, causing undercounted energy in both the live handler and the completed-session tracker.

2. New Tesla Supercharger invoice overlay: ChargingHandler.Get resolves the vehicle's VIN and matches it against tesla_charging_history via a new FindBestMatch repo method (closest charge_start_datetime within a 2h window). When a match is found, billed energy/cost/currency/rate are added to the response and preferred for display on the frontend KPI tiles, with vehicle-measured energy shown as a secondary subtitle.
Treat spurious trip-meter resets and implausible counter jumps as discontinuities instead of driven distance. Adds reset/restore cursor logic and tests so include_fields zero snap-backs do not inflate FSD or driving aggregates.
Adds a live Grok powertrain read to Driving Dynamics using motor and chassis signals, with interpretation logic and tests. Also adds shared client-side pagination for FSD insight lists and DataTable-backed FSD tables.
Adds honesty-focused UI across the fleet dashboard, status bar, charging, battery, driving, and FSD views. Surfaces Supercharger bill site/fee metadata, preserves signal ingest timestamps for Tesla physics clocks, paginates physics evidence instead of truncating it, and fixes nav highlighting to prefer the most specific active route.
Add trip selection and date-scoped motor history, preserve active drives, and evenly sample backend history responses across the selected window.
Preserve and backfill charge coordinates without creating geofences from stale GPS, use Tesla billed energy for tariff pricing, and resolve date windows in the vehicle timezone.
Expand the drive detail FSD insights range to look around 24 hours so sparse counter bookends are included, preventing unknown/blank attribution for valid deltas. Adds backend and frontend regression coverage for the wider range behavior.
Adds drive_id support for FSD insights with a 7-day bookend lookup and focused attribution, while filtering negligible fidget drives so they do not steal sparse counter deltas. Updates drive detail and list UI to use the drive-scoped hook and omit unknown FSD badges.
Wire always-on charge autopilot, shared-charger queue planning, OCPP charge
points, Tesla bill variance, session share reports, TCO fixed ledger, and
related warranty, silence, and trip copilot surfaces.

Register new i18n namespaces (autopilot, chargeQueue, ocpp) so the strict
namespace audit and Docker web build pass. Fix TypeScript i18n count types,
geofence hook typing, and AutomationFull.conflicts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep ChargingDetailPage share-session UI from muse-spark and billed-energy
display from main (#104).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add per-vehicle autopilot profiles, TOU-based charge previews, health guardrails, and savings tracking. Integrate the configuration and preview panel into Smart Charge with API and UI tests.
Add next-charge recommendations comparing home TOU costs with Supercharger quotes, surfaced on dashboards and vehicle details. Expand automation, routine, and alert template catalogs with category filtering, localization, and tests.
Adds ecosystem automation presets and routine templates covering more Tesla commands, locations, charging, climate, media, and security scenarios. Updates catalogue tests and alert rule template coverage thresholds for the expanded preset set.
Watches Open-Meteo forecasts at each armed vehicle's home coords and
pre-charges before storms: hourly evaluator raises the charge limit on
fresh warnings when SOC is below target. Includes status/config/events
API, StormGuardPanel on Emergency Resilience, and backend+UI tests.
Polls a per-vehicle ICS subscription, finds the next offsite event in
the lead window, and preconditions once per event (5-minute evaluator).
Includes next/config/now/runs API, ComfortPanel on Automations, offline
refusal for the actuation endpoint, and backend+UI tests.
BuildClaimDraft assembles a ready-to-paste ticket from the owner issue,
live warranty countdown, matched TSBs, ranked symptoms, and evidence.
New claim-draft endpoint, ClaimDraftPanel on Service Intelligence, and
backend+UI tests.
Flags recent drives that fit no named profile and sit far from their
cluster centroid (median-adaptive score, deterministic pure function).
New GET /driver-attribution/ghost-drives endpoint plus a GhostDrivesPanel
on the Driver Attribution page with alert banner, score table, and
one-click labelling that re-anchors the cluster.
Predicts queue waits per site and arrival time: hour-of-week demand
from tesla_charging_sessions feeds Little's-law load plus an Erlang-C
queue model (stalls estimated from peak overlap, documented lower
bound). Read-only GET /waitoracle/sites + /forecast; WaitOraclePanel
on the fleet sessions page with site/arrival pickers, verdict hero,
best-hour suggestion, and the full-day wait curve.
Allow one Tesla 1-mile wire quantum above the physical travel threshold so valid 10-second counter samples are retained, while still rejecting implausible jumps. Add unit and drive analytics regression coverage.
Route new panels through Icons, SI seconds for wait forecasts, queryPolicy/scopedPath on hooks, ICS host allowlist, catalog i18n keys, and useDataState fatalError surfaces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Slice 1 of Journey Autopilot: persistent journey_sessions
(planned/active/paused/completed/aborted, one active per vehicle,
race-safe conditional transitions) plus append-only versioned plans
for future replan diffs. New /journeys page with session manager:
plan form, status filter, lifecycle actions driven by server
next_statuses, plan history.

Also regenerates routetemplates_gen.go, absorbing 19 previously
unregenerated routes so the freshness gate passes.
Refresh the VitePress theme, navigation, landing pages, and onboarding. Add generated screen catalogues, Markdown page tools, and new homepage visuals.
Cap journey list limits at 100 with safe defaults and tests. Localize status labels and inherit theme-aware icon colors.
Add English translations for planned, active, paused, completed, and aborted journey statuses.
Update localized JourneyPanel assertions and align journey namespace ordering in English manifests.
Keep localized journey status tests; take main's trips/journey i18n
manifest order.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract weekly FSD digest logic from the API package, remove unused helpers, document migrations 235–242, clean up translations and lint findings, and refresh gRPC and telemetry dependencies.
Adds package documentation and layer annotations, upgrades gRPC to v1.83.2, and removes an unused React test import.
EmptyState CTA audit now passes with documented no-action comments.
Gitleaks policy self-test writes fixtures under the workspace and scans
directories so Docker bind-mounts work on self-hosted runners.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move fleet state handler into handler/v1/fleetstate so internal/handler/v1
stays under the max_files ratchet. Waive SharedSessionReport legend toggle.
Install Node before CodeQL JS extraction. Refresh Windows visual baselines
from the failing Playwright actuals.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
atulmgupta and others added 15 commits September 13, 2026 19:47
Slice 6: GET arrival derives pace from the two newest fixes (odometer preferred, GPS-jump guarded), projects ETA only while moving, and grades destination energy with a top-up shortfall that restores the buffer. UI gains ArrivalPanel on live sessions; check-ins invalidate arrival.
Slice 7: GET report computes the debrief card from the trail (odometer-span distance, started/ended duration, detour ratio vs the straight line, replan counts, checklist recap). UI gains ReportPanel on finished sessions; check-ins and replans invalidate the card.
Slice 8: GET nudge folds the calm-hour ranking and action-level checklist blockers into one verdict (leave_now/wait/delay/unknown) for planned sessions. UI gains NudgePanel; checklist refreshes invalidate the nudge.
Slice 9: RouteLegs reads odometer-backed detour legs from completed trips on a route (both directions); RouteFactor averages 2+ trips into a 1.0-2.0 multiplier that scales arrival ETA and charge advice and shows on the report card. No migration: derived from sessions plus checkpoints.
Slice 10: taps while offline (or sends failing without a status) queue in localStorage and replay in order with original instants on reconnect; the server dedupes idempotently. useCheckIn takes an optional recorded_at and stays silent on network failures by contract; LiveTripPanel shows the queued count.
Prune unused live-trip, replanning, arrival, report, and toast translations. Standardize stop-score cells on shared typography and pass route-trip counts directly to interpolation.
Rename scored-stop unit_price JSON and chargeNeed UI state so the
SI-canonical gate stops treating new kWh suffixes as legacy units.
Register 000243/000244 in the ops migration manifest.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Check-in, checklist run, and site-sync are already on the panels;
the empty copy is informational.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wire EmptyState actions for checklist run, live check-in, charging
history, and plan-journey instead of audit exemption comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Vendor the latest Fleet Telemetry fields, generate metadata and routing, normalize fixed kWh and mph values to SI, and surface new vehicle, security, navigation, and software-update signals in the live UI.
Copilot AI lite review requested due to automatic review settings September 15, 2026 01:08
SI gate was flagging Tesla-owned Field identifiers such as
NominalFullPackEnergyKwh. Codec coverage used -race on arc-runner
which has no CGO/gcc.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the ci label Sep 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved protobuf compatibility, production UI wiring, localization, normalization coverage, and CI gate issues remain.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Tesla Fleet Telemetry fields 260–269 across schema generation, normalization, routing, and frontend live telemetry.

Changes:

  • Updates the vendored Tesla schema, metadata, provenance, and routing.
  • Adds kWh and mph SI conversions with tests.
  • Extends frontend signal parsing and telemetry panels.
  • Updates CI coverage and SI validation gates.
File summaries
File Change / final review note
web/src/lib/signalCatalog.ts Adds frontend signal metadata.
web/src/hooks/useVehicleLive.ts Parses new signals. Moderate (2 votes): defaults erase missing-signal presence. Moderate (1 vote): add SSE and snapshot fixtures for new fields.
web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.tsx Adds telemetry rows. Moderate (2 votes): format GPS accuracy through useUnits. Moderate (3 votes): add missing English catalog entries. Moderate (1 vote): component is not wired into the production detail page.
web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.test.tsx Adds label coverage. Moderate (1 vote): add focused assertions for explicit and missing values.
web/src/features/vehicles/components/telemetry-panels/SecurityPanel.tsx Adds remote-start status. Nit (1 vote): add the missing localization key and regenerate the catalog.
web/src/features/vehicles/components/telemetry-panels/SecurityPanel.test.tsx Tests remote-start status.
web/src/features/vehicles/components/telemetry-panels/LiveTelemetryPanels.tsx Composes new telemetry panels. Moderate (2 votes): this composition is not used by the production detail page.
internal/tesla/units/units.go Applies mph conversion.
internal/tesla/units/units_test.go Tests conversions. Moderate (1 vote): add pipeline-level coverage for new fixed-wire fields.
internal/tesla/units/conversions.go Defines fixed conversions.
internal/tesla/router/routing.yaml Routes new signals.
internal/tesla/protomodel/signal_metadata_gen.go Adds generated metadata. Critical (1 vote): update the runtime protobuf dependency so fields 260–269 decode and route correctly.
internal/tesla/protomodel/coverage_test.go Pins metadata coverage.
internal/tesla/normalize/normalize.go Adds fixed-wire normalization. Moderate (1 vote): add end-to-end cases for both kWh and mph fields.
cmd/protogen-tesla/emit.go Classifies new fields.
api/proto/tesla/VERSION Updates the upstream revision.
api/proto/tesla/vehicle_data.proto Adds fields 260–269.
api/proto/tesla/SOURCE.md Records schema provenance. Nit (1 vote): distinguish the 2026-08-28 commit date from the 2026-09-14 fetch date.
api/proto/tesla/CHECKSUM Updates the schema checksum.
.github/workflows/codec-coverage-gate.yml Adjusts coverage runner selection. Moderate (2 votes): the arc-runner manual default cannot execute go test -race without GCC.
.github/scripts/si_canonical_gate.py Adds the Tesla proto allowlist. Moderate (2 votes): only exempt the exact approved token so remaining banned identifiers are still checked.
Review details

Files not reviewed (1)

  • internal/tesla/protomodel/signal_metadata_gen.go: Generated file

Suppressed comments (9)

api/proto/tesla/SOURCE.md:22

  • The provenance table labels 2026-09-14 as the upstream commit date, but the pinned GitHub commit 8fbaa100bd365936dab6ecbf0e2d7070c4d765cb has an author/commit date of 2026-08-28; 2026-09-14 is the fetch date. Keep those dates accurate so the vendored schema's provenance is not misleading.
| Upstream commit date | 2026-09-14 |

internal/tesla/normalize/normalize.go:153

  • The new fixed-wire branch is not covered end-to-end for the fields it adds: TestPipeline_FixedChargingKiloUnits still enumerates only the four existing AC/DC fields, and there is no pipeline case for either mph field. The unit-level tests prove ToSI, but they would not catch a regression in the new toSI/unit-history bypass; add pipeline cases for the two new kWh fields and both mph fields.
	if units.IsFixedMileDistanceField(atomic.Field) ||
		units.IsFixedKiloToBaseField(atomic.Field) ||
		units.IsFixedMphSpeedField(atomic.Field) {

internal/tesla/units/units_test.go:80

  • These cases only verify units.ToSI; the normalize layer separately decides whether a field bypasses unit history. The existing pipeline-level fixed-wire test covers only AC/DC fields, so it would not catch either new kWh field or the new mph fields being omitted from normalize.toSI's fixed-wire condition and subsequently dropped when no unit-history row exists. Add the new fields to the pipeline-level table and assert that no history lookup occurs.
		{name: "LifetimeEnergyChargedKwh/kWh_to_Wh", field: "LifetimeEnergyChargedKwh", raw: 12.5, active: "", want: 12500, eps: epsTight},
		{name: "NominalFullPackEnergyKwh/kWh_to_Wh", field: "NominalFullPackEnergyKwh", raw: 100, active: ActiveUnitMiles, want: 100000, eps: epsTight},
		{name: "MaxSpeedToReachDestinationMph/mph_to_mps", field: "MaxSpeedToReachDestinationMph", raw: 65, active: "", want: 29.0576, eps: epsLoose},
		{name: "SemiCruiseSpeedLimitMph/mph_to_mps", field: "SemiCruiseSpeedLimitMph", raw: 55, active: "", want: 24.5872, eps: epsLoose},

web/src/features/vehicles/components/telemetry-panels/SecurityPanel.tsx:171

  • telemetry.remoteStartActive is also not defined in the English source catalog or generated telemetry locale, so this newly added label can never resolve through the normal i18n catalog. Add the key to web/src/i18n/en.json and regenerate the split catalog.
              <KeyRound className="h-3 w-3" aria-hidden="true" /> {t('telemetry.remoteStartActive', 'Remote Start Active')}

web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.test.tsx:81

  • This only adds the new labels to the broad presence check; it does not assert the new value branches (installing/available/current, remote-start active/inactive, GPS/grade values, or destination-speed formatting). A regression such as the false/zero defaults rendering Current/Off would remain green. Add focused assertions for explicit values and missing signals.
  'Software Update',
  'Remote Start Active',
  'GPS Accuracy',
  'Grade',
  'Max speed to destination',

web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.tsx:188

  • When neither update signal is present, this ternary falls through to updateCurrent, so an empty live signal bag (and the useVehicleLive zero/false defaults) is displayed as a confirmed current software version. Check for nullish presence of both signals first and render an unknown placeholder unless at least one status was actually received.
            live.swUpdateInProgress
              ? t('telemetry.updateInstalling', 'Installing')
              : live.swUpdateAvailable
                ? t('telemetry.updateAvailable', 'Available')
                : t('telemetry.updateCurrent', 'Current')

web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.tsx:198

  • undefined is treated as false here, so when RemoteStartActive has never been reported the panel says Off rather than unknown. Preserve the tri-state behavior used by SecurityPanel and show an em dash unless the signal is present.
          label={t('telemetry.remoteStartActive', 'Remote Start Active')}
          value={live.remoteStartActive ? t('common.active', 'Active') : offLabel}
          active={Boolean(live.remoteStartActive)}
          activeClass="text-amber-400"

web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.tsx:184

  • These new rows are only rendered by LiveTelemetryPanels, but that composition has no production caller: VehicleDetailPage renders the separate vehicle-detail/* sections instead, and the remaining matches are re-exports/tests. Consequently the new software-update, remote-start, GPS, grade, and destination-speed UI is not visible on the vehicle detail page. Wire this composition into production or add the rows to the components that the page actually renders.
        <StateRow
          icon={Settings}
          label={t('telemetry.softwareUpdateAvailable', 'Software Update')}
          value={
            live.swUpdateInProgress

web/src/hooks/useVehicleLive.ts:409

  • The hook tests cover both SSE parsing and initial snapshot hydration, but none of the newly added signal keys are exercised. A typo in any of these mappings or a boolean/number conversion regression would therefore leave the state at its defaults while the suite still passes. Add fixtures that assert the new fields through both update paths, including false and zero values.
  if (raw['GpsAccuracyMeters'] != null) s.gpsAccuracyM = n('GpsAccuracyMeters')
  if (raw['GradeEstimatePercent'] != null) s.gradeEstimatePct = n('GradeEstimatePercent')
  if (raw['MaxSpeedToReachDestinationMph'] != null) s.maxSpeedToDestinationMps = n('MaxSpeedToReachDestinationMph')
  if (raw['SemiCruiseSpeedLimitMph'] != null) s.semiCruiseSpeedLimitMps = n('SemiCruiseSpeedLimitMph')
  if (raw['LifetimeEnergyChargedKwh'] != null) s.lifetimeEnergyChargedWh = n('LifetimeEnergyChargedKwh')
  • Files reviewed: 20/21 changed files
  • Comments generated: 7
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +273 to +277
Field_GpsAccuracyMeters Field = 260
Field_LifetimeEnergyChargedKwh Field = 261
Field_BrickSocMinPercent Field = 262
Field_NominalFullPackEnergyKwh Field = 263
Field_GradeEstimatePercent Field = 264
Comment on lines +90 to +91
if any(name in added for name in TESLA_PROTO_FIELD_ALLOWLIST):
continue
runs-on: ${{ inputs.runner || 'arc-runner' }}
# ubuntu-latest: `go test -race` needs CGO/gcc. arc-runner does not ship gcc
# (same pin as CI "Backend (lint + test + build)").
runs-on: ${{ github.event_name == 'workflow_dispatch' && inputs.runner || 'ubuntu-latest' }}
Comment on lines +80 to +84
<SecurityPanel
securityData={securityData}
remoteStartEnabled={remoteStartEnabled}
remoteStartActive={remoteStartActive}
/>
Comment on lines +182 to +188
label={t('telemetry.softwareUpdateAvailable', 'Software Update')}
value={
live.swUpdateInProgress
? t('telemetry.updateInstalling', 'Installing')
: live.swUpdateAvailable
? t('telemetry.updateAvailable', 'Available')
: t('telemetry.updateCurrent', 'Current')
<StateRow
icon={MapPin}
label={t('telemetry.gpsAccuracy', 'GPS Accuracy')}
value={typeof live.gpsAccuracyM === 'number' && Number.isFinite(live.gpsAccuracyM) ? `${live.gpsAccuracyM} m` : '—'}
vehicleName: '', carType: '', version: '', wheelType: '', exteriorColor: '',
trim: '', roofColor: '', efficiencyPackage: '', rearSeatHeaters: '', sunroofInstalled: '',
europeVehicle: false, rightHandDrive: false, remoteStartEnabled: false, offroadLightbar: false,
europeVehicle: false, rightHandDrive: false, remoteStartEnabled: false, remoteStartActive: false, offroadLightbar: false,

Copilot AI commented Sep 15, 2026

Copy link
Copy Markdown

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Verify TypeScript build

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 15, 2026 01:53

Copilot AI commented Sep 15, 2026

Copy link
Copy Markdown

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Verify TypeScript build

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical runtime-binding risk and multiple moderate correctness, UI, and CI issues remain.

Get a fresh assessment by requesting another Copilot review.

Review details

Files not reviewed (1)

  • internal/tesla/protomodel/signal_metadata_gen.go: Generated file

Suppressed comments (11)

Previously missed (1) — in code that hasn't changed since the last review.

web/src/hooks/useVehicleLive.ts:408

  • The hook has extensive parsing coverage, but no test exercises any of these newly added signal keys. A typo in one of the names or a numeric/boolean coercion regression would pass the suite; add a payload test covering the new numeric fields and both software/remote-start booleans.

.github/scripts/si_canonical_gate.py:91

  • This exemption skips the entire added line when it contains any allowlisted Tesla identifier. A future line such as LegacyEnergyKwh = "NominalFullPackEnergyKwh" would therefore bypass the banned-identifier check. Only skip when every banned match on the line is an allowlisted identifier, rather than using a line-wide substring test.
        if any(name in added for name in TESLA_PROTO_FIELD_ALLOWLIST):
            continue

.github/workflows/codec-coverage-gate.yml:51

  • The new runner expression still honors the workflow_dispatch input's default arc-runner (line 37). This job runs go test -race, and the comment above says that runner has no gcc, so a default manual dispatch will fail before the coverage tests run. Change the manual default to ubuntu-latest or otherwise prevent the unsupported runner from being selected.
    runs-on: ${{ github.event_name == 'workflow_dispatch' && inputs.runner || 'ubuntu-latest' }}

internal/tesla/normalize/normalize.go:153

  • The new IsFixedMphSpeedField path is not covered at the pipeline level. Existing normalize tests cover the fixed-mile and fixed-kilo families, but no case exercises MaxSpeedToReachDestinationMph or SemiCruiseSpeedLimitMph through toSI; a regression here could make these samples consult unit history or drop them even though the lower-level conversion test passes. Add cases asserting the m/s value and that histRepo.At is not called.
	if units.IsFixedMileDistanceField(atomic.Field) ||
		units.IsFixedKiloToBaseField(atomic.Field) ||
		units.IsFixedMphSpeedField(atomic.Field) {

web/src/features/vehicles/components/telemetry-panels/LiveTelemetryPanels.tsx:84

  • These new rows are only wired into LiveTelemetryPanels, but there is no production caller for that component; VehicleDetailPage renders SecuritySection and LiveStateIndicators instead. As a result, Remote Start Active and the new VehicleStatePanel fields will not appear in the shipped vehicle-detail UI. Wire the data into the actual page sections or mount this panel.
          <SecurityPanel
            securityData={securityData}
            remoteStartEnabled={remoteStartEnabled}
            remoteStartActive={remoteStartActive}
          />

web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.tsx:188

  • The new telemetry.* keys used here (softwareUpdateAvailable, updateInstalling, updateAvailable, updateCurrent, and the other new telemetry labels) are not present under the canonical telemetry object in web/src/i18n/en.json; only inline fallbacks exist. The repository defines en.json as the sole hand-edited catalog source (web/scripts/split-i18n-catalog.mjs:5-7) and verifies its generated namespaces during the Vite build (web/vite.config.ts:59-66), so add these keys to the source and regenerate the locale namespaces instead of silently falling back to English.
          label={t('telemetry.softwareUpdateAvailable', 'Software Update')}
          value={
            live.swUpdateInProgress
              ? t('telemetry.updateInstalling', 'Installing')
              : live.swUpdateAvailable
                ? t('telemetry.updateAvailable', 'Available')
                : t('telemetry.updateCurrent', 'Current')

web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.tsx:204

  • GpsAccuracyMeters is an SI distance, but this renders a hard-coded m suffix and bypasses the user's distance preference. useUnits() already exposes formatDistance, which converts SI meters and supplies the selected unit label; use that formatter here so km/mi settings are respected.
          label={t('telemetry.gpsAccuracy', 'GPS Accuracy')}
          value={typeof live.gpsAccuracyM === 'number' && Number.isFinite(live.gpsAccuracyM) ? `${live.gpsAccuracyM} m` : '—'}
        />

web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.tsx:204

  • useVehicleLive initializes gpsAccuracyM, gradeEstimatePct, and maxSpeedToDestinationMps to 0 in EMPTY_STATE, so these numeric checks render invented 0 m, 0%, and zero speed before the corresponding signals have ever arrived. Preserve signal presence/nullable values or otherwise distinguish an unknown value and render the existing em-dash instead.
          value={typeof live.gpsAccuracyM === 'number' && Number.isFinite(live.gpsAccuracyM) ? `${live.gpsAccuracyM} m` : '—'}
        />

web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.tsx:188

  • When live contains no software-update signals, both properties are absent and this falls through to updateCurrent. Missing telemetry is not evidence that the vehicle is current; render an unknown/em-dash state until at least one boolean has been observed, as the tri-state handling in SecurityPanel does for remote start.
            live.swUpdateInProgress
              ? t('telemetry.updateInstalling', 'Installing')
              : live.swUpdateAvailable
                ? t('telemetry.updateAvailable', 'Available')
                : t('telemetry.updateCurrent', 'Current')

web/src/features/vehicles/components/telemetry-panels/VehicleStatePanel.tsx:197

  • With no RemoteStartActive key in the live map, this renders Off, even though the signal is simply unknown. SecurityPanel already distinguishes null from false; apply the same presence check here so an absent telemetry value is not presented as an inactive remote start.
          value={live.remoteStartActive ? t('common.active', 'Active') : offLabel}
          active={Boolean(live.remoteStartActive)}

web/src/hooks/useVehicleLive.ts:218

  • These signals are only available from firmware 2026.32 (and SemiCruiseSpeedLimitMph is vehicle-specific), so older or unsupported vehicles legitimately omit them. Initializing the new fields to false/0 makes the UI report Current, Off, 0 m, 0%, or a zero speed before any sample is observed; preserve presence with nullable/undefined values or explicit signal-presence flags and render an unknown value until data arrives.
  europeVehicle: false, rightHandDrive: false, remoteStartEnabled: false, remoteStartActive: false, offroadLightbar: false,
  destinationName: '', destinationLatitude: 0, destinationLongitude: 0,
  distanceToArrival: 0, minutesToArrival: 0, routeLine: '',
  locatedAtHome: false, locatedAtWork: false, locatedAtFavorite: false,
  gpsState: '', gpsAccuracyM: 0, originLatitude: 0, originLongitude: 0,
  • Files reviewed: 22/23 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +166 to +170
// TestCoverage_FleetTelemetryFields260to269 pins the firmware-2026.32 Field
// enum values (teslamotors/fleet-telemetry@8fbaa100) on the vendored generator
// output. The teslamotors Go module is still v0.9.0 (Go 1.25), so
// TestCoverage_EveryProtoFieldHasSignalMeta cannot see these names via
// ftproto.Field_name until that module pin moves.
@atulmgupta
atulmgupta merged commit 6ca1e9b into main Sep 15, 2026
26 of 27 checks passed
@atulmgupta
atulmgupta deleted the muse-spark branch September 15, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants