Skip to content

History UI: improve tooltips, labels, stacks, units#29917

Merged
naltatis merged 3 commits into
masterfrom
fix/history_improve
May 15, 2026
Merged

History UI: improve tooltips, labels, stacks, units#29917
naltatis merged 3 commits into
masterfrom
fix/history_improve

Conversation

@naltatis
Copy link
Copy Markdown
Member

improves #29846

🔌 use Wh and kWh dependent on value (tooltip and y-axis)
📆 force tooltip time update on period change \cc @VolkerK62
👁️ hide labels for inactive entities in period
🎨 keep color assignment stable when switching between days
🫆 keep entity focus state when moving between time periods (if possible)

@naltatis naltatis added enhancement New feature or request ux User experience/ interface labels May 15, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The maxVisibleKw/useWatts logic iterates over all visible series and slots on each recomputation; if this computed property is used frequently, consider deriving and caching the peak value once when building the chart data (e.g. alongside series/xAxis) to avoid repeated O(entities × slots) work.
  • The paletteIndex ?? i pattern and related logic for deriving stable indices is repeated in several places (visibleSeries, colors, tooltip IDs, focus handling, legend items); consider extracting a small utility/helper to centralize this behavior and reduce the risk of future divergence.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `maxVisibleKw`/`useWatts` logic iterates over all visible series and slots on each recomputation; if this computed property is used frequently, consider deriving and caching the peak value once when building the chart data (e.g. alongside `series`/`xAxis`) to avoid repeated O(entities × slots) work.
- The `paletteIndex ?? i` pattern and related logic for deriving stable indices is repeated in several places (`visibleSeries`, colors, tooltip IDs, focus handling, legend items); consider extracting a small utility/helper to centralize this behavior and reduce the risk of future divergence.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@naltatis naltatis enabled auto-merge (squash) May 15, 2026 19:08
@naltatis naltatis merged commit a628981 into master May 15, 2026
7 checks passed
@naltatis naltatis deleted the fix/history_improve branch May 15, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ux User experience/ interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant