Repository navigation
React migration: Search form - #331
Merged
Merged
Conversation
paigewilliams
requested review from
pollardld and
rhodges
and
a balanced review from Copilot
November 11, 2026 00:46
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The explore form can submit a retained query despite appearing blank, and older search responses can overwrite results from newer searches.
2 open issues
What changed in this PR
This PR advances the React search migration by connecting the Explore and Search forms to /api/search/ through shared state. Rendering search results remains a follow-up.
Changes:
- Adds shared search state, API submission, and navigation to the Search page.
- Reuses a checkbox component and category list across both forms.
- Updates login context syntax and removes debug logging.
| File | Description |
|---|---|
client/app/utils/constants.ts |
Defines shared search categories. |
client/app/routes/search.tsx |
Connects search controls to shared state and submission. |
client/app/routes/explore.tsx |
Connects the Explore form to the search flow. |
client/app/root.tsx |
Provides search context across routes. |
client/app/layouts/private-route.tsx |
Removes authentication debug logging. |
client/app/context/searchContext.tsx |
Manages search state, requests, and navigation. |
client/app/context/loginContext.tsx |
Updates context syntax and login action reference. |
client/app/context/action.ts |
Adds search API requests and renames the login action. |
client/app/components/header.tsx |
Reformats username markup without changing behavior. |
client/app/components/checkbox.tsx |
Adds a reusable controlled checkbox. |
Review effort: Balanced
Comment on lines
+44
to
+48
| const handleSearch = useCallback(async () => { | ||
| try { | ||
| const response = await submitSearchAction({ categories, query }); | ||
| const { results } = response; | ||
| setResults(results); |
| name="query" | ||
| placeholder="Search" | ||
| aria-describedby="search-icon-label" | ||
| onChange={(e) => handleQueryChange(e.target.value)} |
Collaborator
Author
There was a problem hiding this comment.
this is the intended functionality!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

asana task
Changes
/api/search/endpointsearch/page after submitting the form on theexplore/pagecheckboxcomponentNext up: display the search results on the search page