diff --git a/web/app.js b/web/app.js index 915716c..3820116 100644 --- a/web/app.js +++ b/web/app.js @@ -1191,14 +1191,14 @@ function renderTranscript(messages) { function renderPreview() { const root = $('#previewRoot'); if (!S.previewId) { root.hidden = true; root.innerHTML = ''; return; } - const t = S.approvals.find((x) => x.id === S.previewId) || S.tasks.find((x) => x.id === S.previewId); + const task = S.approvals.find((x) => x.id === S.previewId) || S.tasks.find((x) => x.id === S.previewId); // 任务已离开闸(被裁决/状态变化)→ 自动关闭 - if (!t || !GATE_OF[t.status]) { S.previewId = null; S.previewReject = false; root.hidden = true; root.innerHTML = ''; return; } - const gate = GATE_OF[t.status]; + if (!task || !GATE_OF[task.status]) { S.previewId = null; S.previewReject = false; root.hidden = true; root.innerHTML = ''; return; } + const gate = GATE_OF[task.status]; const pp = S.projects.find((x) => x.id === S.currentProjectId); const defBranch = pp ? pp.defaultBranch : 'main'; const onlyPassBtn = gate === 'exec' - ? `` + ? `` : ''; root.hidden = false; root.innerHTML = ` @@ -1206,28 +1206,28 @@ function renderPreview() {
${gateLabel(gate)} - ${esc(t.title)} - ${cplxBadge(t.complexity)} - ${statusChip(t.status)} + ${esc(task.title)} + ${cplxBadge(task.complexity)} + ${statusChip(task.status)}
-
${gateDocs(t)}
+
${gateDocs(task)}
- ${onlyPassBtn} - + ${onlyPassBtn} + ${gate === 'exec' ? `${t('gateMergeNote', { branch: esc(defBranch) })}` : ''} - id ${esc(t.id)} · ${fmtTime(t.updatedAt)} + id ${esc(task.id)} · ${fmtTime(task.updatedAt)} ${S.previewReject ? `
- - - + + +
` : ''}
`; if (S.previewReject) { - const ta = document.getElementById(`prev-rej-${t.id}`); + const ta = document.getElementById(`prev-rej-${task.id}`); if (ta) ta.focus(); } }