Skip to content

UI: Keep grid and log filters when switching detail tabs - #76483

Open
bbovenzi wants to merge 2 commits into
apache:mainfrom
astronomer:fix-log-filters-reset-on-tab-change
Open

bbovenzi wants to merge 2 commits into
apache:mainfrom
astronomer:fix-log-filters-reset-on-tab-change

Conversation

@bbovenzi

@bbovenzi bbovenzi commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Filters you set in the grid, gantt, graph or task log were lost whenever you switched tabs on a Dag, run or task instance page, even though the panel they filter stays on screen. Now they stay.

What changes

  • Tab links on the Dag, run and task instance pages carry the grid, gantt, graph, task stream and log filters. The keys live in one list, constants/persistentSearchParams.ts, so a new filter only needs adding there.
  • Paging and sorting are not carried, since they belong to one tab's table.
  • The log search moves into the URL (log_search), so it survives tab changes and a filtered log can be shared as a link.
  • Grid filters that match a tab's own table also filter it, for example state and run_type on the Runs tab.
  • XCom and Task Instances ignore a carried-over run id pattern when the page is already scoped to one run, so a filter you can't see can't empty the table.

Before / after

Same scripted clicks on main and on this branch: grid filtered to State: Failed, then Overview → Details → Code; then a task log filtered to INFO and searched for "bundles", then Logs → XCom → Logs.

filters-before-after-side-by-side

Testing

  • New tests in NavTabs, Logs, XCom and TaskInstances cover which filters are carried, what is left behind, and the run id pattern case.
  • pnpm lint, pnpm format and the pre-commit hooks pass; the affected test files pass locally.
  • Checked by hand against a local api-server with example Dags.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code following the guidelines

@bbovenzi bbovenzi added the backport-to-v3-4-test Backport to v3-4-test label Nov 4, 2026
@bbovenzi bbovenzi added this to the Airflow 3.4.1 milestone Nov 4, 2026
Tab links on the dag, run and task instance pages rebuild the query
string from scratch, so any filter set in the grid, gantt, graph or task
log was dropped on every tab change, even though the panel it filters
stays on screen. Switching task instances kept them only because grid
links carry the params forward.

The details layout now hands NavTabs the keys its panel owns, and NavTabs
copies them onto every tab link. Those keys live in one list per source,
read by the filters that write them and the views that apply them, with
date ranges resolved to their start and end keys through the filter
config, so a new filter is carried without a second list to keep in
sync. Table paging and sorting stay behind, since they belong to one
tab's list, and the browse and asset tabs carry nothing, as before.

The log search query moves into the url (debounced), so it survives the
unmount a tab change causes and a filtered log can be shared as a link.

The XCom and Task Instances tables applied a run id pattern even with a
run pinned by the route, where they offer no run id filter to clear it,
so a pattern carried from the grid could empty them. They now apply it
only on their lists across runs.

Co-Authored-By: Claude <noreply@anthropic.com>
@bbovenzi
bbovenzi force-pushed the fix-log-filters-reset-on-tab-change branch from 71c727c to 7a203e1 Compare November 5, 2026 15:22
@bbovenzi
bbovenzi marked this pull request as ready for review November 5, 2026 18:33
Opening one map index from the mapped task instances table or the
breadcrumb map index picker built the link from the region alone, so a
log source, level or search set on the logs tab was gone by the time the
instance's logs loaded, even though the same filters survive a tab
change on that page. Those links now carry the panel's filters the way
tab links do, while still leaving the list's paging and the previous
try and region behind.

Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant