fix(mobile): collapse search bar to icon on mobile

On mobile (<640px), the full search bar with placeholder text and ⌘K
badge was taking too much space in the topbar. Now shows just a
magnifying glass icon that opens the same command palette on tap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 13:51:14 +00:00
parent 4bc98497e2
commit 701a3b6020

View File

@@ -78,10 +78,10 @@ export function TopBar() {
{/* Spacer - push search to center */}
<div className="flex-1" />
{/* Search trigger */}
{/* Search trigger — icon on mobile, full bar on desktop */}
<button
onClick={() => setCommandPaletteOpen(true)}
className="relative w-full text-left"
className="hidden sm:relative sm:block w-full text-left"
style={{ maxWidth: '480px' }}
>
<Search size={16} className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground" />
@@ -92,6 +92,13 @@ export function TopBar() {
{navigator.platform?.toLowerCase().includes('mac') ? '⌘K' : 'Ctrl+K'}
</span>
</button>
<button
onClick={() => setCommandPaletteOpen(true)}
className="sm:hidden rounded-lg p-2 text-muted-foreground hover:bg-card hover:text-foreground transition-colors"
title="Search"
>
<Search size={18} />
</button>
{/* Spacer - push actions to right */}
<div className="flex-1" />