From e88bb74e1e7ccd68250ad00f0e8008bfd70b3429 Mon Sep 17 00:00:00 2001 From: grabowski Date: Wed, 18 Nov 2026 11:56:15 +0700 Subject: [PATCH] Sidebar stays in place on long pages The sections in the sidebar scrolled away with a long page (a person's Visa and stay tab, the activity log). The sidebar is now sticky under the top bar and as tall as the window; a window too short for it scrolls the sidebar on its own. On phones the row of sections stays under the top bar. A jump to an anchor (#doc-7 after an upload) lands below the bars that stay in place: scroll-padding of the top bar's height, plus the sections' row on phones. --- static/app.css | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/static/app.css b/static/app.css index 309986c..aeab551 100644 --- a/static/app.css +++ b/static/app.css @@ -57,6 +57,10 @@ html[data-theme="light"] { * { box-sizing: border-box; } +/* a jump to #doc-7 lands below the bars that stay in place */ +html { + scroll-padding-top: calc(var(--toph) + 16px); +} body { margin: 0; background: var(--bg); @@ -187,7 +191,16 @@ h2 { grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--toph)); } +/* the sections stay in place under the top bar on pages of any length; a + sidebar taller than the window scrolls on its own */ .side { + position: sticky; + top: var(--toph); + z-index: 10; + align-self: start; + height: calc(100vh - var(--toph)); + height: calc(100dvh - var(--toph)); + overflow-y: auto; display: flex; flex-direction: column; gap: 18px; @@ -1006,7 +1019,13 @@ textarea.mrz { .app { grid-template-columns: minmax(0, 1fr); } + /* on phones the sections are a row that stays under the top bar */ + html { + scroll-padding-top: calc(var(--toph) + 66px); + } .side { + height: auto; + overflow: visible; flex-direction: row; align-items: center; gap: 8px;