fix(ci): blink Gitea CI indicator only during actively running workflow runs

This commit is contained in:
2026-10-03 21:44:17 +02:00
parent 1b8677734b
commit cab2931461
2 changed files with 52 additions and 10 deletions
+35 -6
View File
@@ -642,8 +642,9 @@
}
};
// Live Kanban Counts on Whiteboard
// Live Kanban Counts & CI State
let kanbanState = { planned: 3, ready: 1, in_progress: 0, review: 2, done: 12 };
let giteaCiState = { active_jobs: 0, status: 'PASSING' };
function addLog(text) {
const logBox = document.getElementById('eventLog');
@@ -705,6 +706,12 @@
const wipElem = document.getElementById('giteaWip');
if (wipElem) wipElem.innerText = kanbanState.in_progress || 0;
}
if (data.gitea.ci_status !== undefined) {
giteaCiState = {
active_jobs: data.gitea.active_ci_jobs || 0,
status: data.gitea.ci_status || 'PASSING'
};
}
// 4. Update Agents
if (data.agents) {
@@ -1096,12 +1103,34 @@
ctx.beginPath(); ctx.arc(f.x + 15, f.y + 40, 4, 0, Math.PI*2); ctx.fill();
ctx.beginPath(); ctx.arc(f.x + 35, f.y + 46, 4, 0, Math.PI*2); ctx.fill();
const ciPass = Math.sin(time * 0.01) > 0;
ctx.fillStyle = ciPass ? "#22c55e" : "#16a34a";
ctx.fillRect(f.x + 48, f.y + 18, 18, 10);
// Gitea CI Indicator
const isCiActive = (giteaCiState.active_jobs > 0 || giteaCiState.status === 'BUILDING');
let ciColor = "#22c55e"; // Solid Green when idle/passing
if (isCiActive) {
// Blink/pulsate only while a workflow is actively running
const ciBlink = Math.sin(time * 0.015) > 0;
ciColor = ciBlink ? "#fbbf24" : "#d97706";
} else if (giteaCiState.status === 'FAILURE') {
ciColor = "#ef4444";
}
ctx.fillStyle = ciColor;
ctx.fillRect(f.x + 48, f.y + 18, 20, 11);
ctx.strokeStyle = "rgba(0,0,0,0.4)";
ctx.lineWidth = 1;
ctx.strokeRect(f.x + 48, f.y + 18, 20, 11);
ctx.font = "8px 'Press Start 2P'";
ctx.fillStyle = "#fff";
ctx.fillText("CI", f.x + 51, f.y + 26);
ctx.fillStyle = isCiActive ? "#0f172a" : "#ffffff";
ctx.fillText("CI", f.x + 52, f.y + 27);
// Optional mini job counter indicator if building
if (isCiActive && giteaCiState.active_jobs > 0) {
ctx.font = "9px 'VT323'";
ctx.fillStyle = "#fbbf24";
ctx.fillText(`⚡${giteaCiState.active_jobs}`, f.x + 48, f.y + 40);
}
ctx.font = "11px 'Press Start 2P'";
ctx.fillStyle = "#38bdf8";