[Django] #37010: Admin: improve filtered select feedback while filtering

9 views
Skip to first unread message

Django

unread,
Mar 29, 2026, 2:54:52 AMMar 29
to django-...@googlegroups.com
#37010: Admin: improve filtered select feedback while filtering
----------------------------+-----------------------------------------
Reporter: David Ansa | Type: New feature
Status: new | Component: contrib.admin
Version: dev | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
----------------------------+-----------------------------------------
The admin FilteredSelectMultiple / SelectFilter2 widget supports filtering
large option lists, but its filtered state is hard to understand during
bulk actions.

Current behavior

Filtering narrows the visible options in the "Available" and "Chosen"
lists.
The widget does not show how many options remain visible after filtering.
The bulk buttons keep the labels "Choose all ..." and "Remove all ..."
even when a filter is active.
In practice, those bulk actions operate on the displayed subset, which can
be surprising when the label suggests that all options will be affected.
Clearing a filter requires manually deleting the filter text.

Proposed improvement

Show a live X of Y shown count next to the filter input while a filter is
active.
Relabel bulk actions while filtering so they read:
Choose all displayed ...
Remove all displayed ...
Allow the active filter to be cleared with the Escape key.
Keep the filtered state and labels synchronized after moving options
between the two lists.

Why this is useful

It makes filter_horizontal / filter_vertical easier to understand on large
many-to-many lists.
It clarifies what bulk actions will do while the list is filtered.
It improves keyboard usability without changing the widget API.

Implementation notes

This can be implemented in
django/contrib/admin/static/admin/js/SelectFilter2.js.
A small style hook is useful in
django/contrib/admin/static/admin/css/widgets.css.
Regression coverage fits well in tests/admin_widgets/tests.py with
Selenium tests around the filtered-select widget behavior.

Testing

Add Selenium coverage for:
live X of Y shown feedback when filtering
updated bulk-action labels while a filter is active
clearing filters with Escape
Relevant test command:
.\.venv\Scripts\python.exe tests\runtests.py
admin_widgets.tests.HorizontalVerticalFilterSeleniumTests
--selenium=chrome --parallel 1

Notes

I did a quick Trac search for existing SelectFilter2 /
FilteredSelectMultiple tickets but did not find an obvious existing match
for this exact UX improvement.
This looks small in scope, but it is a user-visible admin behavior change,
so I am filing it before asking for review on the related PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/37010>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 30, 2026, 1:38:28 PMMar 30
to django-...@googlegroups.com
#37010: Admin: improve filtered select feedback while filtering
-------------------------------------+-------------------------------------
Reporter: David Ansa | Owner: (none)
Type: New feature | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
| needsnewfeatureprocess
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* resolution: => needsnewfeatureprocess
* status: new => closed

Comment:

Hello David Ansa,

Thank you for your suggestion! When suggesting a new feature for Django,
the feature idea should first be proposed and discussed with the
community. To do that, please raise this on the [https://github.com/django
/new-features/issues ​new feature tracker].

I'll close the ticket for now, but if the community agrees with the
proposal, please return to this ticket and reference the forum discussion
so we can re-open it. For more information, please refer to
[https://docs.djangoproject.com/en/stable/internals/contributing/bugs-and-
features/#requesting-features the documented guidelines for requesting
features].
--
Ticket URL: <https://code.djangoproject.com/ticket/37010#comment:1>
Reply all
Reply to author
Forward
0 new messages