Clear all filters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Clear all filters

Fran Hrženjak
Hi,

I just saw the new “Clear all filters” link in the admin in 3.1a1. Love it! But I noticed something that perhaps deserves a discussion. Since the PR has already been merged, I’m posting here instead.

The thing is that clicking “Clear all filters” also clears the search query and table ordering. The way I expected it to work is to, well, “clear all filters” and nothing else. Basically to act like a shortcut for clicking “All” on each filter individually. Doing so (clicking every “All” link) preserves search query and ordering. Should “Clear all filters” also preserve those things?

I would love to hear your thoughts on this.

Ref:


Select_answer_to_change___Django_site_admin.png

P.S.
I noticed this while making a PR for a related issue: https://code.djangoproject.com/ticket/31597

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAM2o%3DwNb%2BkN_ciYO2%3DcvFWpuSYiOCb81oRT2vyrnYqbDXA2cNw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Clear all filters

Mariusz Felisiak
Hi,

 IMO the current behavior is expected, it is also included in the ticket description (see comment[1]).

Best,
Mariusz

[1] https://code.djangoproject.com/ticket/27888#comment:1

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/56339b28-59a3-4e41-b364-adf7faa4cb83%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Clear all filters

Adam Johnson-2
I disagree Mariusz. I would NOT expect this. The "Clear all filters" button is grouped with the filters, visually separate from the search and sort controls. It's a very legitimate use case to clear the filters and maintain the search or sort, and quite a common workflow when trying to find a particular object.

Additionally, I see that the link only preserves the _popup=1 query param. if users have extended their admin views with any extra query params, they will also be wiped, which is less than helpful. I know I have extended the admin with extra params before e.g. to control the queryset.

I'm +1 on changing this to take the current query params and remove only the filter-related ones.

On Mon, 18 May 2020 at 05:36, Mariusz Felisiak <[hidden email]> wrote:
Hi,

 IMO the current behavior is expected, it is also included in the ticket description (see comment[1]).

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/56339b28-59a3-4e41-b364-adf7faa4cb83%40googlegroups.com.


--
Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM0tnc6SR2Mjb4N%2BD8UyAAExMY%2BRJyRS955DofSAEpVmsw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Clear all filters

Mariusz Felisiak
In reply to this post by Fran Hrženjak
I disagree Mariusz. I would NOT expect this. The "Clear all filters" button is grouped with the filters, visually separate from the search and sort controls. It's a very legitimate use case to clear the filters and maintain the search or sort, and quite a common workflow when trying to find a particular object.

The idea of this feature was to remove all filters and search criteria in one click (see the ticket description[2]). The first proposition was to put this link in actions [2], but I proposed moving it to filters. I'm not sure if link for clearing only filters is still necessary (and it wasn't the intention of reporter), we can remove this feature if it's misleading. Link to the right of the search box ("X total") already removes the entire query string, so ...

Additionally, I see that the link only preserves the _popup=1 query param. if users have extended their admin views with any extra query params, they will also be wiped, which is less than helpful. I know I have extended the admin with extra params before e.g. to control the queryset.

Link to the right of the search box ("X total") that was added in 2005 [3] do the same. We should probably use `add_preserved_filters`.

[1] https://code.djangoproject.com/ticket/27888
[2] https://github.com/django/django/pull/12351#issuecomment-577415747
[3] https://github.com/django/django/commit/9dda4abee1225db7a7b195b84c915fdd141a7260

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ed3810c9-bb86-4e05-97dd-4818efa1617c%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Clear all filters

Markus Holtermann
I tend to agree with Adam.

From a UI/UX perspective, the location where the "Clear all filters" button is, as well as the wording, suggest to me that it's only the filters on the right side. The search query, while technically filtering the query set, doesn't seem like a filter in the UI.

I'd potentially argue otherwise if the search field was in the filter box on the right.

Additionally, looking at it from the back-end, search terms and filters have nothing in common except for the queryset.

Cheers,

Markus


On Mon, May 18, 2020, at 11:10 AM, Mariusz Felisiak wrote:

