From cecbadab706ed1fcc366076b105626bd69a7f0db Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Mon, 26 Oct 2026 23:41:35 +0100 Subject: [PATCH] fix(admin): keep one page link visible in the scrolling sidebar on short windows The scrolling page list could shrink to its padding, hiding every link below about 255 px of height; it now keeps one link's height and the sidebar scrolls past that, without a horizontal scrollbar. The panel test pins the About rows that fill in late. Co-Authored-By: Claude Opus 5.5 --- src/Chronos.Server/Admin/web/admin.css | 4 +++- tests/Chronos.Server.Tests/Hosting/SystemEndpointTests.cs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Chronos.Server/Admin/web/admin.css b/src/Chronos.Server/Admin/web/admin.css index feba4560..bdaeb5da 100644 --- a/src/Chronos.Server/Admin/web/admin.css +++ b/src/Chronos.Server/Admin/web/admin.css @@ -83,7 +83,9 @@ h2 { font-size: 14px; font-weight: 600; } /* Short windows: the pages above scroll, so Settings and the account stay docked in view; the whole sidebar scrolls only when even those do not fit. The padding keeps the links' focus rings inside the scrolling list. */ .sidebar, .nav-group:not(.bottom) { overflow-y: auto; scrollbar-width: thin; } - .nav-group:not(.bottom) { flex: 1 1 0; align-content: start; padding: 4px; margin: -4px; } + .sidebar { overflow-x: hidden; } + /* At least one whole link stays visible (36 px plus the padding); below that the sidebar itself scrolls. */ + .nav-group:not(.bottom) { flex: 1 1 0; min-height: 44px; align-content: start; padding: 4px; margin: -4px; } .shell.collapsed { grid-template-columns: 56px minmax(0, 1fr); } .shell.collapsed .sidebar { padding-inline: 8px; } .shell.collapsed .sidebar-toggle { align-self: center; margin-inline-start: 0; } diff --git a/tests/Chronos.Server.Tests/Hosting/SystemEndpointTests.cs b/tests/Chronos.Server.Tests/Hosting/SystemEndpointTests.cs index 1a78bdeb..6ba95e2c 100644 --- a/tests/Chronos.Server.Tests/Hosting/SystemEndpointTests.cs +++ b/tests/Chronos.Server.Tests/Hosting/SystemEndpointTests.cs @@ -171,6 +171,9 @@ public sealed class SystemEndpointTests(TestContext context) Assert.Equal(HttpStatusCode.NotFound, about.StatusCode); var settings = await server.Client.GetStringAsync("/admin/pages/settings.js"); Assert.Contains(@"id=""about-title""", settings); + // The page draws before the dashboard aggregate answers; these two rows fill in afterwards. + Assert.Contains(@"id=""about-database""", settings); + Assert.Contains(@"id=""about-uptime""", settings); } /// The menu's page groups as app.js lists them: the top pages, then the ones docked at the foot.