From 3fc19e47c49fbe7967bfdcc5b369e5e33172ec76 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Sat, 13 Jun 2026 09:40:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E4=BB=BB=E5=8A=A1=E6=A0=91/?= =?UTF-8?q?=E7=88=B6=E4=BB=BB=E5=8A=A1=E4=B8=8B=E6=8B=89=E5=AF=B9=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=20depth/id=20=E5=8A=A0=E5=9B=BA,=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E6=95=B4=E9=A1=B5=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit renderParentOptions 的 '· '.repeat(depth-1) 在 depth=0 时抛 RangeError(Invalid count value)、 renderNode 的 t.id.slice(-6) 在 id 缺失时抛 TypeError——任一都会让看板整页崩。 改为 repeat(Math.max(0,(depth||1)-1)) 与 String(t.id||'').slice。 (node:vm + 最小 DOM harness 复现并验证) Co-Authored-By: Claude Opus 4.8 --- web/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app.js b/web/app.js index 1afb48c..a874591 100644 --- a/web/app.js +++ b/web/app.js @@ -856,7 +856,7 @@ function renderTree() {
${caret} - ${esc(t.title)}${esc(t.id.slice(-6))} + ${esc(t.title)}${esc(String(t.id || '').slice(-6))} ${(() => { // blocked(系统按依赖自动落位)→ 显示在等哪几条 @@ -1000,7 +1000,7 @@ function renderParentOptions() { const sel = document.querySelector('#newTaskPanel select[name=parentId]'); const cur = sel.value; sel.innerHTML = `` + - S.tasks.map((t) => ``).join(''); + S.tasks.map((t) => ``).join(''); sel.value = cur; }