History UI: visualization and export#29846
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In History.vue,
fetchDatacapturesrequestFrom/to/periodbut still usesthis.aggregateand updatesrawSeriesunconditionally, so if the user changes period/date quickly you can end up applying a stale response; consider derivingaggregatefrom the captured period and discarding responses that no longer match the currentfetchKey. - The
groupColor/groupExportColorhelpers in History/groups.ts callwindow.getComputedStyledirectly, which will throw in non-DOM environments (e.g., SSR or some tests); consider guarding access towindowor injecting the colors via CSS variables into the Vue app instead.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In History.vue, `fetchData` captures `requestFrom/to/period` but still uses `this.aggregate` and updates `rawSeries` unconditionally, so if the user changes period/date quickly you can end up applying a stale response; consider deriving `aggregate` from the captured period and discarding responses that no longer match the current `fetchKey`.
- The `groupColor`/`groupExportColor` helpers in History/groups.ts call `window.getComputedStyle` directly, which will throw in non-DOM environments (e.g., SSR or some tests); consider guarding access to `window` or injecting the colors via CSS variables into the Vue app instead.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
…und dann noch in die Hauptnavi damit? |
langsam, langsam :D |
|
Instead of individual source tables it might make more sense that we provide CSV download rather then inline tables of raw data? Compares to charging sessions these seem less valid. What I'm missing is an aggregated chart of energy balance (or power), given I don't have an exact idea how it should look. Maybe containing power/energy per group. |
See my comment in the description. This is only an in between step with focus on individual measurements. I already have concepts and ideas for more integrated views, but we have to ensure that the basics are correct first. |
|
@sourcery-ai dismiss |
Do the colors match the charging sessions view? |
|
The color palette is shared. We do not have stable color-to-device association yet. But with published |











refs #29144
fixes #29286
fixes #29827
Replaces the experimental PowerChart / EnergyChart fix timeframe charts with charts grouped by type.
🍱 data is shown on entity level (before grouped)
📆 proper time range select (see session ui)
🔵 ability to focus on one specific dataset (entity)
💽 csv download
expandable data tablefor raw data debugging🔢 round api values to Wh precision
🔌 home consumption and ext/aux meters are combined (similar to energy flow in main ui).
🛠️ replaces chart.js with echart (similar to forecast view)
Note: This is still an experimental view with strong focus on checking data correctness. These charts will likely be replaced with more compact higher level data visualizations. Deliberately kept simple for now. 🧪
Todos
Out of scope
Video
history.2.webm
Screenshots
day

day view dark mode

month

year

mobile consumers

mobile grid

data view

data view, forecast diff

tooltip
