Skip to content

feat: add search history tracking with recency-based suggestions (#124) - #229

Closed
bbkenny wants to merge 1 commit into
AudioBitsStellar:mainfrom
bbkenny:fix/audio-blocks-124-search-history
Closed

feat: add search history tracking with recency-based suggestions (#124)#229
bbkenny wants to merge 1 commit into
AudioBitsStellar:mainfrom
bbkenny:fix/audio-blocks-124-search-history

Conversation

@bbkenny

@bbkenny bbkenny commented Aug 3, 2026

Copy link
Copy Markdown

Closes #124

Summary

Added search history tracking with recency-based suggestions to the SearchOverlay component. Users can now see their recent searches as autocomplete suggestions when the search overlay opens, reducing typing and speeding up content discovery.

What changed

  • New hook hooks/useSearchHistory.ts:

    • Stores search queries with timestamps in localStorage under key "search-history"
    • Maximum 20 unique searches stored
    • Deduplication: re-searching the same query moves it to the top
    • Sorted by recency (most recent first)
    • Provides addSearch, clearHistory, and suggestions API
  • Updated components/common/SearchOverlay.tsx:

    • Integrated useSearchHistory hook
    • Shows recent searches as a dropdown when the search input is empty
    • Clicking a suggestion populates the search input and submits the search
    • Added "Clear" button with Trash2 icon to remove all history
    • Each search query is saved with a timestamp on submission

Acceptance Criteria

  • ✅ Each search query saved with timestamp
  • ✅ Maximum 20 unique searches stored
  • ✅ Most recent searches shown first in suggestions
  • ✅ Click on suggestion populates search input
  • ✅ Clear history removes all suggestions
  • ✅ Suggestions shown as dropdown below search input

Verification

  • npm run lint — no new warnings or errors introduced by this change
  • npm run test — 170/170 tests pass
  • npm run build — builds successfully (pre-existing TS errors in unrelated files remain unchanged)

…ioBitsStellar#124)

- Add hooks/useSearchHistory.ts hook for managing search history in localStorage
- Max 20 unique searches stored, deduplicated, sorted by recency
- Integrate useSearchHistory into SearchOverlay component
- Show recent searches as dropdown when search input is empty
- Allow clicking on a suggestion to populate and submit the search
- Add clear history button with Trash2 icon
- Each search query saved with timestamp
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

@thebabalola is attempting to deploy a commit to the akatenvictor's projects Team on Vercel.

A member of the Team first needs to authorize it.

@bbkenny bbkenny closed this Aug 3, 2026
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.

Add search history tracking with recency-based suggestions

2 participants