Skip to content

Implement Global Spotlight Search for Bounties with React Query #48

Description

@0xdevcollins

Overview

Implement a global search feature that allows users to quickly search across all bounties using a Spotlight-style modal (similar to macOS Spotlight or VS Code's Command Palette). The modal should be accessible from anywhere in the application via a keyboard shortcut or search button.

Acceptance Criteria

Core Functionality

  • Create a search modal component that overlays the entire screen with a backdrop blur
  • Implement keyboard shortcut to open search (Cmd+K on Mac, Ctrl+K on Windows/Linux)
  • Add a global search button in the header/navbar that triggers the modal
  • Close modal on Escape key press, backdrop click, or result selection
  • Auto-focus the search input when modal opens
    Search Implementation
  • Implement debounced search input (300ms delay) to prevent excessive API calls
  • Create GraphQL query for full-text search across bounties:
    • Search in issueTitle, description, projectName, tags
  • Use React Query (@tanstack/react-query) for:
    • Query caching and deduplication
    • Stale-while-revalidate pattern for instant results
    • Background refetching
    • Request cancellation on new search terms
      Search Results
  • Display results in a scrollable list with keyboard navigation (arrow keys)
  • Show relevant bounty information in results:
    • Issue title
    • Project name with logo
    • Reward amount and currency
    • Status badge (OPEN, CLAIMED, CLOSED)
    • Difficulty level
  • Highlight matching text in search results
  • Show empty state when no results found
  • Show loading skeleton during search
  • Navigate to bounty detail page on result selection (click or Enter)
    Recent & Suggested Searches
  • Store recent searches in localStorage (max 5 items)
  • Display recent searches when modal opens with empty input
  • Clear individual or all recent searches

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions