节点编辑三项增强

- 删除中间节点自动缝合:线性节点删除后把前驱接到其后继
- 撤销/重做:Ctrl+Z / Ctrl+Y(含连线、删除、移动、改字段,防抖快照)
- 开头节点(nodes[0]):绿色边框+「▶开头」标识,选中事件时自动定位到它
This commit is contained in:
bia
2026-06-08 18:39:04 +08:00
parent 2de308c1e1
commit 188bfbbf7c
4 changed files with 104 additions and 17 deletions

View File

@ -257,9 +257,8 @@
// 删除节点
host.appendChild(el("div", { class: "fld" }, [
el("button", { class: "mini", onclick: () => {
if (!confirm("删除节点 " + id + "指向它的跳转需手动修复(校验会提示)。")) return;
ir.nodes = ir.nodes.filter(n => n.id !== id);
ctx.selectNode(null); ctx.onChange(true);
if (!confirm("删除节点 " + id + "(若是直线中间节点,会自动把前后接上)")) return;
ctx.deleteNode(id);
} }, ["删除此节点"]),
]));
};