Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/flow-size-no-minus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ftw-webapp": patch
---

The vendored flow diagram prints each device's power as a size, with "charging" or "discharging" under a battery, never a minus sign. Home use in the middle keeps its sign for now, and a battery FTW only observes says so under its title. It is the box's own copy, taken again from srcfl/ftw.
2 changes: 1 addition & 1 deletion src/vendor/ftw/digests.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"control-feedback.js": "389b5f227b7d125fa4138cc9c803660bfcff58e5ba50a18a4384c58704317d4a",
"ftw-bar-chart.js": "08b61533ed52b0031a39e723278c812b2b27356c1d574b65dfd5603992065d82",
"ftw-element.js": "7241b586582187cef2d76d3ee11bbc596c4f428cea3a5c8c84227e113aa3c1a0",
"ftw-energy-flow.js": "ced3308f92e0d49b41e7af5038a85e0986a0d879febf3b1541385028af5aa693",
"ftw-energy-flow.js": "ef5ca158df1397a776d75b0ba94807c1992fe55aa6763cda0a72458bf643cd8e",
"ftw-price-chart.js": "1833d8008f06f2eb8f6e2b9b0bb6ff91aafa1f54b81ed249d57bb4fda968a736",
"price-math.js": "bc6b104259f76d799c0a9d7f1d8a780d897cb7dc0d7a3e16a6572fb9c626d508",
"price-strip.js": "413b2946c311e910c9a052a8407a3a403ed6caca0e210307c6f3e951896c2b9b",
Expand Down
22 changes: 16 additions & 6 deletions src/vendor/ftw/ftw-energy-flow.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vendored from srcfl/ftw web/components/ftw-energy-flow.js at 6d8e8704ccc8ee801fce16efd717a596e39e76ad.
// Vendored from srcfl/ftw web/components/ftw-energy-flow.js at cd68b44947322eb1da3b0a86310e15b5121896a3.
// Do not edit here; change the box source, then copy it here.
//
// <ftw-energy-flow> — hero diagram for /next.
Expand Down Expand Up @@ -656,12 +656,21 @@ class FtwEnergyFlow extends FtwElement {
!p.aggregated &&
(layerClass === "ind" || aggregateMemberCount > 1) &&
Math.max(p._groupSize || 1, aggregateMemberCount || 1) > 1;
const grouped = p._groupSize > 1 && !!p.name;
return renderCircleNode({
pos: p._pos,
value: p.placeholder ? "—" : fmtKw(p.kw),
// A planet prints its size; the word under it gives the direction,
// because the UI never shows a raw minus. The hub keeps Core's sign
// for Home use (#1768).
value: p.placeholder ? "—" : fmtKw(Math.abs(p.kw)),
title: p.title,
nameLabel: p._groupSize > 1 && p.name ? p.name.toUpperCase() : null,
sub: p.sub,
// The title's second line names the device in a group, or says
// that FTW only observes it; a phone's larger title font has room
// for one word. A grouped device keeps its name there and says
// "observe only" under the size instead.
nameLabel: grouped ? p.name.toUpperCase()
: p.observeOnly ? (this._compact ? "OBSERVED" : "OBSERVE ONLY") : null,
sub: grouped && p.observeOnly ? "observe only" : p.sub,
color: p.color,
soc: p.placeholder ? null : p.soc,
chargeLimit: p.placeholder ? null : p.chargeLimit,
Expand Down Expand Up @@ -1665,8 +1674,9 @@ function renderDailyParts(parts) {
}

function fmtKw(kw) {
// Input is kilowatts. Sub-kW values render as plain integer watts
// (no decimals) so a "30 W" import or "−12 W" battery trickle stays
// Input is kilowatts: a size for a planet, Home use as Core signs it
// for the hub. Sub-kW values render as plain integer watts (no
// decimals) so a "30 W" import or "12 W" battery trickle stays
// visible as the real number. The visual "idle / balanced"
// affordances (beam dimming, sub-label text) live on a separate
// ±FLOW_IDLE_W threshold; this formatter only handles display.
Expand Down
Loading