diff --git a/shared/toast.js b/shared/toast.js index 6f2a7d6..6e32da1 100644 --- a/shared/toast.js +++ b/shared/toast.js @@ -60,4 +60,17 @@ } window.zddc.toast = toast; + + // Route window.alert() calls into the toast helper. Every tool has + // accumulated some `alert(...)` sites for error reporting; rather + // than touch each one, intercept globally so they're non-blocking + // and ARIA-announced consistently. Native alert is preserved on + // window.alertNative for the rare case where a truly modal block + // is needed (e.g. before navigating away with unsaved changes). + if (typeof window.alert === 'function' && !window.alertNative) { + window.alertNative = window.alert.bind(window); + window.alert = function (msg) { + toast(String(msg == null ? '' : msg), 'error'); + }; + } })(); diff --git a/zddc/internal/handler/tables.html b/zddc/internal/handler/tables.html index 802ece8..a0eebe5 100644 --- a/zddc/internal/handler/tables.html +++ b/zddc/internal/handler/tables.html @@ -1155,7 +1155,7 @@ body.help-open .app-header {
ZDDC Table - v0.0.17-beta · 2026-05-11 · crescent-coast-beam + v0.0.17-alpha · 2026-05-11 00:27:49 · f2af379-dirty
@@ -2232,6 +2232,19 @@ body.help-open .app-header { } window.zddc.toast = toast; + + // Route window.alert() calls into the toast helper. Every tool has + // accumulated some `alert(...)` sites for error reporting; rather + // than touch each one, intercept globally so they're non-blocking + // and ARIA-announced consistently. Native alert is preserved on + // window.alertNative for the rare case where a truly modal block + // is needed (e.g. before navigating away with unsaved changes). + if (typeof window.alert === 'function' && !window.alertNative) { + window.alertNative = window.alert.bind(window); + window.alert = function (msg) { + toast(String(msg == null ? '' : msg), 'error'); + }; + } })(); // shared/nav.js — lateral navigation strip across the four canonical