Skip to content

✨ feat: Add global search across all projects (⌘K command palette)#36

Open
fulviofreitas wants to merge 4 commits intothomas-pedersen:mainfrom
fulviofreitas:pr/global-search
Open

✨ feat: Add global search across all projects (⌘K command palette)#36
fulviofreitas wants to merge 4 commits intothomas-pedersen:mainfrom
fulviofreitas:pr/global-search

Conversation

@fulviofreitas
Copy link

Hi @thomas-pedersen! 👋

First of all, thank you for creating this fantastic tool! I've been using Cursor Chat Browser daily to review my AI conversations, and it's been incredibly helpful for my workflow.

While using the app, I found myself frequently wanting to search across all my projects at once rather than navigating to each workspace individually. So I built a global search feature that I think could benefit other users too!

✨ What This PR Adds

A command palette-style global search that lets users instantly find any conversation across all their workspaces:

Search Demo to open from anywhere!

Key Features

Feature Description
🎹 Keyboard Shortcut ⌘K (Mac) / Ctrl+K (Windows/Linux) to open instantly
Real-time Search Results appear as you type (300ms debounce for performance)
🎯 Filter Tabs Filter by All, Ask Logs, or Agent Logs
⌨️ Keyboard Navigation / to navigate, Enter to open, Esc to close
📝 Context Snippets Shows matching text with surrounding context
🎨 Beautiful UI Command palette design matching modern dev tools

Technical Improvements

This PR also includes an important fix to the search API:

  • Updated to support new Cursor data format - The search now queries the cursorDiskKV table where newer Cursor versions store data (keys like composerData:* and bubbleId:*)
  • Backward compatibility maintained - Still searches the old ItemTable format for older data
  • Proper text extraction - Uses the same bubble parsing logic as the tabs route
  • Deduplication - Removes duplicate results

Files Changed

File Change
src/components/global-search.tsx New command palette search component
src/components/ui/dialog.tsx New Radix UI dialog component
src/components/navbar.tsx Added search button to navbar
src/app/api/search/route.ts Fixed search to support new data format

New Dependency

  • @radix-ui/react-dialog - For the modal dialog (consistent with your existing Radix UI usage)

🧪 Testing

I've tested this on:

  • ✅ macOS with latest Cursor version
  • ✅ Both light and dark themes
  • ✅ Keyboard-only navigation
  • ✅ Various search queries across multiple projects

💭 Why I Think This Would Be Valuable

  1. Saves time - No need to remember which project a conversation was in
  2. Familiar UX - Command palette is a pattern developers love (VS Code, Cursor, Raycast, etc.)
  3. Accessible - Full keyboard support for power users
  4. Non-intrusive - Doesn't change existing functionality, just adds to it

I'd be happy to make any adjustments based on your feedback! Whether it's code style changes, feature modifications, or anything else—just let me know.

Thanks again for your work on this project! 🙏

Best regards,
Fulvio

✨ New Features:
- Command palette style global search (⌘K / Ctrl+K)
- Real-time search with debouncing
- Filter by All/Ask Logs/Agent Logs
- Keyboard navigation support
- Shows contextual match snippets

🔧 Improvements:
- Updated search API to use new cursorDiskKV data format
- Backward compatibility with old ItemTable format
- Added @radix-ui/react-dialog for modal support
- Added .cursor/ to .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant