From 62bc73f2f98a054ab7711810ee3ceaf0202b968d Mon Sep 17 00:00:00 2001 From: Rene De Ren Date: Wed, 6 May 2026 14:10:22 +0200 Subject: [PATCH] Editor: dynamic input bounds + full hierarchy validation, layout polish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bounds (new src/editor/bounds.js): - Sets HTML5 min/max on every level + percent input each redraw, derived from the current values of related inputs so the spinner stops at the basin hierarchy: 0 < outflowLevel < dryRunLevel < startLevel ≤ inflowLevel ≤ shiftLevel ≤ maxLevel ≤ overflowLevel ≤ basinHeight - dryRunPercent capped so dryRunLevel ≤ startLevel given current outflow. - shiftArmPercent ∈ [1, 100]; highVolumeSafety% ∈ [1, 100]. Validation: - New visible ribbon above the basin diagram (#ps-basin-validation) listing every hierarchy violation. The in-SVG warning text is now a small reminder ("⚠ N ordering issues"). - basin-diagram.js owns hierarchy issues; mode-preview.js trimmed to only own shift-specific issues (shift > start, shift ≤ max, shiftArmPercent range, shiftLevel required-when-enabled). - oneditsave blocks Deploy on the union of _psBasinValidationIssues and _psModeValidationIssues with a RED.notify listing all problems. Layout polish: - Side panel widened to 220 px with minmax(0, 1fr) first column so long labels can no longer push the rows past the panel edge. - Basin SVG max-width 380 → 360, gap between side panel and SVG bumped 14 → 28 px. Tank shifted right (x=145 width=110) so the inlet "bottom of pipe" sub-label is no longer clipped on the left edge. - "0 m (datum)" moved below the tank (y=395, centred) so it can't collide with "Outlet / top of pipe" when outflowLevel is near floor. - Zone labels shortened (Spare / Sewage + buffer / Buffer / Dead vol) and only show when the bracketing thresholds are ≥ 28 px apart, so they never sit on a threshold label. - Mode preview axis labels under the chart removed — line colour + side-panel labels + hover-couple already identify each line. Stub elements left hidden to keep the redraw loop simple. Arm-% line + label trimmed in 10 px on the right so they're not clipped. Co-Authored-By: Claude Opus 4.7 (1M context) --- pumpingStation.html | 96 ++++++++++++++++++++----------------- src/editor/basin-diagram.js | 68 +++++++++++++++++++++----- src/editor/bounds.js | 89 ++++++++++++++++++++++++++++++++++ src/editor/mode-preview.js | 31 ++++-------- src/editor/oneditprepare.js | 11 +++++ src/editor/oneditsave.js | 8 +++- 6 files changed, 225 insertions(+), 78 deletions(-) create mode 100644 src/editor/bounds.js diff --git a/pumpingStation.html b/pumpingStation.html index 35dbcda..3ca10db 100644 --- a/pumpingStation.html +++ b/pumpingStation.html @@ -14,6 +14,7 @@ + @@ -127,17 +128,19 @@

Basin parameters

Heights are measured from the basin floor (0 m). Each input on the left controls a line in the diagram on the right — hover an input to highlight its line.

+