Repository navigation
Conversation
There was a problem hiding this comment.
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>| }) | ||
| // Prices | ||
| if (currentRow.prices.grid > 0) { | ||
| if (currentRow.prices && currentRow.prices.grid > 0) { |
There was a problem hiding this comment.
🟡 Medium · 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.
Prompt for AI agents
In `packages/modules/web_themes/colors/source/src/components/powerGraph/processDayGraphData.ts` at line 189:
**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.| .range([props.height - 10, 5]) | ||
| .domain(e) | ||
| } else { | ||
| showLine.value = false |
There was a problem hiding this comment.
🟡 Medium · 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.
Prompt for AI agents
In `packages/modules/web_themes/colors/source/src/components/powerGraph/PriceLine.vue` at line 71:
**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.| }) | ||
| // Prices | ||
| if (currentRow.prices.grid > 0) { | ||
| if (currentRow.prices && currentRow.prices.grid > 0) { |
There was a problem hiding this comment.
🟡 Medium · 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.
Prompt for AI agents
In `packages/modules/web_themes/colors/source/src/components/powerGraph/processDayGraphData.ts` at line 189:
**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`.
Summary by Sourcery
Prevent older graph data without prices from causing errors or displaying an invalid price series.
Bug Fixes:
Enhancements: