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

bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 99bdeabe3db Show the filtered task count in the Dag Tasks tab heading 
(#75448)
99bdeabe3db is described below

commit 99bdeabe3db437997d8d3c16353217fdaa350761
Author: 김난희 <[email protected]>
AuthorDate: Fri Oct 23 23:57:59 2026 +0900

    Show the filtered task count in the Dag Tasks tab heading (#75448)
    
    The Tasks tab filters the task list client-side (operator, trigger rule,
    retries, mapped, name search) but passed the API's total_entries to the
    DataTable heading, so the heading kept reporting the unfiltered count
    ("12 Tasks") even when a search narrowed the list to a single task.
    Pass the filtered list's length instead, as Configs.tsx already does for
    its client-built list, and assert the count in the existing filter tests.
    
    Co-authored-by: Claude Fable 5.1 <[email protected]>
---
 airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.test.tsx | 3 +++
 airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx      | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.test.tsx 
b/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.test.tsx
index 897e1e831fb..5b3070c7930 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.test.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.test.tsx
@@ -74,6 +74,7 @@ const renderTasks = async () => {
   );
 
   await waitFor(() => expect(getTaskNames()).toEqual(["extract", "transform", 
"load"]));
+  expect(screen.getByRole("heading")).toHaveTextContent("3 common:task");
 };
 
 const selectOption = async (filterTestId: string, option: string) => {
@@ -97,6 +98,7 @@ describe("Dag tasks filters", () => {
       await selectOption(filterTestId, option);
 
       await waitFor(() => expect(getTaskNames()).toEqual(expected));
+      
expect(screen.getByRole("heading")).toHaveTextContent(`${expected.length} 
common:task`);
     },
   );
 
@@ -106,5 +108,6 @@ describe("Dag tasks filters", () => {
     fireEvent.change(screen.getByPlaceholderText("searchTasks"), { target: { 
value: "trans" } });
 
     await waitFor(() => expect(getTaskNames()).toEqual(["transform"]));
+    expect(screen.getByRole("heading")).toHaveTextContent("1 common:task");
   });
 });
diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx 
b/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx
index 6b64835458b..dd67ec0f833 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx
@@ -139,7 +139,7 @@ export const Tasks = () => {
         filterActions={<TaskFilters tasksData={data} />}
         isLoading={isLoading}
         modelName="common:task"
-        total={data ? data.total_entries : 0}
+        total={filteredTasks.length}
       />
     </>
   );

Reply via email to