> > I disagree Mariusz. I would NOT expect this. The "Clear all filters" button is grouped with the filters, visually separate from the search and sort controls. It's a very legitimate use case to clear the filters and maintain the search or sort, and quite a common workflow when trying to find a particular object.
>
> The idea of this feature was to remove all filters and *search
> criteria* in one click (see the ticket description[2]). The first
> proposition was to put this link in actions [2], but I proposed moving
> it to filters. I'm not sure if link for clearing only filters is still
> necessary (and it wasn't the intention of reporter), we can remove this
> feature if it's misleading. Link to the right of the search box ("X
> total") already removes the entire query string, so ...
>
> > Additionally, I see that the link only preserves the _popup=1 query param. if users have extended their admin views with any extra query params, they will also be wiped, which is less than helpful. I know I have extended the admin with extra params before e.g. to control the queryset.
>
> Link to the right of the search box ("X total") that was added in 2005
> [3] do the same. We should probably use `add_preserved_filters`.
>
> [1] https://code.djangoproject.com/ticket/27888
> [2] https://github.com/django/django/pull/12351#issuecomment-577415747
> [3]
> https://github.com/django/django/commit/9dda4abee1225db7a7b195b84c915fdd141a7260
>
>  --
>  You received this message because you are subscribed to the Google
> Groups "Django developers (Contributions to Django itself)" group.
>  To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email].
>  To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/ed3810c9-bb86-4e05-97dd-4818efa1617c%40googlegroups.com <https://groups.google.com/d/msgid/django-developers/ed3810c9-bb86-4e05-97dd-4818efa1617c%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/a366340a-9b8e-4ac5-9478-10380680de99%40www.fastmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Clear all filters

Mariusz Felisiak
In reply to this post by Fran Hrženjak
OK, I added new ticket https://code.djangoproject.com/ticket/31603.

Thanks y'all

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/d0b554c5-43c7-4cfe-8a11-4bc05323636f%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Clear all filters

Fran Hrženjak
Here is my dream rework of these links. I’m NOT saying we need to do this now now now (i.e part of this ticket), but I’m interested to hear if this is something that could be accepted by the community.

A few highlights:
  • fairly backwards compatibl (the "X total" link is only moved a bit in DOM, other elements are new)
  • separates clearing of search from clearing of filters
  • always shows relevant elements regardless of fealters and/or search being enabled on the changelist
I would not have proposed this if we don’t have the new “Clear all filters” links because, IMHO the new link functions also as a visual cue to see if there are any active filters. Prevbiously it was easy to miss an active filter, and so having the “X total” link (next to search field) also clear the filters made sense. Now that we have a better visual indication of any active filter(s), IMHO it makes sense to decouple clearing of search from filters.



Select_user_to_change___Django_site_admin-2.png



mobile:

Select_user_to_change___Django_site_admin-3.png


--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/e0202896-85ac-43d9-a43f-a1c495ebc9f3%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Clear all filters

Aymeric Augustin
In reply to this post by Mariusz Felisiak
On 18 May 2020, at 11:10, Mariusz Felisiak <[hidden email]> wrote:

Link to the right of the search box ("X total") already removes the entire query string, so ...

Ah, this is a bug I'm hitting!

I have a small personal app where I classify data. Some classification is automated with regexes. New data needs to be classified manually.

My typical workflow is:

- filter on unclassified data
- find something interesting
- use the search field to find all similar data
- classify it (directly in the list view, thanks to list_editable)
- clear the search => I lose my filter :-(
- filter on unclassified data again
- etc.

Having to set the filter again and again is a minor annoyance so I haven't bothered to report a bug. But it's the wrong behavior in this case.

Best regards,

-- 
Aymeric.



--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/D962DF7E-2B2F-4D37-9F8C-609ACE4120E9%40polytechnique.org.
Reply | Threaded
Open this post in threaded view
|

Re: Clear all filters

Adam Johnson-2
Fran, your design looks nice. I think we should make a ticket that combines making the "X total" link preserve the query params and adding your other suggested changes.

On Tue, 19 May 2020 at 08:12, Aymeric Augustin <[hidden email]> wrote:
On 18 May 2020, at 11:10, Mariusz Felisiak <[hidden email]> wrote:

Link to the right of the search box ("X total") already removes the entire query string, so ...

Ah, this is a bug I'm hitting!

I have a small personal app where I classify data. Some classification is automated with regexes. New data needs to be classified manually.

My typical workflow is:

- filter on unclassified data
- find something interesting
- use the search field to find all similar data
- classify it (directly in the list view, thanks to list_editable)
- clear the search => I lose my filter :-(
- filter on unclassified data again
- etc.

Having to set the filter again and again is a minor annoyance so I haven't bothered to report a bug. But it's the wrong behavior in this case.

Best regards,

-- 
Aymeric.



--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/D962DF7E-2B2F-4D37-9F8C-609ACE4120E9%40polytechnique.org.


--
Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM0rd5KcJxnU2Y379vX9WUsSSn_MBJXEj6CHPE2yPKSCbw%40mail.gmail.com.