') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Add filtering for tasks view by dstandish · Pull Request #54484 · apache/airflow · GitHub
Skip to content

Add filtering for tasks view - #54484

Merged
bbovenzi merged 27 commits into
apache:mainfrom
astronomer:add-filtering-for-tasks-view
Aug 26, 2025
Merged

Add filtering for tasks view#54484
bbovenzi merged 27 commits into
apache:mainfrom
astronomer:add-filtering-for-tasks-view

Conversation

@dstandish

@dstandishdstandish commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

Closes#53048

Adds some filters in the tasks view.

I elected not to add a new endpoint but just to filter what was there as a good first improvement. I think adding the endpoint introduces meaningful complexity and some questions and ambiguities that would need to be resolved.

I also didn't add the time-based filtering for the same reason. It's not how the current endpoint works, and I think adding time-based filtering would require more refactoring and more thought about the interface.

All other filters in the ticket, however, I have added.

update

I added basic task-name search filter and refactored the filters into a separate component like done with DagsList

tasks.filters.mov

@boring-cyborgboring-cyborgBot added area:translations area:UI Related to UI/UX. For Frontend Developers. translation:default labels Aug 13, 2025
@dstandishdstandish self-assigned this Aug 14, 2025
@dstandish
dstandish marked this pull request as ready for review August 15, 2025 04:18
@dstandishdstandish changed the title WIP - Add filtering for tasks viewAdd filtering for tasks viewAug 15, 2025

@bbovenzibbovenzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

Left a few comments. This was always an awkward page. I think we should also show more Task info on the page. Like the card view doesn't show Retry or Mapped info. Is there anything else you would want to see here? I'd imagine a search by task_id would be very valuable!

Comment threadairflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx Outdated
Comment threadairflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx Outdated
Comment threadairflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx Outdated

@pierrejeambrunpierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Just a few comments:
We need some margin between the two rows
Screenshot 2025-08-21 at 10 55 10

'reset' filter button doesn't seem to reset the search field

When filling multiple values, it doesn't display well:
https://github.com/user-attachments/assets/b138ad6a-5374-470d-9ee4-da2543488dab

Comment threadairflow-core/src/airflow/ui/src/pages/Dag/Tasks/TaskFilters.tsx Outdated
@dstandish

Copy link
Copy Markdown
ContributorAuthor

Nice!

Just a few comments: We need some margin between the two rows Screenshot 2025-08-21 at 10 55 10

'reset' filter button doesn't seem to reset the search field

When filling multiple values, it doesn't display well: https://github.com/user-attachments/assets/b138ad6a-5374-470d-9ee4-da2543488dab

I don't really know how to fix these things quickly and I need to move on to asset partitioning unfortunately. Fancy adding to this PR?

@dstandish

Copy link
Copy Markdown
ContributorAuthor

ok i fixed most of the things

the search bar thing ---- basically, it has internal calls to useState, so it cannot be driven exclusively by changes to searchParams

if we're always going to use searchParams, probably it should not use its own state store -- seems like if you do that then the only way to clear the search bar is to click the X

i also didn't mess with the filter court -- this could be done as followup i suppose

i added a justify to improve the horizontal spacing . it's not perfect but it's better. if you have fixes feel free to push em. otherwise maybe we can just merge this and anyone with time can tweak and refine?

@dstandish

Copy link
Copy Markdown
ContributorAuthor

alternatively i can just remove the text search -- it was not part of the original ticket

@waqas-saeed

waqas-saeed commented Aug 21, 2025

Copy link
Copy Markdown

Hi @dstandish in your video I can see this toggle button in the middle in black colour. it looks like you can use it to hide details page on the right. is that correct?
which airflow version are you using for this? I'm running 3.0.4 and I can't see it in my airflow
image

@pierrejeambrun

pierrejeambrun commented Aug 22, 2025

Copy link
Copy Markdown
Member

As discussed, don't mind the search bar reset value as this is not related to this PR but to how search bar work, we need to solve it in a follow up.

@dstandish

Copy link
Copy Markdown
ContributorAuthor

As discussed, don't my the search bar reset value as this is not related to this PR but to how search bar work, we need to solve it in a follow up.

Yeah I noticed also with dags list, the reset button does not reset the search filters.

Let me know if there's anything further you need me to change in this one.

Thanks

@dstandish

Copy link
Copy Markdown
ContributorAuthor

hey @bbovenzi@pierrejeambrun if y'all want to take another pass and see if there's anything left to do so we can close this out?

@bbovenzibbovenzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made some small changes. now it looks good

@bbovenzibbovenzi added this to the Airflow 3.1.0 milestone Aug 26, 2025
@bbovenzi
bbovenzi merged commit ee4357e into apache:mainAug 26, 2025
55 checks passed
@bbovenzi
bbovenzi deleted the add-filtering-for-tasks-view branch August 26, 2025 15:37
@dstandish

Copy link
Copy Markdown
ContributorAuthor

made some small changes. now it looks good

thanks @bbovenzi

mangal-vairalkar pushed a commit to mangal-vairalkar/airflow that referenced this pull request Aug 30, 2025
* Add filtering by operator name
* fixup! Add filtering by operator name
* get things working and use translate
* make it more generic
* add reset button and fix some checks
* fix pre-commit checks
* add multi select
* rename multi-select
* add trigger rules
* don't need filter count
* add retry values filters
* add mapped
* improve display for mapped selection
* add prefix
* fix logic
* use url params for filter state
* add translation
* extract taskfilters into distinct component
* fix import after rebase
* add search
* make the filter stack responsive
* fixes
* fixes
* add missing file
* add justify
* Update filters
---------
Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
bggwak pushed a commit to bggwak/airflow that referenced this pull request Sep 2, 2025
* Add filtering by operator name
* fixup! Add filtering by operator name
* get things working and use translate
* make it more generic
* add reset button and fix some checks
* fix pre-commit checks
* add multi select
* rename multi-select
* add trigger rules
* don't need filter count
* add retry values filters
* add mapped
* improve display for mapped selection
* add prefix
* fix logic
* use url params for filter state
* add translation
* extract taskfilters into distinct component
* fix import after rebase
* add search
* make the filter stack responsive
* fixes
* fixes
* add missing file
* add justify
* Update filters
---------
Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
@Pei-Cheng-YuPei-Cheng-Yu mentioned this pull request Oct 21, 2025
10 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:translationsarea:UIRelated to UI/UX. For Frontend Developers.translation:default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Filters] Add filters to DAG View - Tasks Tab

4 participants

@dstandish@waqas-saeed@pierrejeambrun@bbovenzi