From 62c3d33350a999dff0a695ccc01293c9826958cb Mon Sep 17 00:00:00 2001 From: ginnoir Date: Wed, 3 Jun 2026 19:55:00 -0500 Subject: [PATCH] fix: dashboard switcher, platform-aware search shortcut, mobile search, static topbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Always show dashboard tab strip + add button (was gated behind length > 1) - Search shortcut now shows Ctrl+K on Windows/Linux, ⌘K on Mac - Add icon-only search button in topbar for mobile viewports - Lock html/body overflow and use 100dvh to prevent topbar scrolling off-screen on mobile --- src/app/d/[slug]/page.tsx | 2 +- src/app/globals.css | 3 ++ src/components/quick-add-sheet.tsx | 8 ++++- src/components/topbar-search.tsx | 52 +++++++++++++++++++++--------- 4 files changed, 47 insertions(+), 18 deletions(-) diff --git a/src/app/d/[slug]/page.tsx b/src/app/d/[slug]/page.tsx index 86b27d4..ca0d84e 100644 --- a/src/app/d/[slug]/page.tsx +++ b/src/app/d/[slug]/page.tsx @@ -93,7 +93,7 @@ export default async function DashboardPage({ return (
- {userDashboards.length > 1 && ( + {userDashboards.length >= 1 && (
{userDashboards.map((d) => ( diff --git a/src/app/globals.css b/src/app/globals.css index 57970f7..e89de07 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -490,6 +490,8 @@ body { margin: 0; padding: 0; + height: 100%; + overflow: hidden; } body { @apply bg-background text-foreground; @@ -521,6 +523,7 @@ display: grid; grid-template-columns: 232px 1fr; height: 100vh; + height: 100dvh; background: var(--paper); } :where(html[data-nav="rail"]) .app { diff --git a/src/components/quick-add-sheet.tsx b/src/components/quick-add-sheet.tsx index 0a1fe0d..37392de 100644 --- a/src/components/quick-add-sheet.tsx +++ b/src/components/quick-add-sheet.tsx @@ -29,8 +29,14 @@ const QUICK_ADD_ICON: Record = { "file-plus": "note", }; +function useShortcutLabel() { + if (typeof navigator === "undefined") return "⌘K"; + return /Mac|iPhone|iPad|iPod/.test(navigator.platform) ? "⌘K" : "Ctrl+K"; +} + export function QuickAddSheet() { const { sheetOpen, closeSheet, actions } = useQuickAdd(); + const shortcut = useShortcutLabel(); const router = useRouter(); const backdropRef = useRef(null); @@ -110,7 +116,7 @@ export function QuickAddSheet() { }} > - Pick what to add — or use ⌘K to search. + Pick what to add — or use {shortcut} to search.
diff --git a/src/components/topbar-search.tsx b/src/components/topbar-search.tsx index 1a53290..f19f7fa 100644 --- a/src/components/topbar-search.tsx +++ b/src/components/topbar-search.tsx @@ -3,25 +3,45 @@ import { useQuickAdd } from "@/components/quick-add-provider"; import { NavIcon } from "@/components/nav-icon"; +function useShortcutLabel() { + if (typeof navigator === "undefined") return "⌘K"; + return /Mac|iPhone|iPad|iPod/.test(navigator.platform) ? "⌘K" : "Ctrl+K"; +} + export function TopbarSearch() { const { openPalette } = useQuickAdd(); + const shortcut = useShortcutLabel(); return ( - + <> + {/* Desktop: pill with shortcut hint */} + + + {/* Mobile: icon-only */} + + ); }