Skip to content

Fix backup islanding arrow - #25

Merged
piomar123 merged 1 commit into
mainfrom
backup-islanding-arrow-overlap
Sep 14, 2026
Merged

piomar123 merged 1 commit into
mainfrom
backup-islanding-arrow-overlap

Conversation

@piomar123

@piomar123 piomar123 commented Sep 14, 2026

Copy link
Copy Markdown
Owner

The bus edge (Inverter->Junction) and the inverter-fed Backup edge both leave Inverter's bottom border at the same point, and the islanding edge then runs straight down through Junction's own position before bending into Backup - so with no offset between them, the two draw on exactly the same pixels. During islanding this made Backup's flow visually indistinguishable from (and drawn right on top of) a grid-bypassed feed, even overlapping the "grid disconnected" crossed-X mark on the bus edge, making it look like power was flowing straight through it.

Confirmed against a real Pi sample (2026-09-13 19:57:52, grid_mode Fault/work_mode Off-Grid: load 725W, backup 726W, battery discharging 700W, meter/pgrid ~0W) and visually verified with a standalone harness loading the real static assets in headless Chrome, before/after.

The v5 mockup (docs/superpowers/mockups/live-power-flow-dashboard- mockup-v5.html) already solved this with BACKUP_ISLANDING_SHIFT - offset the bus's exit point right and the islanding edge's own exit point left by the same amount, and shift Junction/Load right by it too, so the two lines run alongside each other instead of on top of each other - but its own comment flagged it as "pending a production port" that never happened, across the original port (#15) and four follow-up fixup PRs (#19, #21, #22, #23). Those fixups all hardened diagram-calc.js's arithmetic (Kirchhoff's law, source-mix stripes), which is unit-tested

  • diagram-render.js's SVG geometry has no DOM harness, so nothing ever regression-tested it, and manual verification only ever happened to see the far-more-common grid-connected state.

Ported the shift amount as a pure, testable function (backupIslandingShiftPx in diagram-calc.js, covered by node --test) alongside the constant; diagram-render.js applies the actual DOM transform/geometry offset, which still has no automated coverage - the same gap that let this slip through five previous PRs. Also audited the rest of the mockup's own "pending production port" comments: the other two (sqrt-scale arrow thickness, dischargeLimit===0 battery check) were already ported in later commits despite the mockup's stale comments; the adaptive backup-threshold formula remains deliberately deferred, already tracked by its own comment in diagram-calc.js.

…erlap

The bus edge (Inverter->Junction) and the inverter-fed Backup edge both
leave Inverter's bottom border at the same point, and the islanding edge
then runs straight down through Junction's own position before bending
into Backup - so with no offset between them, the two draw on exactly
the same pixels. During islanding this made Backup's flow visually
indistinguishable from (and drawn right on top of) a grid-bypassed feed,
even overlapping the "grid disconnected" crossed-X mark on the bus edge,
making it look like power was flowing straight through it.

Confirmed against a real Pi sample (2026-09-13 19:57:52, grid_mode
Fault/work_mode Off-Grid: load 725W, backup 726W, battery discharging
700W, meter/pgrid ~0W) and visually verified with a standalone harness
loading the real static assets in headless Chrome, before/after.

The v5 mockup (docs/superpowers/mockups/live-power-flow-dashboard-
mockup-v5.html) already solved this with BACKUP_ISLANDING_SHIFT - offset
the bus's exit point right and the islanding edge's own exit point left
by the same amount, and shift Junction/Load right by it too, so the two
lines run alongside each other instead of on top of each other - but its
own comment flagged it as "pending a production port" that never
happened, across the original port (#15) and four follow-up fixup PRs
(#19, #21, #22, #23). Those fixups all hardened diagram-calc.js's
*arithmetic* (Kirchhoff's law, source-mix stripes), which is unit-tested
- diagram-render.js's SVG *geometry* has no DOM harness, so nothing ever
regression-tested it, and manual verification only ever happened to see
the far-more-common grid-connected state.

Ported the shift amount as a pure, testable function
(backupIslandingShiftPx in diagram-calc.js, covered by node --test)
alongside the constant; diagram-render.js applies the actual DOM
transform/geometry offset, which still has no automated coverage - the
same gap that let this slip through five previous PRs. Also audited the
rest of the mockup's own "pending production port" comments: the other
two (sqrt-scale arrow thickness, dischargeLimit===0 battery check) were
already ported in later commits despite the mockup's stale comments; the
adaptive backup-threshold formula remains deliberately deferred, already
tracked by its own comment in diagram-calc.js.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@piomar123 piomar123 changed the title Port BACKUP_ISLANDING_SHIFT from the v5 mockup to fix backup-arrow ov… Port BACKUP_ISLANDING_SHIFT from the v5 mockup to fix backup-arrow overlap Sep 14, 2026
@piomar123 piomar123 changed the title Port BACKUP_ISLANDING_SHIFT from the v5 mockup to fix backup-arrow overlap Fix backup islanding arrow Sep 14, 2026
@piomar123
piomar123 merged commit f8d1675 into main Sep 14, 2026
1 check passed
@piomar123
piomar123 deleted the backup-islanding-arrow-overlap branch September 20, 2026 07:34
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.

1 participant