overhaul: modular architecture, tests, doc generation, warning system, and UX improvements

- Modular block files: split into blocks-algo, blocks-data, blocks-proc
- New modules: sections.js (labelled canvas areas), proc-browser.js (procedure tree modal), lib-loader.js (lazy library loading), templates.js (project templates), errno-data.js (errno table)
- Test infrastructure: browser test suite (28 tests) and Node pure-function tests (75 tests)
- Warning system: unified .block-warn for disconnected inputs, unconnected error hooks, and zero-exit-in-error-path
- Error path highlighting: red flow paths and block borders for error-only subgraphs
- Input hooks: hidden by default, shown during linking; outputs always at bottom
- Block editor modal: pencil icon, colour picker for accent, compact field labels
- Doc generation: standalone node script extracts JSDoc -> docs/API.md (124 declarations)
- Persistence: save/restore sections, errno selection, block colours
- Fixes: _segmentsIntersect bug, WCEnd crash from closest(this), drawpath guard on detached elements
This commit is contained in:
2026-06-22 18:31:23 +02:00
parent 36fc63780a
commit b8e8ef9113
44 changed files with 9064 additions and 596 deletions
+6 -2
View File
@@ -11,7 +11,9 @@
*/
function showError(msg) {
const el = $("#error-overlay");
el.querySelector(".error-msg").textContent = msg;
if (!el) { console.error("ACK: " + msg); return; }
const msgEl = el.querySelector(".error-msg");
if (msgEl) msgEl.textContent = msg;
el.classList.add("active");
}
@@ -21,11 +23,13 @@ function showError(msg) {
* @param {MouseEvent} [ev] - event to check target matching
*/
function closeError(ev) {
const el = $("#error-overlay");
if (!el) return;
if (
!ev ||
ev.target === ev.currentTarget ||
ev.target.classList.contains("error-close")
) {
$("#error-overlay").classList.remove("active");
el.classList.remove("active");
}
}