feat: Super Search — global command palette (Cmd+K)#81
Conversation
Fixes type mismatch where getTripStatusVariant() expects TripStatus but received plain string from the base SearchResultItem interface. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
"View all" from Super Search now navigates to /trips?search=term or /contacts?search=term. List pages read the param on mount, pre-fill the search input, and filter results. Trips page switches to table view when search param is present. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
useState only captures initial value once — useSearchParams resolves async in Next.js, so the initial render has empty params. Use useEffect to sync urlSearch into both searchInput and filters when it resolves. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Next.js 15 requires useSearchParams() to be inside a Suspense boundary for static page generation. Wrap trips and contacts pages with Suspense. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThe PR introduces a unified global search feature accessible via keyboard shortcut. It updates the contacts and trips pages to synchronize URL search parameters with UI state, adds a new Super Search Dialog component in the top navigation, creates a backend search endpoint that concurrently searches trips and contacts, and exports shared TypeScript types defining search result structures. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant TopNav as TopNav Component
participant Dialog as SuperSearchDialog
participant Hook as useSearch Hook
participant API as Search API
participant Services as Trip/Contact Services
User->>TopNav: Press Cmd+K or click search
TopNav->>Dialog: Open dialog
User->>Dialog: Type search query
Dialog->>Hook: useSearch(query)
Hook->>Hook: Debounce for 300ms
Hook->>API: GET /search?q=query
API->>Services: Concurrent search trips & contacts
Services-->>API: Return results
API-->>Hook: SearchResponseDto
Hook-->>Dialog: Results with trips & contacts
Dialog->>User: Display grouped results
User->>Dialog: Click result item
Dialog->>Dialog: Navigate via router.push()
Dialog->>TopNav: Close dialog
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
Summary
Cmd+K) in the admin navbar that searches across trips and contacts instantlyGET /api/v1/search?q=<term>&limit=5endpoint with proper access control viaTripAccessServiceandContactAccessService/trips?search=term,/contacts?search=term)shouldFilter={false}for server-driven resultsFiles Changed (14 commits)
SearchModule,SearchService,SearchController,SearchQueryDto— parallel search withPromise.allSettled()SuperSearchDialog(Dialog + Command),useSearchhook, TopNav wiringSearchResponseDto,TripSearchResult,ContactSearchResult?search=URL param with Suspense boundaryTest plan
Cmd+K— dialog opens/trips?search=termin table viewGenerated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Improvements