fix: only show Complete status when all todos are done

Previously the Ralph tracker showed "Complete" whenever a completion phrase
was detected, even if tasks were still pending. Now it only shows "Complete"
when all todos are actually marked completed (100%).

Shows "Tracking" when:
- Tracker is enabled with pending tasks
- Completion phrase detected but tasks remain

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-20 16:05:37 +01:00
co-authored by Claude Opus 4.5
parent 1cd68cabaf
commit 3646c3b34a
+6 -5
View File
@@ -2093,8 +2093,8 @@ class ClaudemanApp {
// Update progress rings
this.updateRalphRing(percent);
// Update status badge
this.updateRalphStatus(state?.loop);
// Update status badge (pass completion info)
this.updateRalphStatus(state?.loop, completed, total);
// Update stats
this.updateRalphStats(state?.loop, completed, total);
@@ -2146,7 +2146,7 @@ class ClaudemanApp {
}
}
updateRalphStatus(loop) {
updateRalphStatus(loop, completed = 0, total = 0) {
const badge = this.$('ralphStatusBadge');
const statusText = badge?.querySelector('.ralph-status-text');
if (!badge || !statusText) return;
@@ -2156,10 +2156,11 @@ class ClaudemanApp {
if (loop?.active) {
badge.classList.add('active');
statusText.textContent = 'Running';
} else if (loop?.completionPhrase && !loop?.active) {
} else if (total > 0 && completed === total) {
// Only show "Complete" when all todos are actually done
badge.classList.add('completed');
statusText.textContent = 'Complete';
} else if (loop?.enabled) {
} else if (loop?.enabled || total > 0) {
badge.classList.add('tracking');
statusText.textContent = 'Tracking';
} else {