feat(ui): add confirmation for long timed runs

- Add confirmation dialog for runs 30+ minutes
- Show duration in human-readable format (hours/minutes)
- Replace alert with toast for empty prompt warning

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-18 22:32:45 +01:00
co-authored by Claude Opus 4.5
parent bc72bccc85
commit 4678e78b95
+11 -1
View File
@@ -773,10 +773,20 @@ class ClaudemanApp {
}
if (!prompt) {
alert('Please enter a prompt');
this.showToast('Please enter a prompt', 'warning');
return;
}
// Confirm for long runs (over 30 minutes)
if (duration >= 30) {
const hours = Math.floor(duration / 60);
const mins = duration % 60;
const timeStr = hours > 0 ? `${hours}h ${mins}m` : `${mins} minutes`;
if (!confirm(`Start a ${timeStr} timed run? This will use API credits for the duration.`)) {
return;
}
}
this.setRunning(true);
this.terminal.writeln('');
this.terminal.writeln(`\x1b[1;36m─── Starting: ${prompt.substring(0, 60)}${prompt.length > 60 ? '...' : ''} ───\x1b[0m`);