This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit bb09da4770d9318912bc2b12f34baf6d56242bde
Author: Brent Bovenzi <[email protected]>
AuthorDate: Thu Sep 11 16:22:45 2025 -0600

    Add autorefresh to Required Actions button (#55543)
    
    * Add autorefresh to Required Actions button
    
    * Add deferred filter for pending reviews
    
    (cherry picked from commit 20e2b6c7a53e7bad9371e6b74b6c2fe5cda2a80c)
---
 .../airflow/ui/src/components/NeedsReviewButton.tsx | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx 
b/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
index 78b246f3e36..3ceadb7b55a 100644
--- a/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
+++ b/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
@@ -21,6 +21,7 @@ import { useTranslation } from "react-i18next";
 import { LuUserRoundPen } from "react-icons/lu";
 
 import { useHumanInTheLoopServiceGetHitlDetails } from "openapi/queries";
+import { useAutoRefresh } from "src/utils/query";
 
 import { StatsCard } from "./StatsCard";
 
@@ -33,12 +34,20 @@ export const NeedsReviewButton = ({
   readonly runId?: string;
   readonly taskId?: string;
 }) => {
-  const { data: hitlStatsData, isLoading } = 
useHumanInTheLoopServiceGetHitlDetails({
-    dagId,
-    dagRunId: runId,
-    responseReceived: false,
-    taskId,
-  });
+  const refetchInterval = useAutoRefresh({ dagId });
+  const { data: hitlStatsData, isLoading } = 
useHumanInTheLoopServiceGetHitlDetails(
+    {
+      dagId,
+      dagRunId: runId,
+      responseReceived: false,
+      state: ["deferred"],
+      taskId,
+    },
+    undefined,
+    {
+      refetchInterval,
+    },
+  );
 
   const hitlTIsCount = hitlStatsData?.hitl_details.length ?? 0;
   const { i18n, t: translate } = useTranslation("hitl");

Reply via email to