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

2026-03-30 Thread Django
#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: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019d3fd34304-36112d86-6d92-415f-b05e-57137f1a337f-00%40eu-central-1.amazonses.com.


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

2026-03-28 Thread Django
#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: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019d385fa0f0-e48bff3f-e5d1-483d-8b27-6302456a0950-00%40eu-central-1.amazonses.com.