feat: Add Retry button to chat plans and Cancel AI button to build screen
- Added a 'Retry' button to plan messages in chat, allowing one-click rejection and regeneration. - Added a 'Cancel AI' button to the Building screen to abort stuck or unwanted build processes.
This commit is contained in:
@@ -3409,6 +3409,17 @@ const LogMessage = ({ message, type }: { message: string, type: 'user' | 'system
|
||||
<Icons.Check className="w-3.5 h-3.5" />
|
||||
<span className="text-[10px] font-bold">APPROVE & BUILD</span>
|
||||
</button>
|
||||
<button
|
||||
onClick={() => {
|
||||
if (planSignature) dispatch({ type: 'RESOLVE_PLAN', signature: planSignature, resolution: 'rejected' });
|
||||
dispatch({ type: 'START_REQUEST', sessionId: Date.now().toString(), messageDraft: "Please retry and regenerate the plan." });
|
||||
}}
|
||||
className="p-1.5 hover:bg-amber-500/20 bg-amber-500/10 text-amber-400 rounded-md transition-colors flex items-center gap-1.5 px-3"
|
||||
title="Reject and Retry"
|
||||
>
|
||||
<Icons.RefreshCw className="w-3.5 h-3.5" />
|
||||
<span className="text-[10px] font-bold">RETRY</span>
|
||||
</button>
|
||||
<button onClick={handleEditToggle} className="p-1.5 hover:bg-blue-500/20 bg-blue-500/10 text-blue-400 rounded-md transition-colors">
|
||||
<Icons.MessageSquare className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
|
||||
@@ -836,9 +836,24 @@ export const PlanView = () => {
|
||||
cursorBlinking: 'smooth'
|
||||
}}
|
||||
/>
|
||||
<div className="absolute bottom-4 right-4 bg-black/80 backdrop-blur border border-white/10 rounded-lg px-3 py-1.5 text-xs font-mono text-primary flex items-center gap-2">
|
||||
<Icons.Sparkles className="w-3 h-3 animate-pulse" />
|
||||
Receiving Packets...
|
||||
<div className="absolute bottom-4 right-4 flex items-center gap-2">
|
||||
<button
|
||||
onClick={() => {
|
||||
if (confirm('Abort current build process?')) {
|
||||
dispatch({ type: 'SET_STATE', state: OrchestratorState.ProjectSelected });
|
||||
dispatch({ type: 'UPDATE_STREAMING_CODE', code: null });
|
||||
dispatch({ type: 'ADD_LOG', log: { id: Date.now().toString(), timestamp: Date.now(), type: 'system', message: 'User aborted the build process.' } });
|
||||
}
|
||||
}}
|
||||
className="bg-zinc-900/90 hover:bg-zinc-800 text-xs text-zinc-400 hover:text-rose-400 border border-white/10 rounded-lg px-3 py-1.5 transition-colors flex items-center gap-2 shadow-xl backdrop-blur-md"
|
||||
>
|
||||
<Icons.ZapOff className="w-3.5 h-3.5" />
|
||||
Cancel AI
|
||||
</button>
|
||||
<div className="bg-black/80 backdrop-blur border border-white/10 rounded-lg px-3 py-1.5 text-xs font-mono text-primary flex items-center gap-2">
|
||||
<Icons.Sparkles className="w-3 h-3 animate-pulse" />
|
||||
Receiving Packets...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user