Add NFT name search to the global search bar
- Dominant language
- Rust
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
The global search bar can return NFT collections, but it cannot return individual NFT tokens by name. The frontend already supports `nft` search results and token detail navigation, but the backend search handler does not currently query `nft_tokens`.
## Proposed change
Add support for searching individual NFTs by token name from the global search bar.
### Backend
- Extend the search API to query `nft_tokens.name`
- Return `nft` search results with the fields needed by the existing UI:
- `contract_address`
- `token_id`
- `name`
- `image_url`
- Keep current collection search behavior intact
- Consider joining `nft_contracts` to include collection context if needed for labeling
### Frontend
- Reuse the existing `nft` search result type in the search bar
- Make sure NFT token matches are rendered clearly and navigate to `/nfts/{contract_address}/{token_id}`
- Keep collection and token results visually distinguishable
## Notes
- Search should remain fast and avoid broad unbounded scans
- It may be worth limiting NFT token matches more aggressively than collection matches if needed
- This should use the existing raw token `name` already stored in `nft_tokens`
## Acceptance criteria
- Searching by an NFT token name can return matching NFT tokens
- Selecting a token result opens the NFT detail page
- Existing address / tx / block / collection search behavior is unchanged
Contributor guide
Assessment
This issue has not been assessed yet.