From 9fbeb352a45e86af0cd3c3391833bdeaf72b0660 Mon Sep 17 00:00:00 2001 From: Aditya Tripathi Date: Tue, 8 Sep 2026 00:47:58 +0000 Subject: [PATCH] feat(ui): auto-collapse sidebar on settings pages; fixed full-height rail Auto-collapse the main sidebar on pages that have a settings rail (follows the page when enabled; expanded elsewhere), with an animated slide and a profile-menu toggle (localStorage) to disable it. Rework the settings rail to position:fixed like the main sidebar: full height (3rem -> viewport bottom), left tracks the sidebar's collapsing width via --sidebar-w, content pinned to grid column 2. Fixes the sticky scroll crop and top/bottom gaps. --- resources/css/app.css | 24 +++++++------ .../views/components/top-user-menu.blade.php | 16 +++++++++ resources/views/layouts/app.blade.php | 35 +++++++++++++++++-- 3 files changed, 62 insertions(+), 13 deletions(-) diff --git a/resources/css/app.css b/resources/css/app.css index 91476dbd4..6efbde121 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1765,15 +1765,13 @@ .server-settings-workspace > :not(.application-settings-navigation) { } @media (min-width: 1280px) { - /* Flat rail welded to the main sidebar: full height (3rem → bottom), surface - bled left across
's gutter. Negative margins cancel main's pt breathing - and the 2.5rem gutter (lg:px-10). */ + /* Fixed like the main sidebar (3rem → bottom); left tracks its width (--sidebar-w). + Fixed leaves the grid, so the content sibling is pinned to column 2 below. */ .application-settings-navigation { - position: sticky; + position: fixed; top: 3rem; - margin-top: -1.75rem; - margin-left: -2.5rem; - align-self: start; + left: var(--sidebar-w, 14rem); + width: calc(210px + 2.5rem); height: calc(100dvh - 3rem); overflow-x: hidden; overflow-y: auto; @@ -1785,6 +1783,11 @@ @media (min-width: 1280px) { padding: 0.5rem; background: var(--rail-fill); border-right: 1px solid var(--coollabs-hairline); + transition: left 200ms ease; + } + + .application-settings-navigation ~ * { + grid-column: 2; } html:not(.dark) .application-settings-navigation { @@ -1808,13 +1811,14 @@ @media (min-width: 1280px) { background: var(--coollabs-line); } - /* Embeds: keep the surface, drop the weld/full-height. */ + /* Embeds: keep the surface, drop the fixed positioning. */ .application-settings-navigation.is-flush { position: static; + inset: auto; + width: auto; height: auto; overflow: visible; - margin-top: 0; - margin-left: 0; + transition: none; } } diff --git a/resources/views/components/top-user-menu.blade.php b/resources/views/components/top-user-menu.blade.php index ad5f0e6f1..b3559970b 100644 --- a/resources/views/components/top-user-menu.blade.php +++ b/resources/views/components/top-user-menu.blade.php @@ -84,6 +84,22 @@ class="flex size-5 shrink-0 items-center justify-center rounded-full bg-neutral- + +
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index aa1311d1e..667ad2318 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -9,21 +9,50 @@ @auth