diff --git a/static/js/theme.js b/static/js/theme.js index a35d786..39af3aa 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -17,8 +17,18 @@ } } - // Restore saved state + // Restore saved state instantly — suppress transitions so there's no + // collapse animation flash on every page navigation. + sidebar.style.transition = 'none'; + contentWrapper.style.transition = 'none'; applyCollapsed(localStorage.getItem(COLLAPSED_KEY) === '1'); + // Re-enable transitions after one frame so the toggle button still animates. + requestAnimationFrame(function () { + requestAnimationFrame(function () { + sidebar.style.transition = ''; + contentWrapper.style.transition = ''; + }); + }); if (toggleBtn) { toggleBtn.addEventListener('click', function () {