From aea97db4853c91793ddac6c123a23bc0fc0120ea Mon Sep 17 00:00:00 2001 From: Zamil Majdy Date: Thu, 22 Jan 2026 18:22:33 -0500 Subject: [PATCH] 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 --- .../FloatingReviewsPanel.tsx | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/autogpt_platform/frontend/src/components/organisms/FloatingReviewsPanel/FloatingReviewsPanel.tsx b/autogpt_platform/frontend/src/components/organisms/FloatingReviewsPanel/FloatingReviewsPanel.tsx index 99b8ff9049..4805508054 100644 --- a/autogpt_platform/frontend/src/components/organisms/FloatingReviewsPanel/FloatingReviewsPanel.tsx +++ b/autogpt_platform/frontend/src/components/organisms/FloatingReviewsPanel/FloatingReviewsPanel.tsx @@ -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; }