Opened 4 years ago

Closed 18 months ago

#31641 closed Bug (fixed)

Admin Sidebar flashes when page loads

Reported by: Collin Anderson Owned by: Collin Anderson
Component: contrib.admin Version: 3.1
Severity: Release blocker Keywords:
Cc: cmawebsite@…, Tom Carrick Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

Hi All, If you have the Admin Sidebar closed, it's actually open when the page loads, and quickly the flashes closed. This feels really clunky.

I see two possible solutions to this:

  1. Move the sidebar javascript to <head> with the rest of the scripts instead of just below </body> . Because the <script> is async, there's still a chance it will flash, but it should happen less often. It's async so it shouldn't cause the page to slow down too much.
  1. Just have it always hidden by default, no between-page state. It ends up being more of a hidden feature, but as I've been using it, I _always_ close it so I have more room to see the rest of the page, but maybe that's because I'm a power user.

Change History (9)

in reply to:  description comment:1 by Divyansh Upadhyay, 4 years ago

Replying to Collin Anderson:

Hi All, If you have the Admin Sidebar closed, it's actually open when the page loads, and quickly the flashes closed. This feels really clunky.

I see two possible solutions to this:

  1. Move the sidebar javascript to <head> with the rest of the scripts instead of just below </body> . Because the <script> is async, there's still a chance it will flash, but it should happen less often. It's async so it shouldn't cause the page to slow down too much.
  1. Just have it always hidden by default, no between-page state. It ends up being more of a hidden feature, but as I've been using it, I _always_ close it so I have more room to see the rest of the page, but maybe that's because I'm a power user.

Greetings,I am new to open source development, I have experience with python and I would like to contribute towards community ,can anyone please guide me how do I get started?thank you in advance

comment:2 by Mariusz Felisiak, 4 years ago

Cc: Tom Carrick added
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

Agreed, I think we should implement the 1st proposition. Collin, would you like to prepare a patch?

comment:3 by Collin Anderson, 4 years ago

comment:4 by Mariusz Felisiak, 4 years ago

Has patch: set
Owner: changed from nobody to Collin Anderson
Status: newassigned

comment:5 by Mariusz Felisiak, 4 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 5b3886d0:

[3.1.x] Fixed #31641 -- Improved loading of navigation sidebar in admin.

Backport of 4ae9a2b18e2b558df2c084064c42faecac2d75c1 from master

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 4ae9a2b1:

Fixed #31641 -- Improved loading of navigation sidebar in admin.

comment:8 by Gavin Wahl, 18 months ago

Resolution: fixed
Status: closednew

This doesn't fix the bug because the sidebar still renders before the script runs, because it has the defer attribute on it. The correct way to do this would be to load nav_sidebar.js right after the sidebar html is rendered.

https://github.com/django/django/pull/16248

comment:9 by Mariusz Felisiak, 18 months ago

Resolution: fixed
Status: newclosed

Gavin, please open a new ticket.

Note: See TracTickets for help on using tickets.
Back to Top