Skip to content

Conversation

@ryanahamilton
Copy link
Contributor

@ryanahamilton ryanahamilton commented Oct 19, 2020

  • Instead of requiring the user to select/deselect tags and then submit the form with the "Filter tags" button, the page now updates as the tag is selected/deselected.
  • Removes the storage of the tags in the tags_filter cookie. For a filtering pattern such as this, the URL params should always reflect the current result set. Currently, you can have your result set filtered by tags and have no tags= params in your URL. This also required using a &reset_tags=Reset param to clear the values—this will no longer be needed with the URL explicitly reflecting the values. Updated the server-side logic, so that if cookie values exist, the tags= param is added to the URL so it matches the filtered result set. I also made an update to strip the reset_tags=reset from the URL after the cookie value has been cleared.
  • Replaces the "Reset" button with an "X" icon button (same pattern used for search filter, added in UX Enhancement: Add button to clear search query from DAG search #11583). This button only appears when tag filters are applied.
  • The sum of these updates yields a much simpler UI where we don't need persistent buttons taking up space.
  • Updates Docs screenshot
Before After
Screen Recording 2020-10-19 at 10 29 28 AM Screen Recording 2020-10-19 at 10 13 27 AM

CC: @zacharya19 thought you might be interested in these modifications to your feature originally added in #6489.

@boring-cyborg boring-cyborg bot added area:docs area:webserver Webserver related Issues labels Oct 19, 2020
@ashb
Copy link
Member

ashb commented Oct 19, 2020

I think the reason for the tags_filter cookie is so that if you navigate away (say go and view a DAG) and then come back to the home page we want the same filters to apply.

@ryanahamilton
Copy link
Contributor Author

@ashb yeah, I understand that desire, but I believe it to be anti-pattern for filtering to not have continuity with the URL params. When a user utilizes the back button, their previously applied tag filters will still persist.

@ashb
Copy link
Member

ashb commented Oct 19, 2020

From a user POV the existing behaviour is very useful though -- espeically if you have a large Airflow deployment, and you only want to see "your team's" DAGs -- having to re-apply the filter each time you visit the page would be tedious.

@ryanahamilton
Copy link
Contributor Author

@ash I see that even though "tags" are typically an unspecified feature use, this feature was originally intended for this "team" use-case, which makes more sense to persist the filter. I'll see about refactoring this to keep the cookie in place.

@mik-laj
Copy link
Member

mik-laj commented Oct 19, 2020

I can see the benefits of @ryanahamilton 's solution, but also understand the needs of some users presented by @ashb who wanted selected tags to be remembered at all times. Maybe we can combine these two ideas and let the user keep the currently selected tags as default? I see it this way, that the user can browse DAGs normally according to @ryanahamilton 's suggestion, but if user wants to configure, be able to quickly return to the selected configuration, all users has to do is press the "Save as default" button. It doesn't even have to be on this page, but it could be a configuration option in your user profile settings ("Default selected tags" or something similar). I think this will better address the needs of both user groups.

@ryanahamilton
Copy link
Contributor Author

@mik-laj I like that idea. It might make sense to save the status (all/active/paused) in the "default" preference as well since we're also cookie-ing that value? That feels like it should be addressed as a feature in a subsequent PR—I think I can offer a refactor to this PR that maintains the current user expectations but still delivers on the UX improvements.

@mik-laj
Copy link
Member

mik-laj commented Oct 19, 2020

@ryanahamilton I have no preference. Each solution works for me. Let me know when your change is ready for review.

@ryanahamilton
Copy link
Contributor Author

I reverted the removal of the cookie storage, but I've updated it so that if cookie values exist, the tags= param(s) is added to the URL so it always matches the filtered result set.

I also made an update to strip the reset_tags=reset from the URL after the cookie value has been cleared.

Copy link
Contributor

@zacharya19 zacharya19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few nits, but I really like the improvements!

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice approach

@ashb ashb merged commit 73f6367 into apache:master Oct 19, 2020
@ashb ashb deleted the tag_filter_refactor branch October 19, 2020 20:23
@ryanahamilton ryanahamilton added the area:UI Related to UI/UX. For Frontend Developers. label Nov 18, 2020
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. area:webserver Webserver related Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants