From a95f10fcde61d82357481b6cd8a3b84ed42edeb7 Mon Sep 17 00:00:00 2001 From: ginnoir Date: Mon, 1 Jun 2026 18:00:49 -0500 Subject: [PATCH] fix: scope rail nav-label hiding to sidebar and fall back fab-only to sidebar on desktop --- src/app/globals.css | 6 +++--- src/app/layout.tsx | 2 +- src/modules/_core/themes.ts | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index a87ac9a..20b1b8a 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -471,14 +471,14 @@ color: var(--ink-mute); font-variant-numeric: tabular-nums; } -:where(html[data-nav="rail"]) .nav-item { +:where(html[data-nav="rail"]) .sidebar .nav-item { width: 40px; height: 40px; padding: 0; justify-content: center; } -:where(html[data-nav="rail"]) .nav-label, -:where(html[data-nav="rail"]) .nav-count { +:where(html[data-nav="rail"]) .sidebar .nav-label, +:where(html[data-nav="rail"]) .sidebar .nav-count { display: none; } .sidebar-top .nav-item { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6d6f5e0..1fe1246 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -69,7 +69,7 @@ const prePaintScript = `(function(){ var navStyle = localStorage.getItem('themeNavStyle') || 'rail-desktop'; var dataNav = navStyle === 'compact-rail' ? 'rail' : navStyle === 'top-nav' ? 'top' - : navStyle === 'fab-only' ? 'fab' : 'sidebar'; + : 'sidebar'; if (window.matchMedia && window.matchMedia('(max-width: 759px)').matches) { dataNav = navStyle === 'fab-only' ? 'fab' : 'bottom'; } diff --git a/src/modules/_core/themes.ts b/src/modules/_core/themes.ts index 5cd9acc..97ebc1f 100644 --- a/src/modules/_core/themes.ts +++ b/src/modules/_core/themes.ts @@ -83,14 +83,13 @@ export const DEFAULT_THEME: ThemeState = { // Map our nav style preference to the data-nav attribute we set on . // On mobile (handled by NavModeProvider) we override to "bottom" or "fab". +// fab-only has no desktop equivalent — falls back to sidebar so the nav doesn't disappear. export function navStyleToDataNav(style: NavStyle): "sidebar" | "rail" | "top" | "fab" { switch (style) { case "compact-rail": return "rail"; case "top-nav": return "top"; - case "fab-only": - return "fab"; default: return "sidebar"; }