From 534c98e062d9b7a303faa6eac35c62871fb69bf1 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Wed, 29 Apr 2026 11:19:30 +0000 Subject: [PATCH] sidebar: stop anchoring on collapse-sidebar-link in v16.17 Frappe v16.17 reintroduced .collapse-sidebar-link as a tiny icon-button inside a horizontal flex row (.sidebar-bottom-actions). Our v15 fallback was finding it and inserting our three labeled links into that flex row, pushing them off the right edge of the sidebar. Anchor only on .body-sidebar-bottom now. Co-Authored-By: Claude Opus 4.7 (1M context) --- jey_theme/public/js/jey_theme.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jey_theme/public/js/jey_theme.js b/jey_theme/public/js/jey_theme.js index c23d19f..7adb0f3 100644 --- a/jey_theme/public/js/jey_theme.js +++ b/jey_theme/public/js/jey_theme.js @@ -678,11 +678,12 @@ (function () { "use strict"; - // Frappe v15 had a "Collapse" link we inserted before; v16 removed it. - // Fall back to body-sidebar-bottom as the parent in v16. + // Insert our labeled sidebar links at the top of .body-sidebar-bottom. + // We don't anchor on .collapse-sidebar-link anymore — Frappe brought it + // back in v16.17 as a tiny icon-button inside a horizontal flex row + // (.sidebar-bottom-actions), so inserting before it would push our links + // into that row and overflow the sidebar. window.jeySidebarAnchor = window.jeySidebarAnchor || function () { - var v15 = document.querySelector(".collapse-sidebar-link"); - if (v15) return { parent: v15.parentNode, before: v15 }; var bottom = document.querySelector(".body-sidebar .body-sidebar-bottom"); if (bottom) return { parent: bottom, before: bottom.firstChild }; return null;