Skip to content

Persist the match-anywhere search toggle in the URL - #74019

Merged
bbovenzi merged 3 commits into
apache:mainfrom
astronomer:persist-advanced-search-url
Oct 2, 2026
Merged

bbovenzi merged 3 commits into
apache:mainfrom
astronomer:persist-advanced-search-url

Conversation

@pierrejeambrun

@pierrejeambrun pierrejeambrun commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

The substring ("match anywhere") search toggle only persisted in each browser's localStorage, so a filtered search could not be reproduced from a shared link — a colleague opening the URL saw prefix-only results unless they happened to have the same toggle enabled locally (#73772).

This mirrors the toggle in a shareable match_anywhere URL param. It is a repeated param listing the searchbars whose toggle is on (e.g. ?match_anywhere=dag_id&match_anywhere=run_id), so pages with several independent text filters stay unambiguous. A key present in the URL wins so a shared link reproduces the sender's results; otherwise the existing per-searchbar localStorage preference still applies, and toggling the control writes both.

The change is a single central tweak to the useAdvancedSearch hook, so every searchbar and per-filter toggle that already uses it is covered uniformly. No visual change — the existing toggle now just reflects into, and reads back from, the URL.

closes: #73772


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

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

Copy link
Copy Markdown
Member Author
Screen.Recording.2026-10-01.at.13.41.25.mov

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

How is our source of truth chain supposed to work here and then with #74021?

We only say when match anywhere is on. Do we also want an explicit match anywhere is off? Because otherwise we're going to localStorage or the user default.

If this is in url params, we should completely remove the localStorage option and only have global config + url param

The substring (match-anywhere) search toggle only lived in each browser's localStorage, so a filtered search could not be reproduced from a shared link: a colleague opening the URL saw prefix results unless they happened to have the same toggle enabled locally.

Mirroring the toggle in a shareable URL param fixes that. The param lists the enabled searchbars by key so pages with several text filters stay unambiguous, and the per-searchbar localStorage preference remains the fallback when the URL does not carry it.

closes: apache#73772
The toggle only recorded the positive, so turning match-anywhere off just dropped the param — a shared link then could not reproduce an off result for a recipient whose stored preference (or, with the stacked setting, default) was on. The param now carries an explicit `-key` entry for off, so both directions are shareable. The URL still wins over localStorage, and a key with no entry falls back to it.
@pierrejeambrun
pierrejeambrun force-pushed the persist-advanced-search-url branch from ca94fb4 to b1cc918 Compare October 2, 2026 09:11
@pierrejeambrun

Copy link
Copy Markdown
Member Author

Updated, we are now capturing 'negative' for sharing urls.

How is our source of truth chain supposed to work here and then with #74021?

Resolution order is url -> localstorage -> global setting (added in the following PR).

We only say when match anywhere is on. Do we also want an explicit match anywhere is off? Because otherwise we're going to localStorage or the user default.

Yes indeed. Addressed in last commit.

Screen.Recording.2026-10-02.at.11.08.24.mov

If this is in url params, we should completely remove the localStorage option and only have global config + url param

Localstorage is still usefull when navigating from within the application (because all those internal redirection links won't be providing those query params in the url). Typically:

  • Use the navbar to navigate to the 'dags' page. Activate the advanced search. (url is updated and sharable)
  • Navigate away from this page
  • Come back to the dag page by clicking on the 'nav bar'
  • If we remove the local storage, this will fall back to the user 'default' while the person explicitely set the match everywherre for this particular filter.

The toggle already persists per-searchbar under the `advanced_search-<id>` localStorage key, so naming the URL param `advanced_search` too (rather than `match_anywhere`) makes it obvious the two are the same feature.
@bbovenzi
bbovenzi merged commit c318886 into apache:main Oct 2, 2026
90 checks passed
@bbovenzi
bbovenzi deleted the persist-advanced-search-url branch October 2, 2026 14:28
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