Skip to content

UI: Add match-anywhere toggle to the tags filter - #73616

Merged
pierrejeambrun merged 4 commits into
apache:mainfrom
krisztiansala:ui-advanced-search-tags
Oct 21, 2026
Merged

pierrejeambrun merged 4 commits into
apache:mainfrom
krisztiansala:ui-advanced-search-tags

Conversation

@krisztiansala

@krisztiansala krisztiansala commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #66015.

Why

Since #64963 switched the UI to index-friendly *_prefix_pattern searches, the Tags filter on the Dags list only matches tag names from the start — typing a middle substring yields nothing. #66015 restored substring matching for searchbars and text filter pills via the .* "match anywhere" toggle, but the Tags pill is a MultiSelectPill backed by a paginated /dagTags query, so it never got the toggle.

What

  • useDagTagsInfinite gains an advancedSearch flag and spreads the input onto tagNamePattern (substring ILIKE '%term%') or tagNamePrefixPattern (LIKE 'term%') — same pattern as useDags.
  • TagsFilter reads useAdvancedSearch(filter.config.key) so the pill's toggle state and the tag query share the advanced_search-tags localStorage key.
  • MultiSelectPill renders AdvancedSearchToggle (variant addon) right after the select when config.supportsAdvancedSearch is set, and shows the same LuRegex indicator on the collapsed pill that TextSearchFilter uses. Other multiselect filters (teams, owners, timetable) filter static option lists client-side, so they don't set the flag and are unchanged.
  • supportsAdvancedSearch: true set on the TAGS filter config; the flag's doc comment no longer says "text filters" only.

Behavior is unchanged by default: prefix matching stays the default; opting into substring is per-browser per-filter, exactly like the existing toggles.

Screenshots

Verified locally with the vite dev server against mocked /api/v2/dagTags routes that honor both tag_name_prefix_pattern and tag_name_pattern. Tags in the mock: CNDI, CNDI_DEV, LEGACY_CNDI_MIGRATION; input cndi.

Default (prefix) — .* off, request sends tag_name_prefix_pattern=cndi, only prefix matches shown:

tags filter, default prefix search

.* enabled — request switches to tag_name_pattern=cndi, substring match LEGACY_CNDI_MIGRATION appears:

tags filter, match anywhere enabled

Collapsed pill shows the .* indicator next to the selected tag, matching the TextSearchFilter behavior:

collapsed tags pill with regex indicator

Test plan

  • pnpm vitest run src/components/FilterBar/filters/TagsFilter.test.tsx — new test file: prefix is the default tag_name_prefix_pattern arg, toggling flips subsequent calls to tag_name_pattern, the collapsed pill shows the regex indicator when enabled, and the toggle is absent without supportsAdvancedSearch
  • pnpm vitest run for FilterBar.test.tsx and SearchBar.test.tsx — 28 tests pass
  • pnpm lint (eslint + tsc) clean
  • Manual: vite dev server + mocked API routes — Dags list → Tags filter → .* toggle → tag_name_pattern request fired, substring-only tag rendered, aria-pressed and localStorage persist. Not verified against a full breeze backend.

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

Generated-by: Devin following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.

@boring-cyborg

boring-cyborg Bot commented Sep 23, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@krisztiansala
krisztiansala force-pushed the ui-advanced-search-tags branch from 071a1ef to 0b423b6 Compare September 24, 2026 07:06

@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

Image

Need fixing when multiple tags are selected visually. (check borders)

And CI need fixing too.

Just one small comment otherwise working as expected.

@krisztiansala

Copy link
Copy Markdown
Contributor Author

Thanks for the PR

Image Need fixing when multiple tags are selected visually. (check borders)

And CI need fixing too.

Just one small comment otherwise working as expected.

Thanks for checking,

Fixed the border and the static check
image

Follow-up to apache#66015. The Dags list Tags pill queries ``/dagTags`` with
``tag_name_prefix_pattern`` on every keystroke, so tag search only matches
from the start of the name. Wire the existing advanced-search toggle into
``MultiSelectPill`` and set ``supportsAdvancedSearch`` on the tags config so
users can opt back into substring (``tag_name_pattern``) matching, persisted
per-filter in localStorage like the other searchbars.
…toggle

- Drop newsfragments/73616.feature.rst per review
- Add roundedRight option to AdvancedSearchToggle addon variant so it
  doesn't keep a rounded corner when the match-mode toggle follows it
- Fix prettier formatting in TagsFilter.test.tsx
@krisztiansala
krisztiansala force-pushed the ui-advanced-search-tags branch from 356aca9 to 9ac58a5 Compare October 5, 2026 07:16
@pierrejeambrun pierrejeambrun added this to the Airflow 3.4.1 milestone Oct 21, 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.

LGTM thanks

@pierrejeambrun

Copy link
Copy Markdown
Member

Unrelated CI failure, merging.

@pierrejeambrun
pierrejeambrun merged commit 745bdbf into apache:main Oct 21, 2026
168 of 170 checks passed
@boring-cyborg

boring-cyborg Bot commented Oct 21, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

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.

3 participants