Skip to content

Add read-only trip summary widget - #332

Open
raykellyjr wants to merge 8 commits into
vide:mainfrom
raykellyjr:feat/trip-summary-widget
Open

Add read-only trip summary widget#332
raykellyjr wants to merge 8 commits into
vide:mainfrom
raykellyjr:feat/trip-summary-widget

Conversation

@raykellyjr

@raykellyjr raykellyjr commented Jul 9, 2026

Copy link
Copy Markdown

Adds a read-only home screen Trip summary widget backed entirely by cached Room summaries. It never sends vehicle commands or polls the car.

Highlights:

  • Vehicle selection with reconfigurable 7/30/90-day ranges
  • Distance, drives, driving days, energy, efficiency, charging cost, and cost per 100 distance units
  • Same-length previous-period distance comparison
  • Honest charging-cost coverage labels for missing, partial, and complete price data
  • Periodic/offline updates plus refresh after successful data sync
  • Trips deep-linking without live car polling
  • Cached TeslaMate unit and currency handling
  • Localized widget copy in English, Catalan, German, Spanish, Italian, and Chinese
  • Formatter and date-range unit coverage

Local verification:

  • git diff --check
  • ./gradlew :app:testDebugUnitTest :app:lintDebug :app:assembleDebug

Local setup note: Android SDK, Gradle cache, and build output are backed by an APFS sparsebundle on the external SSD to avoid internal disk pressure.

@raykellyjr
raykellyjr marked this pull request as ready for review July 9, 2026 03:32
@raykellyjr

Copy link
Copy Markdown
Author

Freshly revalidated this branch on 2026-07-16:

  • :app:testDebugUnitTest passes
  • :app:lintDebug passes
  • :app:assembleDebug passes
  • branch remains mergeable and current with main

The new widget reads cached Room summaries only; it does not send vehicle commands or trigger live car polling. I am happy to adjust or split the change if a smaller review surface would be preferable.

Only show cost/100 when every charge in the selected range is priced,
surface partial/missing coverage in compact mode, and refresh the
widget immediately when currency or TeslaMate units change.
@raykellyjr

Copy link
Copy Markdown
Author

Polished this branch for cost honesty and fresher unit/currency labels:

  • Cost/100 now only appears when every charge in the selected range is priced
  • Known totals still show under partial coverage, including compact mode (Cost $x · 1/2 priced)
  • Widget refreshes immediately after currency changes and when TeslaMate unit-of-length is cached
  • Changelog + README updated for the second widget
  • Formatter/ViewModel unit tests updated; lint + targeted unit tests pass

Still fully read-only over cached Room data — no vehicle commands or live car polling.

@raykellyjr

Copy link
Copy Markdown
Author

Still complementary to #334#334 adds the Cost summary widget + Cost Analytics screen; this Trip summary widget remains a separate read-only home-screen surface.

Defer trip-widget refresh on unit-of-length cache changes until after
summary sync, resolve units from TeslaMate settings in the worker, and
refresh the widget when summaries land even if detail sync retries.
@raykellyjr

Copy link
Copy Markdown
Author

Review + polish pass complete

Self-reviewed and pushed follow-up fixes:

  • No longer relabels cached Room summaries with a new unit before re-sync (avoids km data shown as mi)
  • Worker resolves units from TeslaMate global settings before formatting
  • Widget refreshes when summaries land even if later detail sync retries
  • Cost honesty unchanged: cost/100 only when every charge in range is priced

Local verification: targeted unit tests + lint green.

CI note: please approve the workflow run (action_required for fork PRs) so CI can execute.

Cache unit-of-length during summary sync and stop live-fetching
TeslaMate units in the trip widget worker so Room values and labels
cannot drift after a unit change.
@raykellyjr

Copy link
Copy Markdown
Author

Final correctness pass: trip widget labels now use the unit cached at summary-sync time only (no live settings fetch during widget update). Ready for workflow approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants