Skip to content

feat(ui): Persist DAGs list match anywhere search toggle in URL - #74014

Closed
jhaabhijeet864 wants to merge 2 commits into
apache:mainfrom
jhaabhijeet864:feat/73772-match-anywhere-url-param
Closed

jhaabhijeet864 wants to merge 2 commits into
apache:mainfrom
jhaabhijeet864:feat/73772-match-anywhere-url-param

Conversation

@jhaabhijeet864

Copy link
Copy Markdown

Why this is needed

By default, the DAGs search in the Airflow UI uses a fast prefix search. Users can toggle the "match anywhere" (substring search) button to refine their queries. However, this toggle state was previously only stored in localStorage.

This created a major usability gap: if a user filtered the DAGs list using "match anywhere" and shared that URL with a colleague, the recipient wouldn't see the same results unless they coincidentally had the "match anywhere" toggle enabled in their own browser's local storage.


How this solves the problem

This PR introduces the match_anywhere URL parameter to properly persist the toggle state, ensuring reproducible and shareable deep links.

  • Selective Persistence: We modified the useAdvancedSearch React hook to optionally accept a URL parameter key. This allows the DAGs list search to sync with the URL without polluting the URL state for all other search bars across the UI.
  • Deep Linking: The toggle now reads its initial state from the match_anywhere query parameter (falling back to local storage if absent). When toggled, it dynamically adds or removes ?match_anywhere=true from the URL.

What is unique about this implementation

Rather than globally coupling the useAdvancedSearch hook to the URL—which would have forced all search inputs across the application (like XComs, Task Instances, Events, etc.) to inject "match anywhere" states into the URL—we implemented a highly targeted approach.

The hook now accepts an optional searchParamKey argument. By creating a new strongly-typed MATCH_ANYWHERE property in the SearchParamsKeys enum and passing it strictly to the DAGs list component, we preserve the default clean URL behavior for the rest of the application while explicitly solving the deep-linking requirement for the DAGs list.

closes: #73772

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Oct 1, 2026

@pierrejeambrun pierrejeambrun 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.

Thanks for the PR

Closing in favor of #74019 which is closer to being merged :

  • More tests
  • Cover all pages of the application, not just dag
  • Handle the case where multiple text filter are enabled within the same page.

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

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"match anywhere" in Dag search UI should be persisted as URL param

2 participants