From 79e9e6b5f2041949ac981c5526a1fd9671d9ffe3 Mon Sep 17 00:00:00 2001 From: Tyler <53561637+im-tyler@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:27:56 -0700 Subject: [PATCH] Collapse the header nav before it overflows Thirteen destinations need about 1275px beside the brand, but the nav only collapsed below 980px, so the page scrolled sideways between 981 and 1280px. The nav now tightens up to 1400px and collapses below 1240px; the content rules stay at 980px. Co-Authored-By: Claude Fable 5.2 --- .../frontend-test/header_layout.test.mjs | 7 +++++++ cmd/teploy-dash/frontend/css/style.css | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/cmd/teploy-dash/frontend-test/header_layout.test.mjs b/cmd/teploy-dash/frontend-test/header_layout.test.mjs index 8b21768..6c6bb2b 100644 --- a/cmd/teploy-dash/frontend-test/header_layout.test.mjs +++ b/cmd/teploy-dash/frontend-test/header_layout.test.mjs @@ -21,6 +21,13 @@ assert(menu.includes('class="nav-pins"') && menu.includes('x-data="navLinks"'), assert(/\.nav-pins \{ display: none; \}/.test(css), 'menu pins are hidden by default (desktop shows header icons)'); assert(/@media \(max-width: 640px\)[\s\S]*\.nav-pins \{ display: block;/.test(css), 'menu pins show on phones'); +// The nav collapses before it can overflow: thirteen destinations do not fit +// beside the brand below about 1200px (measured), so the toggle must take over +// at a width above that, not at the 980px content breakpoint. +const collapse = css.match(/@media \(max-width: (\d+)px\) \{\s*\.navbar \{[\s\S]*?\.nav-toggle \{ display: flex; \}/); +assert(collapse && Number(collapse[1]) >= 1200, 'the nav collapses to the toggle at 1200px or wider'); +assert((menu.match(/