commands.dev
commands.dev copied to clipboard
Add URL query parameter support for search
Summary
- Parse
?query=URL parameter on page load and populate the search input, triggering an Algolia search - Update the URL query parameter as the user types, enabling shareable/bookmarkable search links (e.g.
commands.dev/?query=git)
Why this matters
#60 - Users want to share direct links to search results and query commands.dev from the address bar.
Changes
components/search/CustomSearchBox.tsx: Read?query=param on mount via Next.js router, set search state and callrefine(); update URL on input change viahistory.replaceStatecomponents/search/MobileSearchBox.tsx: Same URL query parameter support for mobile search
Test plan
- [ ] Visit
/?query=gitand verify the search input is populated with "git" and results are shown - [ ] Type a search term and verify the URL updates to include
?query=<term> - [ ] Clear the search and verify
?query=is removed from the URL - [ ] Navigate to a different page and back - verify search resets correctly
Fixes #60
This contribution was developed with AI assistance (Claude Code).
@mvanhorn is attempting to deploy a commit to the warpdotdev Team on Vercel.
A member of the Team first needs to authorize it.
Code Review
PR: Add URL query parameter support for search by @mvanhorn
- ✅ Feature implementation
Wallet: 0xdaE5d307339074A24F579dB48e7c639359D94904
Code review
Code Review
PR: Add URL query parameter support for search by @mvanhorn
- ✅ Feature
Wallet: 0xdaE5d307339074A24F579dB48e7c639359D94904
Code review