Skip to content

feat(instantsearch): add React search results page pattern (2/4)#23

Merged
NatanTechofNY merged 2 commits into
feat/instantsearch-source-of-truthfrom
feat/instantsearch-search-results-page
Jun 10, 2026
Merged

feat(instantsearch): add React search results page pattern (2/4)#23
NatanTechofNY merged 2 commits into
feat/instantsearch-source-of-truthfrom
feat/instantsearch-search-results-page

Conversation

@vascobettencourt

@vascobettencourt vascobettencourt commented May 18, 2026

Copy link
Copy Markdown
Member

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.ts files / 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

  • New 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.
  • New references/react/search-results-page/styling.mdais-* class hierarchy for results layout (refinements panel, hits grid, pagination, mobile drawer pattern).
  • New 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 main looks larger because it includes PR 1's commit until PR 1 merges. After PR 1 merges, please rebase this onto main (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)
  • Skill description unchanged (still 602/1024)
  • evals/evals.json has 8 prompts after this PR
  • Skill is self-contained — only intra-skill ../ links
  • Registered in marketplace.json — N/A
  • Goes in skills/

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} and insights={true}, <Configure> with the three required keys, <RefinementList> for brand and <HierarchicalMenu> for category, <SortBy> with replicas, <Pagination> (no <InfiniteHits>), NoResultsBoundary from useInstantSearch().results.nbHits, <Highlight> on hit text, .d.ts provenance for non-baked props, no getServerState on App Router. Eval 7 hit 6/6: searchable refinement list with type-sourced props, <CurrentRefinements> for chips, no rebuild-via-hooks.

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.

@sarahdayan sarahdayan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 to source-of-truth.md should do.
  • "Don't combine and " is in features prose and anti-patterns. Belongs in anti-patterns only.

Other nits (non-blocking):

  • features.md / styling.md link to ../custom-widgets.md and ../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>
@vascobettencourt

vascobettencourt commented May 20, 2026

Copy link
Copy Markdown
Member Author

Thanks @sarahdayan! Pushed 1866d03 addressing all three duplications. PRs #24 and #25 rebased onto the new head.

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.
@vascobettencourt vascobettencourt force-pushed the feat/instantsearch-search-results-page branch from 812bc4b to 52a437a Compare May 20, 2026 21:30
@vascobettencourt vascobettencourt force-pushed the feat/instantsearch-source-of-truth branch from 8eb583d to 9b69b3d Compare May 20, 2026 21:34
@vascobettencourt vascobettencourt force-pushed the feat/instantsearch-search-results-page branch from 52a437a to 1866d03 Compare May 20, 2026 21:34
@NatanTechofNY NatanTechofNY merged commit 965beb1 into feat/instantsearch-source-of-truth Jun 10, 2026
@NatanTechofNY NatanTechofNY deleted the feat/instantsearch-search-results-page branch June 10, 2026 18:36
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.

3 participants