feat(instantsearch): add React search results page pattern (2/4)#23
Merged
NatanTechofNY merged 2 commits intoJun 10, 2026
Conversation
This was referenced May 18, 2026
Adds the canonical widget tree (SearchBox, Configure, Hits, Pagination, Stats, NoResultsBoundary), the refinements catalog (RefinementList, HierarchicalMenu, RangeInput, ToggleRefinement, CurrentRefinements, ClearRefinements), sort via SortBy with replicas, and multi-index guidance. The pattern reference points reviewers at types and live docs for prop-level details rather than baking them in. Adds evals 6 and 7 covering the full results page and a searchable refinement list with active-filter chips. Stacks on feat/instantsearch-source-of-truth.
907a605 to
f38efca
Compare
6 tasks
sarahdayan
reviewed
May 20, 2026
sarahdayan
left a comment
Member
There was a problem hiding this comment.
Duplication worth tightening:
- routing={true} / insights={true} are covered in PR 1's "Always" rules, this PR's
anti-patterns.md, and the features checklist. The anti-patterns rows are the redundant ones. - "Read the .d.ts before writing props" appears four times in
features.md. One intro mention + a link tosource-of-truth.mdshould do. - "Don't combine and " is in features prose and anti-patterns. Belongs in anti-patterns only.
Other nits (non-blocking):
features.md/styling.mdlink to../custom-widgets.mdand../ssr.md, which arrive in PR 3. It's fine if 2 → 3 ships in order.
vascobettencourt
added a commit
that referenced
this pull request
May 20, 2026
Three duplications tightened, all per Sarah's review:
- features.md: collapsed five "read .d.ts" / "wire props from types"
mentions down to a single intro reference to the Source-of-truth
check. The intro on line 5 is the canonical pointer; the rest are
rephrased to drop the rule restatement.
- features.md: removed "Do not combine both" from the
Pagination-vs-InfiniteHits prose. The dedicated entry already lives
in anti-patterns.md; the checklist's "(or InfiniteHits, not both)"
is enough of a reminder.
- anti-patterns.md: removed the "Forgetting routing={true}" and
"Forgetting insights={true}" rows. Both are already covered by
PR #22's Always rules and the features checklist; the anti-patterns
rows were the redundant copy.
Forward-references to ../custom-widgets.md and ../ssr.md (PR #24)
left in place per Sarah's "non-blocking, fine if 2 -> 3 ships in
order" note.
Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
Thanks @sarahdayan! Pushed |
vascobettencourt
added a commit
that referenced
this pull request
May 20, 2026
Three duplications tightened, all per Sarah's review:
- features.md: collapsed five "read .d.ts" / "wire props from types"
mentions down to a single intro reference to the Source-of-truth
check. The intro on line 5 is the canonical pointer; the rest are
rephrased to drop the rule restatement.
- features.md: removed "Do not combine both" from the
Pagination-vs-InfiniteHits prose. The dedicated entry already lives
in anti-patterns.md; the checklist's "(or InfiniteHits, not both)"
is enough of a reminder.
- anti-patterns.md: removed the "Forgetting routing={true}" and
"Forgetting insights={true}" rows. Both are already covered by
PR #22's Always rules and the features checklist; the anti-patterns
rows were the redundant copy.
Forward-references to ../custom-widgets.md and ../ssr.md (PR #24)
left in place per Sarah's "non-blocking, fine if 2 -> 3 ships in
order" note.
Three duplications tightened, all per Sarah's review:
- features.md: collapsed five "read .d.ts" / "wire props from types"
mentions down to a single intro reference to the Source-of-truth
check. The intro on line 5 is the canonical pointer; the rest are
rephrased to drop the rule restatement.
- features.md: removed "Do not combine both" from the
Pagination-vs-InfiniteHits prose. The dedicated entry already lives
in anti-patterns.md; the checklist's "(or InfiniteHits, not both)"
is enough of a reminder.
- anti-patterns.md: removed the "Forgetting routing={true}" and
"Forgetting insights={true}" rows. Both are already covered by
PR #22's Always rules and the features checklist; the anti-patterns
rows were the redundant copy.
Forward-references to ../custom-widgets.md and ../ssr.md (PR #24)
left in place per Sarah's "non-blocking, fine if 2 -> 3 ships in
order" note.
vascobettencourt
added a commit
that referenced
this pull request
May 20, 2026
Three duplications tightened, all per Sarah's review:
- features.md: collapsed five "read .d.ts" / "wire props from types"
mentions down to a single intro reference to the Source-of-truth
check. The intro on line 5 is the canonical pointer; the rest are
rephrased to drop the rule restatement.
- features.md: removed "Do not combine both" from the
Pagination-vs-InfiniteHits prose. The dedicated entry already lives
in anti-patterns.md; the checklist's "(or InfiniteHits, not both)"
is enough of a reminder.
- anti-patterns.md: removed the "Forgetting routing={true}" and
"Forgetting insights={true}" rows. Both are already covered by
PR #22's Always rules and the features checklist; the anti-patterns
rows were the redundant copy.
Forward-references to ../custom-widgets.md and ../ssr.md (PR #24)
left in place per Sarah's "non-blocking, fine if 2 -> 3 ships in
order" note.
812bc4b to
52a437a
Compare
8eb583d to
9b69b3d
Compare
52a437a to
1866d03
Compare
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.
What does this skill do?
Adds the highest-value new pattern to the InstantSearch skill: a search results page reference for React (covers faceted search, sort, pagination as one bundle, since the same widget tree underlies all three). The reference scaffolds the canonical widget tree and points at
.d.tsfiles / live docs for prop-level details rather than baking them in (those go stale).This is part 2 of 4. Stacks on #22 (PR 1), so review PR 1 first, then this.
What's in this PR
references/react/search-results-page/features.md— discovery (route, schema, refinement attributes, sort replicas), the canonical widget tree (<SearchBox>+<Configure>+<Hits>+<Pagination>+<Stats>+<NoResultsBoundary>), refinements catalog (<RefinementList>,<HierarchicalMenu>,<RangeInput>,<ToggleRefinement>,<CurrentRefinements>,<ClearRefinements>), sort with replicas, multi-index guidance, features checklist.references/react/search-results-page/styling.md—ais-*class hierarchy for results layout (refinements panel, hits grid, pagination, mobile drawer pattern).references/react/search-results-page/anti-patterns.md— pattern-specific anti-patterns (rebuilding pagination, missing no-results boundary, refinements outside their target<Index>, etc.).SKILL.md: adds the search-results-page row to the patterns table.evals/evals.json: adds eval 6 (full results page on App Router) and eval 7 (searchable refinement list + active-filter chips).Stacking note
This PR's diff against
mainlooks larger because it includes PR 1's commit until PR 1 merges. After PR 1 merges, please rebase this ontomain(or it'll auto-rebase via the merge queue). Reviewing only the second commit (feat(instantsearch): add React search results page pattern) is sufficient.Checklist
python3 scripts/validate_skills.py .passes (31/31)evals/evals.jsonhas 8 prompts after this PR../linksskills/Behavioral test
Evals 6 and 7 were exercised via fresh subagents. Eval 6 (full results page on App Router) hit 11/11 expectations:
<InstantSearchNext>at the layout level,routing={true}andinsights={true},<Configure>with the three required keys,<RefinementList>for brand and<HierarchicalMenu>for category,<SortBy>with replicas,<Pagination>(no<InfiniteHits>),NoResultsBoundaryfromuseInstantSearch().results.nbHits,<Highlight>on hit text,.d.tsprovenance for non-baked props, nogetServerStateon App Router. Eval 7 hit 6/6: searchable refinement list with type-sourced props,<CurrentRefinements>for chips, no rebuild-via-hooks.