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) <noreply@anthropic.com>
This commit is contained in:
Ali 2026-04-29 11:19:30 +00:00
parent 94b6f4f75e
commit 534c98e062
1 changed files with 5 additions and 4 deletions

View File

@ -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;