多出口节点重设计 + 全局错误提示

- 选择/随机/战斗节点改为每出口一行、右对齐、行高25px对齐右侧端口
- 去掉重复的选项合并预览,顶部改为紧凑角标
- 未捕获错误/操作失败统一 toast 提示,便于同事发现反馈
This commit is contained in:
bia
2026-06-08 18:53:48 +08:00
parent 188bfbbf7c
commit 2b66374e90
3 changed files with 41 additions and 13 deletions

View File

@ -281,6 +281,13 @@
clearTimeout(toastTimer);
toastTimer = setTimeout(() => el.classList.remove("show"), 2600);
}
// 未捕获错误 → toast 提示(便于同事发现并反馈,而不是默默白屏)
window.addEventListener("error", e => { try { toast("⚠ 页面出错:" + (e.message || "未知")); } catch (_) {} });
window.addEventListener("unhandledrejection", e => {
const m = String((e.reason && e.reason.message) || e.reason || "未知");
if (m.includes("未授权")) return;
try { toast("⚠ 操作失败:" + m); } catch (_) {}
});
// ---------- 撤销 / 重做Ctrl+Z / Ctrl+Y ----------
let undoStack = [], redoStack = [], snapTimer = null;