Skip to content

Colors theme fixes - #4356

Open
cshagen wants to merge 6 commits into
openWB:masterfrom
cshagen:update-web-2611
Open

cshagen wants to merge 6 commits into
openWB:masterfrom
cshagen:update-web-2611

Conversation

@cshagen

@cshagen cshagen commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by Sourcery

Correct colors theme graph data handling and improve the presentation of device status messages.

Bug Fixes:

  • Fix monthly and yearly usage graphs so consumer energy data is categorized correctly and displays in the lower portion of the graph.

Enhancements:

  • Improve status and fault message presentation across charge point and consumer lists with clearer theme-specific styling and spacing.
  • Remove diagnostic console logging from consumer processing and graph rendering.

Build:

  • Update the colors theme package lockfile.

Chores:

  • Clean up SVG power meter label markup.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="packages/modules/web_themes/colors/source/src/components/powerGraph/processDayGraphData.ts" line_range="189" />
<code_context>
 	})
 	// Prices
-	if (currentRow.prices.grid > 0) {
+	if (currentRow.prices && currentRow.prices.grid > 0) {
 		currentItem.price = currentRow.prices.grid * 100000
 	}
</code_context>
<issue_to_address>
**Missing prices become zero**

When a graph contains both rows with prices and rows without valid prices, `transformRow` leaves `price` undefined for rows without a valid price, but `PriceLine` still sends those rows to its line generator. Missing values become zero-price segments or invalid path coordinates, so valid prices render incorrectly; the midpoint label can also receive a NaN position.

Exclude rows without valid prices from the price-line path and its midpoint-label calculation.
</issue_to_address>

### Comment 2
<location path="packages/modules/web_themes/colors/source/src/components/powerGraph/PriceLine.vue" line_range="71" />
<code_context>
 			.range([props.height - 10, 5])
 			.domain(e)
 	} else {
+		showLine.value = false
 		return scaleLinear()
 			.range([props.height - 10, 0])
</code_context>
<issue_to_address>
**Price line stays hidden**

When a mounted `PriceLine` receives a dataset without prices and later receives one with valid prices, `yScale` sets `showLine` to false for the no-price dataset, but the valid-extent branch never sets it back to true, so the root `v-if` keeps the SVG removed and users see no price line.

Set `showLine` to true in the valid-extent branch.
</issue_to_address>

### Comment 3
<location path="packages/modules/web_themes/colors/source/src/components/powerGraph/processDayGraphData.ts" line_range="189" />
<code_context>
 	})
 	// Prices
-	if (currentRow.prices.grid > 0) {
+	if (currentRow.prices && currentRow.prices.grid > 0) {
 		currentItem.price = currentRow.prices.grid * 100000
 	}
</code_context>
<issue_to_address>
**Hovering breaks the tooltip**

When a row without a price is hovered while tariff data is active, `transformRow` leaves `entry.price` undefined, and the active-price tooltip passes it to `formatPrice`, which calls `toFixed` and throws, breaking tooltip rendering.

Guard missing prices before passing `entry.price` to `formatPrice`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@cshagen
cshagen marked this pull request as draft November 18, 2026 07:03
@cshagen
cshagen marked this pull request as ready for review November 18, 2026 17:21
@cshagen

cshagen commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

@sourcery-ai review

@sourcery-ai

sourcery-ai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Linked issues

Checked at commit 132a10d

#4337 [BUG] Color Theme alte Tageswerte nicht darstellbar nach Upgrade 2.3.0 · 0 of 1 met

# Requirement Status Notes
1 Display daily reports from before the upgrade, even when they have no prices object. ❌ Not addressed The daily graph code still reads currentRow.prices.grid directly, so a historical row without prices can still throw.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="packages/modules/web_themes/colors/source/src/components/powerGraph/PgToolTipItem.vue" line_range="125" />
<code_context>
 			/>
 			<PgToolTipLine
-				v-if="etData.active"
+				v-if="etData.active && entry.price != null"
 				cat="price"
 				:indent="5"
</code_context>
<issue_to_address>
**Tooltip shows invalid price**

When historical graph data contains a positive price that overflows to `Infinity` during parsing or scaling, `transformRow` retains the overflowing positive price as `Infinity`, and `entry.price != null` passes it to `formatPrice`; unlike `PriceLine`, the tooltip renders `Infinity` as a price, leaving a misleading entry.

Require `Number.isFinite(entry.price)` in the tooltip guard, matching `PriceLine`.

Also at `packages/modules/web_themes/colors/source/src/components/powerGraph/processDayGraphData.ts:189`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@cshagen cshagen changed the title Colors theme fix: non-existing prices in older graph data Colors theme fixes Nov 22, 2026
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.

[BUG] Color Theme alte Tageswerte nicht darstellbar nach Upgrade 2.3.0

1 participant