[Django] #35798: Admin sidebar still flashes when page loads

14 views
Skip to first unread message

Django

unread,
Sep 27, 2024, 2:20:49 PM9/27/24
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-----------------------------------------+-----------------------------
Reporter: Mario Munoz | Owner: Mario Munoz
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
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 |
-----------------------------------------+-----------------------------
This new ticket is based on https://code.djangoproject.com/ticket/31641
which had been closed previously.

Currently, there is a {{{ <script src="{% static 'admin/js/nav_sidebar.js'
defer %}"></script> }}} tag within the {{{ <head> }}} element of the base
template. This means that sometimes the sidebar renders ''before'' the
script runs, which sometimes causes a flash/flicker when you reload the
page.

I was able to reproduce this locally. To do this, I needed to hide the
sidebar, then show again, then reload the browser. Upon subsequent
reloads, there would be an occasional flicker.
--
Ticket URL: <https://code.djangoproject.com/ticket/35798>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 27, 2024, 2:22:10 PM9/27/24
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------+---------------------------------------
Reporter: Mario Munoz | Owner: Mario Munoz
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
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: 1
-------------------------------+---------------------------------------
Comment (by Mario Munoz):

When moving the script tag to be listed in the {{{ nav_sidebar.html }}}
(after the code), it will no longer run the script until after the sidebar
has rendered.

I reproduced the steps I used to verify the flicker was present, but after
this change, I could no longer reproduce the effect. It seems to have
fixed the issue.

I'm not sure if there is any testing to be set up for this.
--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:1>

Django

unread,
Sep 27, 2024, 3:02:43 PM9/27/24
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------+---------------------------------------
Reporter: Mario Munoz | Owner: Mario Munoz
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
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: 1
-------------------------------+---------------------------------------
Changes (by Mario Munoz):

* has_patch: 0 => 1

Comment:

https://github.com/django/django/pull/16248
--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:2>

Django

unread,
Sep 27, 2024, 3:09:44 PM9/27/24
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------+---------------------------------------
Reporter: Mario Munoz | Owner: Mario Munoz
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
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 Thibaud Colas):

* stage: Unreviewed => Accepted

Comment:

Confirm the issue from [https://code.djangoproject.com/ticket/31641
#31641] is still present.

- Demo page where this is reproducible in `main`: [https://django-admin-
tests.netlify.app/django_admin_tests/v5.1/english/admin/admin/logentry/
/admin/admin/logentry/].
- Demo page for the PR with the fix: [https://preview-16248--django-admin-
tests.netlify.app/django_admin_tests/v5.1/english/admin/admin/logentry/
preview-16248].
--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:3>

Django

unread,
Oct 8, 2024, 4:41:17 AM10/8/24
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------+--------------------------------------
Reporter: Mario Munoz | Owner: Gavin Wahl
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
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):

* owner: Mario Munoz => Gavin Wahl

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

Django

unread,
Oct 8, 2024, 4:41:25 AM10/8/24
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------------+-------------------------------------
Reporter: Mario Munoz | Owner: Gavin
| Wahl
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
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/35798#comment:5>

Django

unread,
Oct 8, 2024, 8:01:02 AM10/8/24
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------------+-------------------------------------
Reporter: Mario Munoz | Owner: Gavin
| Wahl
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.0
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:"747b417a220b0412ed806001a383959449aac6da" 747b417]:
{{{#!CommitTicketReference repository=""
revision="747b417a220b0412ed806001a383959449aac6da"
Fixed #35798, Refs #31641 -- Prevented admin navigation sidebar loading
flicker.

Thank you to Mario Munoz and Thibaud Colas for the testing and review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:6>

Django

unread,
Apr 1, 2025, 3:30:52 AMApr 1
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------------+-------------------------------------
Reporter: Mario Munoz | Owner: Gavin
| Wahl
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.0
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:"12385b4fa7059aab8e4f671853cc09ae8509501f" 12385b4f]:
{{{#!CommitTicketReference repository=""
revision="12385b4fa7059aab8e4f671853cc09ae8509501f"
Fixed #36283 -- Reverted "Fixed #35798, Refs #31641 -- Prevented admin
navigation sidebar loading flicker."

This reverts commit 747b417a220b0412ed806001a383959449aac6da that caused
a visual regression when both navigation and filter sidebars are
visible.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:7>

Django

unread,
Apr 1, 2025, 3:33:14 AMApr 1
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------------+-------------------------------------
Reporter: Mario Munoz | Owner: Gavin
| Wahl
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.0
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:"88ca180bfe9940e338b5d4eca5079fd2280c752c" 88ca180b]:
{{{#!CommitTicketReference repository=""
revision="88ca180bfe9940e338b5d4eca5079fd2280c752c"
[5.2.x] Fixed #36283 -- Reverted "Fixed #35798, Refs #31641 -- Prevented
admin navigation sidebar loading flicker."

This reverts commit 747b417a220b0412ed806001a383959449aac6da that caused
a visual regression when both navigation and filter sidebars are
visible.

Backport of 12385b4fa7059aab8e4f671853cc09ae8509501f from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:8>

Django

unread,
Apr 1, 2025, 3:34:12 AMApr 1
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------------+-------------------------------------
Reporter: Mario Munoz | Owner: Gavin
| Wahl
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
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):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:9>

Django

unread,
Apr 1, 2025, 3:37:28 AMApr 1
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------+--------------------------------------
Reporter: Mario Munoz | Owner: Gavin Wahl
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
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

--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:10>

Django

unread,
Apr 1, 2025, 3:38:33 AMApr 1
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------+--------------------------------------
Reporter: Mario Munoz | Owner: Gavin Wahl
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Changes (by Sarah Boyce):

* has_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:11>

Django

unread,
Apr 8, 2025, 2:35:08 AMApr 8
to django-...@googlegroups.com
#35798: Admin sidebar still flashes when page loads
-------------------------------+--------------------------------------
Reporter: Mario Munoz | Owner: Gavin Wahl
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Comment (by Ahmed Nassar):

Is this ticket available to work on?
--
Ticket URL: <https://code.djangoproject.com/ticket/35798#comment:12>
Reply all
Reply to author
Forward
0 new messages