Skip to content

Show the state of charge over a strip of what the vehicle was doing - #226

Merged
vcanuel merged 6 commits into
mainfrom
feat/soc-timeline-states
Nov 2, 2026
Merged

vcanuel merged 6 commits into
mainfrom
feat/soc-timeline-states

Conversation

@vcanuel

@vcanuel vcanuel commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The state of charge tile of the vehicle's page was hard to read: trips and charges were faint full-height bands behind the line (a charge in a grey that hardly showed), and over 7 days a trip of half an hour was a sliver. It now shows the level as a filled area over a strip of what the vehicle was doing (driving, charging, parked, nothing where nothing was read), the last 24 hours by default and 7 days on a toggle; pointing at a stretch of the strip tells its day, times and duration.

Changes

  • Chart frame: bands are drawn in a strip of their own under the plot, solid where the event surely was, paler where it may have been, named inside when the name fits. Under the pointer, a band tells its details (Chart.js's onHover hears the plot only: the plugin's afterEvent hears the strip); a screen reader gets the same in a list. A series may be an area, filled faintly down to the axis.
  • Chart.js Filler is now registered, which the area needs. The interquartile bands of the statistics (cost per distance) and of the battery (capacity), which set fill: '-1', now fill towards their lower bound as their code meant; they did not before.
  • State of charge tile: 24 h / 7 d toggle (hour ticks over a day), the level as an area, charging in its own color (chart-5). Parked is computed where the vehicle was read, outside the trips and charges; it is only "maybe" (paler) while a page of the events is missing.
  • Texts in en, fr, sv.

Screenshots

The tile only, on a made-up week (the series, trips and charges answered by the browser, the same on both sides: the development data is flat).

Before After, 24 h After, 7 d
before after day after week
before after day after week

Look at the strip under the line, the charge's color, and the gap where nothing was read (31 Oct). Under the pointer:

Light Dark
hover hover

Tests

  • task unit passed; the web's 1567 tests, eslint, prettier and vue-tsc pass. New tests for the strip, its tip, the parked stretches and the toggle.
  • CodeRabbit ran locally: its remarks (parked while a page is missing, screen readers, the tip on a phone) are fixed.
  • Not run: the e2e and system tests (no change outside the web).

Closes #225

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added selectable 24-hour and 7-day timeline views, with the 24-hour view selected by default.
    • Added a strip beneath the chart showing trips, charging, and parked periods, with visual distinctions for certain and uncertain intervals.
    • Added interval details—including date, time, and duration—on pointer interaction and for screen readers.
    • Added a shaded charge-level chart and period-specific headings, summaries, and empty-state messages in English, French, and Swedish.

vcanuel and others added 5 commits November 2, 2026 09:20
The bands behind the series, full height and faint, were hard to tell apart and
to read against the line. They now sit in a strip of their own between the plot
and the x axis's ticks: solid where the event surely was, paler where it may
have been, named inside when the name fits. A series may also be an area, filled
faintly down to the axis, which needs Chart.js's Filler: the interquartile
bands of the statistics and of the battery, filled towards their lower bound,
now are as their code meant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…was doing

The state of charge tile showed 7 days, where a trip of half an hour is a
sliver, and a charge in a grey hardly seen. It now shows the last 24 hours by
default, 7 days on a toggle, the level as a filled area, and under it a strip
of what the vehicle was doing: driving, charging (in its own color), parked
wherever it was read outside them, and nothing where nothing was read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tion

A trip of a few minutes is a sliver in the strip: under the pointer, a band now
says what it is, the day it began, its times as honest as its bounds, and how
long it lasted. Chart.js calls onHover inside the plot only: the strip's pointer
is heard by the plugin's afterEvent, a few pixels around a band counting so that
one of a pixel can still be pointed at.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Until every page of the events is read, a trip may hide in a stretch drawn as
parked: it is then drawn paler, as an event not sure.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tip of a band is for the pointer: a screen reader is now given the same in a
list, beside the chart's table. The tip wraps within half the canvas, which is
always free on the side it opens to, so that it stays inside on a phone.

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

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 a175ace and 911a6ae.

Files selected for processing: 2
  • web/src/widgets/soc-timeline/ui/SocTimeline.vue
  • web/test/widgets/soc-timeline/SocTimeline.test.ts

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

Walkthrough

The state-of-charge timeline now defaults to the last 24 hours and offers a 7-day view. The chart displays the state-of-charge level as a filled area and shows driving, charging, and parked periods in a strip below the plot.

Changes: State-of-charge timeline

Layer / File(s) Summary
Chart area and activity strip
web/src/shared/ui/chart/series.ts, web/src/shared/ui/chart/ChartFrame.vue, web/test/shared/ui/ChartFrame.test.ts
Chart series support filled areas. ChartFrame draws event bands in a strip below the plot, with distinct uncertain and certain spans, labels, pointer details, and screen-reader content.
Timeline windows and activity bands
web/src/widgets/soc-timeline/ui/SocTimeline.vue, web/src/shared/i18n/locales/en.json, web/src/shared/i18n/locales/fr.json, web/src/shared/i18n/locales/sv.json, web/test/widgets/soc-timeline/SocTimeline.test.ts
SocTimeline defaults to 24 hours and can switch to 7 days. It creates event and parked bands with formatted details and certainty bounds. Translations and tests cover both windows.

Possibly related issues

Possibly related PRs

Merge Risk: Minimal · up to 911a6

The timeline adds selectable windows and activity bands; no merge-blocking risk was identified.

Security architecture risk: Low · up to 911a6

The changes remain within vehicle-data presentation and preserve existing account-based access controls. No introduced security concern was identified. Residual uncertainty concerns asynchronous loading and recovery behavior, rather than expanded privileges or data access.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The assessed exposure remains the existing account-authorized vehicle-data read path and shared browser chart rendering. The component export does not create a network endpoint, and the changed flow adds no write authority.

Trust Boundaries and Controls

  • observed — New band labels are drawn with canvas text; pointer details and accessible descriptions use Vue text interpolation. The inspected detail-rendering path does not interpret those strings as HTML.
Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title is short, imperative, in English, and accurately describes the main chart change.
Description check Passed The description explains the change and motivation, includes light and dark screenshots, documents testing, identifies skipped tests, confirms localized text updates, and links issue #225.
Linked Issues check Passed Issue [#225] has coding requirements. SocTimeline.vue defaults to 24 hours and supports a 7-day toggle. It renders state of charge as an area and renders driving, charging, parked, and unread interv…
Out of Scope Changes check Passed The locale updates, chart model changes, ChartFrame.vue strip and accessibility changes, SocTimeline.vue changes, and related tests support issue [#225]. Filler registration supports the new fil…
Full details: Linked Issues check

Explanation

Issue [#225] has coding requirements. SocTimeline.vue defaults to 24 hours and supports a 7-day toggle. It renders state of charge as an area and renders driving, charging, parked, and unread intervals on a same-axis strip. It marks uncertain intervals as paler, labels intervals when space permits, and provides interval details. ChartFrame.vue adds screen-reader band details. Tests cover the window toggle, area series, parked intervals, incomplete event pages, and empty readings.

Full details: Out of Scope Changes check

Explanation

The locale updates, chart model changes, ChartFrame.vue strip and accessibility changes, SocTimeline.vue changes, and related tests support issue [#225]. Filler registration supports the new filled area and the existing lower-bound band fills. No unrelated change is established by the available pull request evidence.

hasMore is false before the first page of the trips or charges arrives, and
when it fails: parked is now sure only once both are read, without error, and
with no page left.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vcanuel
vcanuel merged commit e2798d2 into main Nov 2, 2026
8 checks passed
@vcanuel
vcanuel deleted the feat/soc-timeline-states branch November 2, 2026 08:56
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.

Make the state of charge tile readable: a strip of what the vehicle was doing, the last 24 hours

1 participant