[Django] #35386: Incorrect checkbox help text alignment in multi-field rows

25 views
Skip to first unread message

Django

unread,
Apr 18, 2024, 7:46:18 AM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-----------------------------------------+------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Bug | 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: 0 |
-----------------------------------------+------------------------
For a single checkbox, styles align the help under the checkbox:

...


When the checkbox appears with any other field in the same line, this is
undone:

...

Example admin:

{{{
from django.contrib import admin
from example.models import Switcher


class SwitcherAdmin(admin.ModelAdmin):
fieldsets = [
(
None,
{
"fields": [
("up", "down"),
],
},
),
]


admin.site.register(Switcher, SwitcherAdmin)
}}}

(It doesn’t matter if the other field is a checkbox or not.)
--
Ticket URL: <https://code.djangoproject.com/ticket/35386>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 18, 2024, 7:46:38 AM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+--------------------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Adam Johnson):

* Attachment "Xnapper-2024-04-16-10.31.32.png" added.

single-correct

Django

unread,
Apr 18, 2024, 7:46:52 AM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+--------------------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Adam Johnson):

* Attachment "Xnapper-2024-04-16-10.31.15.png" added.

double-incorrect

Django

unread,
Apr 18, 2024, 7:49:40 AM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+--------------------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Adam Johnson):

* Attachment "Xnapper-2024-04-16-10.31.01.png" added.

fixed

Django

unread,
Apr 18, 2024, 7:50:29 AM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Adam Johnson):

* has_patch: 0 => 1
* owner: nobody => Adam Johnson
* status: new => assigned


Old description:

> For a single checkbox, styles align the help under the checkbox:
>
> ...
>

> When the checkbox appears with any other field in the same line, this is
> undone:
>
> ...
>
> Example admin:
>
> {{{
> from django.contrib import admin
> from example.models import Switcher
>

> class SwitcherAdmin(admin.ModelAdmin):
> fieldsets = [
> (
> None,
> {
> "fields": [
> ("up", "down"),
> ],
> },
> ),
> ]
>

> admin.site.register(Switcher, SwitcherAdmin)
> }}}
>
> (It doesn’t matter if the other field is a checkbox or not.)

New description:

For a single checkbox, styles align the help under the checkbox:

[[Image(https://code.djangoproject.com/raw-
attachment/ticket/35386/Xnapper-2024-04-16-10.31.32.png, 558px)]]


When the checkbox appears with any other field in the same line, this is
undone:

[[Image(https://code.djangoproject.com/raw-
attachment/ticket/35386/Xnapper-2024-04-16-10.31.15.png, 592px)]]

Example admin:

{{{
from django.contrib import admin
from example.models import Switcher


class SwitcherAdmin(admin.ModelAdmin):
fieldsets = [
(
None,
{
"fields": [
("up", "down"),
],
},
),
]


admin.site.register(Switcher, SwitcherAdmin)
}}}

(It doesn’t matter if the other field is a checkbox or not.)

Changing `fieldset.html` so `checkbox-row` is applied unconditionally to
checkbox-containing field boxes fixes this regression, plus #34994:

[[Image(https://code.djangoproject.com/raw-
attachment/ticket/35386/Xnapper-2024-04-16-10.31.01.png, 562px)]]

--
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:1>

Django

unread,
Apr 18, 2024, 8:02:18 AM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Adam Johnson):

* Attachment "Xnapper-2024-04-18-12.58.34.png" added.

previous-dense

Django

unread,
Apr 18, 2024, 8:02:42 AM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------
Comment (by Adam Johnson):

I ran a bisect and confirmed this was a regression in
96a598356a9ea8c2c05b22cadc12e256a3b295fd, before which checkboxes would be
densely packed:

[[Image(https://code.djangoproject.com/raw-
attachment/ticket/35386/Xnapper-2024-04-18-12.58.34.png, 599px)]]
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:2>

Django

unread,
Apr 18, 2024, 8:36:22 AM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+----------------------------------------
Changes (by Natalia Bidart):

* cc: Tom Carrick (added)
* stage: Unreviewed => Accepted
* ui_ux: 0 => 1

Comment:

Thank you Adam, great catch!
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:3>

Django

unread,
Apr 18, 2024, 9:01:20 AM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+----------------------------------------
Changes (by Adam Johnson):

* version: dev => 4.2

--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:4>

Django

unread,
Apr 18, 2024, 1:04:15 PM4/18/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:5>

Django

unread,
Apr 19, 2024, 4:37:28 AM4/19/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+----------------------------------------
Changes (by Sarah Boyce):

* stage: Ready for checkin => Accepted

Comment:

(need to confirm if this needs backporting, if so I think this will need a
release note for 4.2 and 5.0)
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:6>

Django

unread,
Apr 19, 2024, 4:53:45 AM4/19/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:7>

Django

unread,
Apr 19, 2024, 5:20:13 AM4/19/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"bdd76c4c3817d8e3ed5b0450d5e18e4eae096f16" bdd76c4]:
{{{#!CommitTicketReference repository=""
revision="bdd76c4c3817d8e3ed5b0450d5e18e4eae096f16"
Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS class
unconditionally in Admin.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:8>

Django

unread,
Apr 19, 2024, 5:24:47 AM4/19/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"ffcf66071158ed3b5541ed13b4c7381240d1b310" ffcf6607]:
{{{#!CommitTicketReference repository=""
revision="ffcf66071158ed3b5541ed13b4c7381240d1b310"
[5.0.x] Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS class
unconditionally in Admin.

Backport of bdd76c4c3817d8e3ed5b0450d5e18e4eae096f16 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:9>

Django

unread,
Apr 19, 2024, 5:29:07 AM4/19/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"0fc832676cd585fa420d583937b5b2318bc2c629" 0fc8326]:
{{{#!CommitTicketReference repository=""
revision="0fc832676cd585fa420d583937b5b2318bc2c629"
[4.2.x] Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS class
unconditionally in Admin.

Backport of bdd76c4c3817d8e3ed5b0450d5e18e4eae096f16 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:10>

Django

unread,
Apr 19, 2024, 7:35:08 AM4/19/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"256f719cb38eee49dcc529ddf1e0b95aa440d133" 256f719]:
{{{#!CommitTicketReference repository=""
revision="256f719cb38eee49dcc529ddf1e0b95aa440d133"
[4.2.x] Reverted "Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS
class unconditionally in Admin."

This reverts commit 0fc832676cd585fa420d583937b5b2318bc2c629.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:11>

Django

unread,
Apr 19, 2024, 7:41:33 AM4/19/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"a42a2fa267c68ed2cc97559396178deaa9477ef3" a42a2fa]:
{{{#!CommitTicketReference repository=""
revision="a42a2fa267c68ed2cc97559396178deaa9477ef3"
[5.0.x] Reverted "Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS
class unconditionally in Admin."

This reverts commit ffcf66071158ed3b5541ed13b4c7381240d1b310.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:12>

Django

unread,
Sep 17, 2024, 3:01:17 PM9/17/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Richard Laager):

I noticed this was reverted in the stable branches? Was there some
technical issue with the fix, or was this a policy issue (i.e. it should
not have been backported to those releases per policy)?
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:13>

Django

unread,
Sep 17, 2024, 3:26:23 PM9/17/24
to django-...@googlegroups.com
#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):

Replying to [comment:13 Richard Laager]:
> I noticed this was reverted in the stable branches? Was there some
technical issue with the fix, or was this a policy issue (i.e. it should
not have been backported to those releases per policy)?

That's right Richard, this should not have been backported per policy.
Details of that conversation are in
[https://github.com/django/django/pull/18086#issuecomment-2066266842 these
comments].
--
Ticket URL: <https://code.djangoproject.com/ticket/35386#comment:14>
Reply all
Reply to author
Forward
0 new messages