Prasanth345 opened a new pull request, #54722: URL: https://github.com/apache/airflow/pull/54722
### Summary This PR addresses [#53458](https://github.com/apache/airflow/issues/53458) by introducing task filtering options in both **Graph** and **Grid** views to improve task visualization and debugging. Users can now filter the DAG to display: - Only upstream tasks - Only downstream tasks - Both upstream & downstream tasks - All tasks (default) ### Implementation Details - **Graph View** - Added support for filtering visible nodes and edges based on selected task. - Users can toggle upstream, downstream, or both via a dropdown. - **Grid View** - Built adjacency maps (`upstreamMap` and `downstreamMap`) from DAG structure data. - Implemented DFS traversal to collect upstream and downstream task chains. - Introduced `visibleIds` logic to selectively show tasks based on filter selection. - Ensured group nodes remain visible to preserve layout. - **UI Enhancements** - Added a `Filter` dropdown with options: - **Filter Dag by task** (label for "all") - **Only upstream** - **Only downstream** - **Both upstream & downstream** - Improved `ActionButton` so display text (`buttonLabel`) can differ from dropdown item label. ### Testing - Verified filtering in both **Graph** and **Grid** views. - Confirmed correct upstream/downstream traversal. - Checked that "all" restores full DAG display with button label as "Filter Dag by task". ### Why This improves DAG observability by letting users focus on relevant upstream/downstream chains. It is especially useful for large DAGs where visual noise makes debugging difficult. ### Related Issue Closes https://github.com/apache/airflow/issues/53458 -- 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]
