Skip to content

Conversation

@TylonHH
Copy link
Owner

@TylonHH TylonHH commented Jan 3, 2026

Motivation

  • The chart scale toggle for smart tariff needed to correctly switch between 0–max and min–max modes.
  • The active toggle should follow EVCC corporate design and display the green enabled state.
  • Price range display should be rounded to whole units for clearer min/max summaries (e.g. 25,6–38,225–39).
  • The change should make the vehicle-status-smartcost UI behave correctly when the switch is toggled.

Description

  • Updated assets/js/components/Tariff/SmartTariffBase.vue to use a chart-scale-toggle wrapper and added CSS to style the active toggle with var(--evcc-green).
  • Added displayCostRange and formatRangeValue helpers and switched fmtTotalCostRange/fmtActiveCostRange to use the display-aware range so the label reflects zero vs range scale modes.
  • Adjusted rounding logic to floor the lower bound and ceil the upper bound and format values in whole units for both currency and CO2 displays.
  • Updated assets/js/components/Tariff/TariffChart.vue to normalize the chart heights when scaleMode === 'zero' by treating the minimum as 0 and adjusting the range accordingly.

Testing

  • Started the frontend dev server with npm run dev and it launched successfully.
  • Ran a Playwright script to load the UI and capture a screenshot (artifacts/smart-tariff-scale.png) which completed successfully.
  • No unit or integration test suites (make test / npm run playwright full run) were executed as part of this change.
  • Files modified: assets/js/components/Tariff/SmartTariffBase.vue and assets/js/components/Tariff/TariffChart.vue.

Codex Task

@TylonHH TylonHH merged commit f6a9edf into master Jan 3, 2026
@TylonHH TylonHH deleted the codex/fix-switches-for-price-toggling branch January 3, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants