mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-03 22:19:42 +02:00
feat(tracker): disable Ralph Wiggum tracker by default, auto-enable on detection
The InnerLoopTracker is now disabled by default and auto-enables when Ralph-related patterns are detected: - /ralph-loop command - <promise>PHRASE</promise> completion phrases - TodoWrite tool usage - Iteration patterns (Iteration 5/50, [5/50]) - Todo checkboxes (- [ ]/- [x]) or indicator icons This reduces noise for sessions that don't use Ralph loops while maintaining full functionality when loops are detected. Changes: - Add `enabled` property to InnerLoopState type - Add enable()/disable() methods to InnerLoopTracker - Implement shouldAutoEnable() for pattern detection - Update frontend to show "Tracking" status when enabled - Add CSS for tracking state indicator - Update CLAUDE.md documentation - Add comprehensive tests for auto-enable behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1919,10 +1919,12 @@ class ClaudemanApp {
|
||||
const state = this.innerStates.get(this.activeSessionId);
|
||||
|
||||
// Check if there's anything to show
|
||||
// Only show panel if tracker is enabled OR there's active state to display
|
||||
const isEnabled = state?.loop?.enabled === true;
|
||||
const hasLoop = state?.loop?.active || state?.loop?.completionPhrase;
|
||||
const hasTodos = state?.todos?.length > 0;
|
||||
|
||||
if (!hasLoop && !hasTodos) {
|
||||
if (!isEnabled && !hasLoop && !hasTodos) {
|
||||
panel.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
@@ -1996,7 +1998,7 @@ class ClaudemanApp {
|
||||
const statusText = badge?.querySelector('.ralph-status-text');
|
||||
if (!badge || !statusText) return;
|
||||
|
||||
badge.classList.remove('active', 'completed');
|
||||
badge.classList.remove('active', 'completed', 'tracking');
|
||||
|
||||
if (loop?.active) {
|
||||
badge.classList.add('active');
|
||||
@@ -2004,6 +2006,9 @@ class ClaudemanApp {
|
||||
} else if (loop?.completionPhrase && !loop?.active) {
|
||||
badge.classList.add('completed');
|
||||
statusText.textContent = 'Complete';
|
||||
} else if (loop?.enabled) {
|
||||
badge.classList.add('tracking');
|
||||
statusText.textContent = 'Tracking';
|
||||
} else {
|
||||
statusText.textContent = 'Idle';
|
||||
}
|
||||
|
||||
@@ -556,6 +556,10 @@ body {
|
||||
background: var(--green);
|
||||
}
|
||||
|
||||
.ralph-status-badge.tracking .ralph-status-dot {
|
||||
background: var(--yellow);
|
||||
}
|
||||
|
||||
@keyframes ralph-pulse {
|
||||
0%, 100% { opacity: 1; transform: scale(1); }
|
||||
50% { opacity: 0.6; transform: scale(1.2); }
|
||||
|
||||
Reference in New Issue
Block a user