Skip to content

Show the variant's net capacity where the car reports none - #163

Merged
vcanuel merged 5 commits into
mainfrom
fix/variant-capacity
Oct 28, 2026
Merged

vcanuel merged 5 commits into
mainfrom
fix/variant-capacity

Conversation

@vcanuel

@vcanuel vcanuel commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

A Polestar read through the Data Portal, or a Tesla through the Owner API, reports no battery capacity, so the vehicle page's Battery tile said Unknown, which reads as a setup gone wrong. Where the car reports none, the tile now shows the net capacity of the vehicle's variant, the one its energies rest on, marked "Usable, from the variant". A capacity the car reports keeps its place.

Changes

  • Front end: the vehicle state's Battery tile falls back to the variant's net_kwh when battery_capacity_kwh is absent; nothing shows without a variant either way (Unknown, as before). Texts in English, French and Swedish.
  • Docs: the Polestar and Tesla guides say the vehicle page shows the variant's usable capacity.

Screenshots

A simulated Polestar 2 Long Range Single Motor 2024, its variant chosen.

Before After
before after
before after

The Battery tile: Unknown becomes 79 kWh, usable, from the variant (desktop, then phone).

Tests

  • task unit-web (typecheck, lint, 1383 tests, build): passed, with tests for the variant's capacity in each language and for a capacity the car reports (the other tests run without a variant).
  • task unit-go not run: no Go changed. The e2e did not run locally.
  • CodeRabbit CLI run locally; its one remark (a terse sentence in the Tesla guide) fixed.

Closes #138

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Vehicle pages now show usable battery capacity from the selected variant when reported capacity is unavailable, with a label identifying the value’s source.
    • Reported battery capacity continues to take precedence when available.
    • Added English, French, and Swedish translations for the variant-capacity label.
  • Documentation
    • Updated Polestar and Tesla guidance to clarify how variant battery capacity appears on vehicle pages.

vcanuel and others added 3 commits October 28, 2026 12:47
A Polestar read through the Data Portal, or a Tesla through the Owner
API, reports no battery capacity, so the vehicle page's tile said
Unknown, which reads as a setup gone wrong. It now shows the net
capacity of the vehicle's variant, the one its energies rest on, marked
as usable and from the variant. A capacity the car reports keeps its
place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between c828be3 and 38d263b.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7bf139b and c828be3.

Files selected for processing: 1
  • web/src/widgets/vehicle-state/ui/VehicleState.vue
Files skipped from review as they are similar to previous changes: 1
  • web/src/widgets/vehicle-state/ui/VehicleState.vue

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

When vehicle state does not include battery capacity, the vehicle page now displays the selected variant’s usable capacity and identifies its source. A reported capacity remains preferred. English, French, and Swedish translations, tests, and Polestar and Tesla guidance are updated.

Changes: Variant Capacity Display

Layer / File(s) Summary
Capacity fallback and display
web/src/widgets/vehicle-state/ui/VehicleState.vue, web/src/shared/i18n/locales/*.json, web/test/widgets/vehicle-state/VehicleState.test.ts, documentation/guide/polestar.md, documentation/guide/tesla.md
When reported battery capacity is absent, the vehicle page displays the selected variant’s net_kwh with a localized source label. Reported capacity takes precedence. Tests cover both cases, and the Polestar and Tesla guidance describes the variant capacity display.

Possibly related PRs

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · previous review c828b

The capacity fallback appears mergeable after normal checks; no specific issue remains identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title "Show the variant's net capacity where the car reports none" describes the main change: the Battery tile falls back to the variant's net_kwh when the car reports no battery capacity. It is s…
Description check Passed The description follows the repository template. It explains what changes and why, links the issue (Closes #138), and describes the front end and docs changes. It includes before and after screenshots…
Linked Issues check Passed Issue #138 requires variant net_kwh fallback when battery_capacity_kwh is absent, a source label, reported-capacity precedence, Unknown without a usable variant value, English/French/Swedish tex…
Out of Scope Changes check Passed The component change, translations, tests, and Polestar and Tesla guide updates support issue #138. The documentation explains the new variant-capacity behavior. No unrelated change is shown in the re…
Full details: Title check

Explanation

The title "Show the variant's net capacity where the car reports none" describes the main change: the Battery tile falls back to the variant's net_kwh when the car reports no battery capacity. It is specific and matches the changeset and linked issue #138. It is imperative and in English, but it does not follow the requested prefix pattern exactly, since it is phrased as a sentence fragment rather than a clear imperative verb-led description of the user-facing effect. The content is accurate, so the title passes.

Full details: Description check

Explanation

The description follows the repository template. It explains what changes and why, links the issue (Closes #138), and describes the front end and docs changes. It includes before and after screenshots, which the template asks for on interface changes. The test section lists task unit-web, notes that task unit-go was not run, and explains that e2e did not run locally. The template checklist items for the API diff and the no-secrets check are not addressed explicitly, and the text covers English, French and Swedish. Those gaps are minor, so the description is mostly complete.

Full details: Linked Issues check

Explanation

Issue #138 requires variant net_kwh fallback when battery_capacity_kwh is absent, a source label, reported-capacity precedence, Unknown without a usable variant value, English/French/Swedish text, and tests. The summary shows VehicleState.vue implements these cases. Locale files add the labels. VehicleState.test.ts covers fallback, reported capacity, localization, and no-variant behavior.

Full details: Out of Scope Changes check

Explanation

The component change, translations, tests, and Polestar and Tesla guide updates support issue #138. The documentation explains the new variant-capacity behavior. No unrelated change is shown in the reviewed summary.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

vcanuel and others added 2 commits October 28, 2026 13:10
Its note is wider than the Unknown it replaces, so the capacity went
under the range on a narrow tile. It now shrinks, its note wrapping.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vcanuel
vcanuel merged commit 4cbb7b8 into main Oct 28, 2026
8 checks passed
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.

Show the variant's net capacity when the car reports none

1 participant