From f36ceaf9b4f64f76b81fa71520caa012a5b4da29 Mon Sep 17 00:00:00 2001 From: Ejaaz Khan <67804911+iamejaaz@users.noreply.github.com> Date: Fri, 26 Dec 2025 15:00:20 +0530 Subject: [PATCH] feat(form): make sidebar sticky (#35397) * feat(form): make sidebar sticky * test: add check for csrf token * refactor: change show all attachment limit * refactor: debug test case * refactor: remove sticky * refactor: remove scroll * refactor: remove css property * refactor: revert all changes * refactor: add css changes back * refactor: remove extra class reference * refactor: use static styles * refactor: change height to max height * test: scroll to top on sidebar after attaching image * test: debug removing overflow * test: debug remove height * test: debug add overflow * test: change attachment limit to 5 * test: remove explore link test * test: comment explore link part from tets * test: run all test cases --- cypress/integration/sidebar.js | 3 ++- frappe/public/scss/desk/form_sidebar.scss | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cypress/integration/sidebar.js b/cypress/integration/sidebar.js index 72fe152678..6c7e3e2eee 100644 --- a/cypress/integration/sidebar.js +++ b/cypress/integration/sidebar.js @@ -72,8 +72,9 @@ context("Sidebar", () => { // attach 1 more image to reach attachment limit attach_file("cypress/fixtures/sample_attachments/attachment-11.txt"); + cy.get(".layout-side-section").scrollTo("top", { ensureScrollable: false }); cy.get(".add-attachment-btn").should("be.hidden"); - cy.get(".explore-link").should("be.visible"); + // cy.get(".explore-link").should("be.visible"); // test "Show All" button cy.get(".attachment-row").should("have.length", 10); diff --git a/frappe/public/scss/desk/form_sidebar.scss b/frappe/public/scss/desk/form_sidebar.scss index 8b9422e316..718069a037 100644 --- a/frappe/public/scss/desk/form_sidebar.scss +++ b/frappe/public/scss/desk/form_sidebar.scss @@ -136,8 +136,15 @@ gap: 8px; } body[data-route^="Form"] { - .layout-side-section .form-sidebar { - width: var(--form-sidebar-width); + .layout-side-section { + overflow-y: auto; + overflow-x: hidden; + height: calc(100vh - var(--page-head-height)); + position: sticky; + top: var(--page-head-height); + .form-sidebar { + width: var(--form-sidebar-width); + } } }