mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-22 21:48:12 -05:00
feat(frontend): Hide pending reviews panel while execution is RUNNING/QUEUED
Defense in depth: prevent users from seeing/clicking review panel before execution pauses for review. Before: - Reviews panel could show while execution is RUNNING - User could click to open panel and see pending reviews - Confusing UX: why are reviews shown if graph hasn't paused yet? - Could lead to frustration when backend rejects the approval attempt After: - Panel hidden if execution status is RUNNING or QUEUED - Panel only shows when status is REVIEW (paused for review) - Clear UX: reviews appear only when execution needs user input Benefits: 1. **Better UX**: No confusion about when to approve reviews 2. **Prevents invalid attempts**: User can't try to approve while running 3. **Works with backend validation**: Frontend hides, backend rejects 4. **Clear state**: Panel visibility directly matches execution state Changes: - Added status check: hide if RUNNING or QUEUED - Panel shows only when execution has paused (REVIEW/INCOMPLETE) - Existing polling logic still works for real-time updates
This commit is contained in:
@@ -84,11 +84,26 @@ export function FloatingReviewsPanel({
|
||||
}
|
||||
}, [executionDetails?.status, executionId, refetch]);
|
||||
|
||||
// Hide panel if:
|
||||
// 1. No execution ID
|
||||
// 2. No pending reviews and not in REVIEW status
|
||||
// 3. Execution is RUNNING or QUEUED (hasn't paused for review yet)
|
||||
if (!executionId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (
|
||||
!executionId ||
|
||||
(!isLoading &&
|
||||
pendingReviews.length === 0 &&
|
||||
executionDetails?.status !== AgentExecutionStatus.REVIEW)
|
||||
!isLoading &&
|
||||
pendingReviews.length === 0 &&
|
||||
executionDetails?.status !== AgentExecutionStatus.REVIEW
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Don't show panel while execution is still running/queued (not paused for review)
|
||||
if (
|
||||
executionDetails?.status === AgentExecutionStatus.RUNNING ||
|
||||
executionDetails?.status === AgentExecutionStatus.QUEUED
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user