Optimization - #102
Merged
Merged
Optimization#102
Conversation
Coalesce ordered per-vehicle telemetry into bounded multi-row writes while preserving source timestamps, durable signal history, and broker replay semantics. Separate liveness from dependency readiness, expose pool-pressure metrics, and tune API, worker, PostgreSQL, Helm, and Compose defaults for resource-constrained home servers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c4f5fe6d-5e00-4d43-a379-96a3491480e3
Add synchronized counter collection, confidence-aware per-drive attribution, dashboard comparisons, and approximate route evidence across the FSD and drives experiences. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ecf38089-132f-4123-b33f-23d9133f2db9
Backend: add BuildFirmwareSpotlight to compare same-route FSD share before/after the latest firmware pair (high-confidence drives only, sorted by |share change|). Frontend: - Add FirmwareSpotlightPanel to FSD drive analytics showing before/after route comparisons - Add FsdSection + useFsdWeeklyDigestNotification to the weekly digest page, wiring in useFsdInsightsRange for the selected Monday-Sunday week (once-per-week browser notification, no permission prompting) - Add CSV/JSON export for contributing drives (SI meters, drops unmeasured FSD distance) - Add downloadJSON helper to csvExport.ts All changes preserve SI units end-to-end and null-safety for unmeasured data.
Introduce an Observatory view stitching drive and counter-reset events into a single honesty-first timeline. Resets never contribute travelled distance, and unknown/ambiguous FSD kilometres stay null instead of being coerced to zero. Adds commute stories that split repeated routes into firmware-version chapters. Backend: buildObservatory in drive_aggregate.go computes stitched/high/estimated/ambiguous FSD totals, a capped timeline (max 200 events), and per-route commute chapters. New Observatory/ObservatoryEvent/ObservatoryTotals/ObservatoryCommuteStory types added to DriveAnalytics response. Frontend: new FsdObservatoryPanel component renders the journal, KPIs, and commute stories; wired into FSDInsightsPage. Types, fixtures, and mock API updated to match the new response shape.
Tesla's Complete/Stopped/NoPower states mean the vehicle is still plugged in — only Disconnected means unplugged. This was causing charge sessions to end prematurely. Changes: - enums.IsChargeEnded now only returns true for Disconnected - FSM and telemetry session tracker updated to keep charging sessions alive through Complete/Stopped/NoPower - Gear=Park now debounces before ending a drive (Neutral is rolling, not parked, and no longer treated as park) - FSM confirmed debounced transitions now commit immediately instead of waiting for the next batch - MQTT: delay broker Connect until after PipelineSubscriber/DefaultPublishHandler are wired, so queued QoS 1 messages delivered right after CONNACK aren't dropped; split NewProductionPipelineMQTT into construct + ConnectProductionPipelineMQTT Updated tests across datarepair, telemetry sessions, fsm, enums, and mqtt packages to match.
Add Tesla-honest physics APIs and UI for charge, park, vampire drain, FSD trip meters, gear events, session certificates, and outage replay. Extend FSD analytics with commute comparisons and firmware-tagged counter resets.
Adds a backend `/physics/exclusive` report that derives TeslaSync-only physics signals, including clocks, life tape, contradictions, meter genealogy, unknown budgets, firmware epochs, mode laws, and range disagreement without inventing missing values. Adds frontend routes, navigation, i18n, API hooks, types, and tests for the new Tesla-only page.
Serialize reconnect epoch changes with subscription setup and retry stale initial SUBACKs. Add coverage for overlapping OnConnect and connection-loss startup races.
Physics endpoints buffered every signal_log event for the window before folding, which made the 14-day exclusive and 7-day outage lookbacks unbounded in memory and latency. - Replace the buffer-then-fold-then-collapse pipeline in internal/signal with a streaming timelineFolder that folds, collapses, and caps rows as events arrive; add TimelineOptions.MaxRows and log truncation. - Apply CollapseBy and MaxRows to charge, theater, silent, cockpit, heartbeat, park-truth, vampire, exclusive, and outage timeline reads. - Split exclusiveFields into a collapsed history set plus a high-resolution 90s black-box query, and drop battery_level/driving_distance_m from collapse keys where they defeated collapsing. - Shrink vampire lookback to 7d and outage lookback to 2h. - Move charge, outage, and exclusive query policies from operational/live to historical. - gofmt alignment across teslaphysics/types.go.
Updates navigation, route labels, page copy, i18n strings, catalog description, and tests to use the Tesla Physics naming.
Redesign the Tesla-only physics hub with feature cards, provenance, empty states, and richer detail views backed by data tables. Update related i18n labels and tests to preserve unknown/null semantics for clocks, MQTT, FSD meters, range, modes, and life tape states.
Android and iOS apply their own squircle/circle masks to launcher icons, so the pre-drawn inner frame and accent stroke were being clipped into visible border arcs on the splash screen. - Drop the inset surface rect + accent stroke from all icon modes in `appIcon.ts`, the static SVG sources, the favicon, and the index.html splash mark - Make launcher/splash icons full-bleed; the PWA `any` purpose now uses the apple (unrounded) canvas - Add missing `icon-maskable-192.svg` / `icon-maskable-512.svg` sources and regenerate all PNGs via sharp - Keep accent validation in `buildAppIconSvg` for API stability even though it is no longer drawn - Update tests and icons README with the regeneration command and the no-frame rule
DataTable column definitions were typed as a single `Column<T>` instead of `Column<T>[]`, breaking type checking across all 13 panels. Also wrap the empty-state branch in a fragment so the JSX comment is no longer parsed as an object literal.
Add a routed, searchable Fleet Setup workspace for Tesla connection, token status, telemetry subscription, domain readiness, and stream health. Introduce typed hooks and coverage for Fleet API setup flows.
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #
Type of Change
Checklist
Screenshots (if applicable)