Page MenuHomeSoftware Heritage

templates/layout: Prevent flashing of collapsed sidebar on page load
ClosedPublic

Authored by anlambert on Thu, Jul 21, 1:44 PM.

Details

Summary

When sidebar is in collpased mode, it was previously flashing from expanded
to collapsed when loading a page as its state was changed using javascript.

So prefer to use a cookie describing sidebar state that can be read server
side from django and injected in templates, this way the sidebar is ensured
to be in correct state in HTML code on page load.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D8153 (id=29437)

Rebasing onto e5d355c5d6...

Current branch diff-target is up to date.
Changes applied before test
commit d641520621dcec455e642784c86b26303c42dbb6
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Jul 21 13:40:14 2022 +0200

    templates/layout: Prevent flashing of collapsed sidebar on page load
    
    When sidebar is in collpased mode, it was previously flashing from expanded
    to collapsed when loading a page as its state was changed using javascript.
    
    So prefer to use a cookie describing sidebar state that can be read server
    side from django and injected in templates, this way the sidebar is ensured
    to be in correct state in HTML code on page load.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1946/ for more details.

This revision is now accepted and ready to land.Thu, Jul 21, 2:11 PM