feat(ui): add enable/disable toggle for Ralph Wiggum tracker

Add ability to enable/disable the Ralph tracker:
- Per-session toggle in Session Options > Ralph Wiggum tab
- Global default toggle in App Settings

Changes:
- Add "Enable Tracker" toggle to ralph-tab in session options modal
- Add "Enable Ralph Wiggum Tracker" toggle to app settings modal
- Update /api/sessions/:id/inner-config endpoint to handle `enabled` param
- Add CSS for toggle switch component
- New sessions inherit global setting from app settings
- Setting is saved in innerConfig and synced with backend

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-19 18:56:34 +01:00
co-authored by Claude Opus 4.5
parent 6a414a2648
commit fc319d8987
4 changed files with 123 additions and 1 deletions
+12 -1
View File
@@ -245,7 +245,8 @@ export class WebServer extends EventEmitter {
// Configure inner loop (Ralph Wiggum) settings
this.app.post('/api/sessions/:id/inner-config', async (req) => {
const { id } = req.params as { id: string };
const { completionPhrase, maxIterations, maxTodos, todoExpirationMinutes } = req.body as {
const { enabled, completionPhrase, maxIterations, maxTodos, todoExpirationMinutes } = req.body as {
enabled?: boolean;
completionPhrase?: string;
maxIterations?: number;
maxTodos?: number;
@@ -257,6 +258,15 @@ export class WebServer extends EventEmitter {
return { success: false, error: 'Session not found' };
}
// Enable/disable the tracker
if (enabled !== undefined) {
if (enabled) {
session.innerLoopTracker.enable();
} else {
session.innerLoopTracker.disable();
}
}
// Configure the inner loop tracker
if (completionPhrase !== undefined) {
// Start loop with completion phrase to set it up for watching
@@ -271,6 +281,7 @@ export class WebServer extends EventEmitter {
// Store additional config on session for reference
(session as any).innerConfig = {
enabled: enabled ?? session.innerLoopTracker.enabled,
completionPhrase: completionPhrase || '',
maxIterations: maxIterations || 0,
maxTodos: maxTodos || 50,