mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 00:49:41 +02:00
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:
+11
-1
@@ -773,10 +773,20 @@ class ClaudemanApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!prompt) {
|
if (!prompt) {
|
||||||
alert('Please enter a prompt');
|
this.showToast('Please enter a prompt', 'warning');
|
||||||
return;
|
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.setRunning(true);
|
||||||
this.terminal.writeln('');
|
this.terminal.writeln('');
|
||||||
this.terminal.writeln(`\x1b[1;36m─── Starting: ${prompt.substring(0, 60)}${prompt.length > 60 ? '...' : ''} ───\x1b[0m`);
|
this.terminal.writeln(`\x1b[1;36m─── Starting: ${prompt.substring(0, 60)}${prompt.length > 60 ? '...' : ''} ───\x1b[0m`);
|
||||||
|
|||||||
Reference in New Issue
Block a user