Parts search bar UX notes
Overview The widget (see ) powers every catalog page. It is composed of three interactive zones:
Parts search bar UX notes
Overview
The PartsSearchBar widget (see features/search-bar/ui/parts-search-bar.tsx) powers every catalog page. It is composed of three interactive zones:
- Query input + inline completion — accepts free text and can accept ghost text with →.
- Mode / Advanced toggle — sets the intent (
auto,parts,equipment) and exposes theAdvancedFormsheet (mode + "fitment only"). - Autocomplete panel — Tahoe-styled popover with grouped suggestions, keyboard navigation, and analytics hooks.
All logic lives in the search feature layer (FSD) and does not duplicate the sidebar filter tree.
Advanced search ("Lite")
- The advanced sheet only exposes two options:
ModeToggleandFitment data only1. - The default mode is always
auto; users cannot trigger an extra query field inside the sheet. - Apply simply pushes
/parts?mode=…&hasEquipmentFitment=true. There is no "Open full filters" shortcut and no redundant inputs.
Autocomplete panel
- Suggestions are grouped into ordered chips: Direct, Manufacturers, Categories, Fits equipment, Descriptions.
- Chips (tabs) live inside the panel header and capture
←/→navigation. While focus is inside the input or the suggestions list, a singleTabkeystroke flips sections (useEscto close before moving focus elsewhere). - The input never hijacks
←/→; it only handles↑/↓,Home/End,Tab(section switch),Enter,Esc, and→(to accept inline completion when the caret is at the end). - Selection state is tracked as
{ groupIndex, itemIndex }, so↑/↓wraps only inside the active section whileTabperforms section jumps. - Analytics emitted:
autocomplete_click(existing),autocomplete_group_switchwith{ from_group, to_group, source },inline_completion_view/inline_completion_accept.
Inline completion
- If the top suggestion starts with the raw input, we show a ghost tail (muted text layered under the caret).
→at the end of the input accepts the completion and firesinline_completion_accept.- The feature is purely client-side and never mutates the value until acceptance.
Testing checklist
bun run linttsc --noEmitbunx vitest run features/search-bar/model/inline-completion.test.ts- Manual a11y pass (Tab order: input → tabs → list → footer;
Esccloses).
Release verification — 2025-11-07 (CT-65/66/67)
- Automated:
bunx vitest run app/parts(catalog + part-detail suites) — green. - Manual smoke:
/partsmode switching, grouped autocomplete withTabcycling, breadcrumbs + pagination, pricing filters, and/parts/[id]gallery/fallbacks (performed by QA, see CT-65 notes). - URL contract: search continues to emit
mode,q,manufacturer,category,priceBucket,priceMin,priceMax,hasImage,has360,availability,equipmentFitment,hasEquipmentFitment, andequipmentModelKey. Consumers should continue honoring these query params; equipment mode remains opt-in viamode=equipment.
Footnotes
-
Fits the "intent first" requirement from Tahoe — no duplication of sidebar filters. ↩
CROP Frontend Roadmap
Phase 1: Core Foundation - x Next.js 16 setup with App Router - x TypeScript strict mode - x Tailwind CSS v4 - x Biome linting/formatting - x Parts catalog...
shadcn/ui Components Documentation
This document lists all shadcn/ui components available in the CROP project. All components are located in and follow the Moby Design System patterns.