nanheekim-ovo opened a new pull request, #75448:
URL: https://github.com/apache/airflow/pull/75448
### Why
On the Dag page, the **Tasks** tab filters the task list client-side
(operator, trigger rule, retries, mapped, and the name search box), but the
row-count heading above the table was fed the API's `total_entries`. The
heading therefore never changed as filters narrowed the list: with 12 tasks in
the Dag and a search that leaves a single row, it still read "12 Tasks"!
The `total` line predates the filters (#44604); client-side filtering was
added in #54484 without touching it, and the heading became default-on in
#57680, which is when the mismatch became visible.
### How
This passes `filteredTasks.length` as the `DataTable` `total` instead, so
the heading follows the rows the table shows. That matches `Configs.tsx` and
`VersionDiff.tsx`, which already pass the length of a client-built list. `GET
/dags/{dag_id}/tasks` only accepts `order_by` and returns every task with
`total_entries = len(tasks)`, so nothing else on this page depended on the
server total, and the Tasks tab has no offset pagination that could be affected.
The existing filter tests now also assert the heading count after each
filter and after a name search; they fail on `main` and pass with this change.
Observed on Airflow 3.2.2; the same line is on `main`.
### Local results
**Before PR screenshots**
<img width="1280" height="800" alt="before_all"
src="https://github.com/user-attachments/assets/7b39d2c8-f2b7-49fc-8de8-bfaa5053065e"
/>
<img width="1280" height="800" alt="before_operator_bash"
src="https://github.com/user-attachments/assets/5c802afe-79dc-4fd9-a9f2-298a12d3869e"
/>
<img width="1280" height="800" alt="before_search_runme"
src="https://github.com/user-attachments/assets/0edef166-f055-4766-84c3-7d9977975510"
/>
**After PR screenshots**
<img width="1280" height="800" alt="after_all"
src="https://github.com/user-attachments/assets/1165b8cd-9e20-4a6b-ba8a-0d889dea3650"
/>
<img width="1280" height="800" alt="after_operator_bash"
src="https://github.com/user-attachments/assets/377c2e4b-c0fa-4f96-a631-19eee3d8a334"
/>
<img width="1280" height="800" alt="after_search_runme"
src="https://github.com/user-attachments/assets/6504465e-1664-4f1c-a194-5003df4b8c46"
/>
Since this is my first time, there may be some shortcomings.
Please let me know if anything needs to be revised.
Thank you!
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (Claude Code Fable 5.1 Use)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]