-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Add reusable FilterBar component for date, number, text input #54895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really really good to me! The design not only improves UX also enhances extensibility. Still need more iteration and discussion but like it very much. 👍
Lee-W
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translation looks good
|
@guan404ming thanks for super helpful feedback. You're so great at code review ! |
bbovenzi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really exciting! Let's just clean up a few details. Its ok to just change XComFilters in this PR and then we can change others in subsequent PRs
airflow-core/src/airflow/ui/src/components/FilterBar/filters/TextSearchFilter.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/components/FilterBar/FilterBar.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/components/FilterBar/filters/DateFilter.tsx
Outdated
Show resolved
Hide resolved
89f8050 to
df6583e
Compare
airflow-core/src/airflow/ui/src/components/FilterBar/filters/DateFilter.tsx
Outdated
Show resolved
Hide resolved
bbovenzi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great. We're very close, just a few suggestions here and there
airflow-core/src/airflow/ui/src/components/FilterBar/FilterBar.tsx
Outdated
Show resolved
Hide resolved
a15f183 to
42651dd
Compare
|
@bbovenzi Do we want this in 3.1.0? |
Ok Saw the message on |
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io> (cherry picked from commit 2a1c686)
Follow up PR
|
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>
…#54895) * feat(ui): add reusable FilterBar component for date, number, text input * fix(ui): improve FilterPill focus and blur handling * refactor(ui): create useFiltersHandler hook for FilterBar * refactor(ui):Support negative number input & fix FilterPill DOM nesting * feat(ui): create centralized filter config * fix(ui): apply style feedback to FilterBar * refactor(ui): move getFilterConfig calls into useFiltersHandler & remove placeholder translation fallback * refactor: simplify DateFilter with dayjs * fix(ui): Add FilterTypes enum to avoid type casting * fix(i18n): add missing translation keys * fix(i18n): move filter translation key to free exemptions * fix(i18n): Replace dagName translation with dag ID * fix(i18n): simplify filter translations with fallbacks * fix: modify reset button translation key --------- Co-authored-by: Brent Bovenzi <brent@astronomer.io>


Why
As mentioned in #54049 (comment), the filters take up too much screen space. To address this, this PR introduces a new, reusable "filter pill" component design for
date,number,textinput.I would appreciate any early feedback on the overall design and direction. All comments and suggestions are welcome.
What
+ Filterto select a filter type from the dropdown menu. A new filter pill appears and is automatically focused. You can also click on any existing pill to edit its value.Enterto confirm the value and apply the filter.Escor click anywhere outside the input area to cancel and exit editing mode.xicon on any pill to remove that specific filter.Resetbutton to clear all active filters at once.Screenshots
filterPill.mp4
TO-DO
NumberFilterwhere inputting a minus sign (-) causes UI bug.^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.