diff --git a/.changeset/flow-size-no-minus.md b/.changeset/flow-size-no-minus.md new file mode 100644 index 0000000..ec9d2e1 --- /dev/null +++ b/.changeset/flow-size-no-minus.md @@ -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. diff --git a/src/vendor/ftw/digests.json b/src/vendor/ftw/digests.json index 280fb57..c2987fe 100644 --- a/src/vendor/ftw/digests.json +++ b/src/vendor/ftw/digests.json @@ -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", diff --git a/src/vendor/ftw/ftw-energy-flow.js b/src/vendor/ftw/ftw-energy-flow.js index e638139..b42a01e 100644 --- a/src/vendor/ftw/ftw-energy-flow.js +++ b/src/vendor/ftw/ftw-energy-flow.js @@ -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. // // — hero diagram for /next. @@ -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, @@ -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.