Skip to content

Search results page - #332

Open
paigewilliams wants to merge 7 commits into
paige-react-fe-testingfrom
search-results-page
Open

paigewilliams wants to merge 7 commits into
paige-react-fe-testingfrom
search-results-page

Conversation

@paigewilliams

Copy link
Copy Markdown
Collaborator

asana task

Changes

  • Adds TanStack Table to use in the /search/ page. I've used this library before and find it has a lot of helpful features. It worked with pagination out of the box, and integrates with bootstrap styles easily.
  • Styles the search input and checkboxes on the /search/ and /explore/ pages
  • Adds types for the filter categories to use in place of string
  • Executes a search request on the /explore/ page when clicking "go", and on the /search/ page when submitting the input or toggling a checkbox

@paigewilliams
paigewilliams requested review from pollardld and rhodges and a balanced review from Copilot November 12, 2026 21:53
@paigewilliams paigewilliams self-assigned this Nov 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Search results insert unsanitized HTML, enabling stored XSS, while unused imports trigger TypeScript errors under the enabled noUnusedLocals setting.

7 open issues
1 file not reviewed
  • client/package-lock.json: Generated file
What changed in this PR

Adds a paginated search-results interface to the React client and connects search submission and category filtering across the explore and search pages.

Changes:

  • Introduces a TanStack Table for displaying search results with pagination.
  • Adds typed search categories and results, with immediate searches when result-page filters change.
  • Updates search inputs, checkboxes, arrows, and welcome-page styling.
File Description
client/​package.json Adds the TanStack Table dependency.
client/​package-lock.json Locks table dependencies and supporting packages.
client/​app/​utils/​constants.ts Removes the former category constant.
client/​app/​types.ts Defines categories, result types, and mappings.
client/​app/​routes/​welcome.tsx Adds a welcome-specific class and stylesheet import.
client/​app/​routes/​welcome.css Receives paragraph styling from shared stylesheets.
client/​app/​routes/​search.tsx Adds the results table, pagination, and filter interactions.
client/​app/​routes/​search.css Styles search controls and result highlights.
client/​app/​routes/​explore.tsx Updates search submission and category layout.
client/​app/​index.css Removes shared paragraph styling.
client/​app/​context/​searchContext.tsx Tracks executed queries and coordinates filter-triggered searches.
client/​app/​context/​action.ts Types search-request categories.
client/​app/​components/​checkbox.tsx Updates checkbox markup and accessible naming.
client/​app/​components/​checkbox.css Adds checkbox appearance and keyboard-focus styling.
client/​app/​App.css Adds arrow styles and adjusts welcome-page layout rules.

Review effort: Balanced

Comment thread client/app/context/searchContext.tsx Resolved
}),
columnHelper.accessor("description", {
cell: (info) => (
<span dangerouslySetInnerHTML={{ __html: info.getValue() }}></span>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too concerned about this since the headline is set programmatically.

Comment on lines 64 to +65
setResults(results);
await navigate("/search");
setSearchedQuery(query); // update the executed searched query
Comment thread client/app/routes/search.css Resolved
Comment thread client/app/routes/search.tsx Resolved
Comment thread client/app/routes/search.tsx Resolved
Comment thread client/app/routes/search.tsx Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Search results render unsanitized descriptions and headlines as HTML, allowing stored malicious markup to execute scripts in other users’ sessions.

4 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Warn users when search results are truncated

client/​app/​routes/​search.tsx:227

ExploreSearch.get() truncates matches to the configured maximum and returns too_many_results, but the provider discards that flag and this count presents the truncated array as the complete result set. Broad searches can therefore silently omit matching records, and client-side pagination cannot reach them. Propagate the truncation flag and show a refine-search warning, as the existing Django results page does, rather than implying all matches are available.

3 resolved since last review
1 file not reviewed
  • client/package-lock.json: Generated file

Review effort: Balanced

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.

2 participants