6.5 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| quick | 260411-0zq | execute | 1 |
|
true |
|
|
Purpose: Cleaner search UX — one search bar in the nav, navigates to catalog page with query pre-filled. Output: Updated TopNav.tsx with real input, updated global-items/index.tsx reading from URL params.
<execution_context> @.claude/get-shit-done/workflows/execute-plan.md @.claude/get-shit-done/templates/summary.md </execution_context>
@CLAUDE.md @src/client/components/TopNav.tsx @src/client/routes/global-items/index.tsx @src/client/stores/uiStore.ts Task 1: Convert TopNav search button to real input with navigation src/client/components/TopNav.tsx Replace the fake search button (lines 101-111) with a real text input that:- Uses local state for the search query (useState).
- Styled as a proper search bar — wider, taller, with a search icon on the left. Use classes like:
bg-gray-50 border border-gray-200 rounded-lg pl-9 pr-3 py-2 text-sm text-gray-900 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-gray-300 w-48 lg:w-64 transition-colors. Keephidden md:flexfor desktop-only. - On Enter keypress OR clicking the search icon: navigate to
/global-items?q=<encodeURIComponent(query)>using TanStack Router'suseNavigate(). Only navigate if query is non-empty (trimmed). After navigation, clear the input. - The search icon (LucideIcon name="search") sits inside the input container as an absolute-positioned clickable element on the left side.
- Remove the
openCatalogSearchimport from uiStore IF it is no longer used in this file (it will no longer be used since the button is replaced). Keep the import ofuseUIStoreif still needed foropenAuthPrompt.
Do NOT touch CatalogSearchOverlay or its usage from FabMenu/BottomTabBar/CollectionView — those flows remain unchanged. cd /home/jean-luc-makiola/Development/projects/GearBox && bun run lint 2>&1 | tail -20 TopNav shows a real search input. Typing and pressing Enter navigates to /global-items?q=query. Search icon is clickable. Input clears after navigation.
Task 2: Global items page reads query from URL search params src/client/routes/global-items/index.tsx Update the global items route to read the search query from URL params instead of having its own search input:-
Add search param validation to the route using TanStack Router's
validateSearch:import { z } from "zod"; export const Route = createFileRoute("/global-items/")({ component: GlobalItemsCatalog, validateSearch: z.object({ q: z.string().optional().catch(undefined), }), }); -
In GlobalItemsCatalog, use
const { q } = Route.useSearch()to get the query param. -
Remove the local
searchInputstate and thedebouncedQuerystate + debounce useEffect. Instead, useqdirectly as the search query passed touseGlobalItems(q || undefined). The debounce is no longer needed since the user submits from the nav bar (no keystroke-by-keystroke filtering). -
Remove the entire search input UI (the
<div className="relative w-full sm:w-auto sm:max-w-xs">block with the SVG icon and input, lines 44-86). Keep the title row but simplify it — just the "Global Gear Catalog" heading, no search input beside it. -
Keep the back link to Discover.
-
Show a small text below the title indicating the current search, e.g., if
qexists:<p className="text-sm text-gray-500 mb-4">Showing results for "<strong>{q}</strong>"</p>. If noq, show nothing extra (the page shows all items). -
Update the empty state text: if
qexists, "No items found matching your search"; if noq, "No items in the global catalog yet" (same logic as before, but usingqinstead ofdebouncedQuery). cd /home/jean-luc-makiola/Development/projects/GearBox && bun run lint 2>&1 | tail -20 Global items page reads ?q= from URL. No duplicate search input on the page. Results filter based on URL query. Page works with and without q param.
<success_criteria>
- Nav search bar is visually a real input (not a fake button)
- Enter/search icon navigates to /global-items?q=query
- Global items page reads q from URL, no duplicate search input
- CatalogSearchOverlay unaffected for FAB/BottomTabBar flows
- Lint and build pass </success_criteria>