Skip to content

refactor(components): read 'items' instead of deprecated 'hits' from 'useInfiniteHits' - #1630

Merged
tannerlinsley merged 3 commits into
mainfrom
refactor/search-infinite-hits-items
Nov 23, 2026
Merged

tannerlinsley merged 3 commits into
mainfrom
refactor/search-infinite-hits-items

Conversation

@sukvvon

@sukvvon sukvvon commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

hits returned by useInfiniteHits is deprecated in favor of items. SearchModal and AiDock now destructure items and keep the local name hits, so the rest of each component is unchanged.

In connectInfiniteHits, both fields are the same array (hits: items, items: items), so behavior is identical.

Verification

  • tsc, oxlint and oxfmt pass; typescript/no-deprecated no longer reports hits in these files.
  • Local dev: Cmd+K search for useQuery renders results as before.

Summary by CodeRabbit

  • Bug Fixes
    • Search results in chat and command search now use the correct results collection, keeping result display and pagination working as expected.

@sukvvon sukvvon self-assigned this Nov 23, 2026
@changeset-bot

changeset-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f5b3379

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 41030e14-a1a3-4409-9019-7bcfbd21682c
Commits

Reviewing files that changed from the base of the PR and between 19114dc and f5b3379.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Both SearchResultsInChat and CommandSearchResults now read infinite-search results from the items property. Their pagination and result handling remain unchanged.

Changes: Search result access

Layer / File(s) Summary
Update search result access
src/components/AiDock.tsx, src/components/SearchModal.tsx
Both components now read result records from items. Existing pagination and downstream handling remain unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor

Suggested reviewers: tannerlinsley, ladybluenotes

Merge Risk: Minimal · previous review 19114

This swaps a deprecated search-result property for its replacement in two search components. Behavior is expected to stay the same, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title says the refactor reads 'items' instead of the deprecated 'hits' from 'useInfiniteHits'. The raw summary confirms this: SearchModal.tsx destructures items and aliases it to hits, and AiDock.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title says the refactor reads 'items' instead of the deprecated 'hits' from 'useInfiniteHits'. The raw summary confirms this: SearchModal.tsx destructures items and aliases it to hits, and AiDock.tsx obtains results through items. The PR objectives match, noting the same migration with the local variable kept as hits. The title names the primary change and uses no vague terms.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9625a2da-88f7-4c6e-b8b3-41a1ea0f2333
Commits

Reviewing files that changed from the base of the PR and between d994265 and 19114dc.

Files selected for processing: 2

  • src/components/AiDock.tsx
  • src/components/SearchModal.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@github-actions

Copy link
Copy Markdown
Asset Main PR merge build Change
JavaScript 19580.39 KiB 19580.39 KiB 🔴 +0.00 KiB (+0.00%)
JavaScript (gzip) 6443.74 KiB 6443.68 KiB 🟢 -0.06 KiB (-0.00%)
CSS 823.32 KiB 823.32 KiB 0.00 KiB (0.00%)
CSS (gzip) 126.01 KiB 126.01 KiB 0.00 KiB (0.00%)
Page Main (gzip) PR merge build (gzip) Change
/ 595.03 KiB 595.04 KiB 🔴 +0.01 KiB (+0.00%)
/libraries 537.88 KiB 537.89 KiB 🔴 +0.00 KiB (+0.00%)
/start/latest 562.67 KiB 562.68 KiB 🔴 +0.01 KiB (+0.00%)
/router/latest 562.97 KiB 562.97 KiB 🔴 +0.00 KiB (+0.00%)
/query/latest 561.42 KiB 561.42 KiB 🔴 +0.01 KiB (+0.00%)
/table/latest 594.23 KiB 594.24 KiB 🔴 +0.01 KiB (+0.00%)
/charts/latest 643.53 KiB 643.53 KiB 🔴 +0.01 KiB (+0.00%)
/ai/latest 588.35 KiB 588.35 KiB 🔴 +0.00 KiB (+0.00%)
Docs article 548.94 KiB 548.95 KiB 🔴 +0.01 KiB (+0.00%)
Framework docs article 548.94 KiB 548.95 KiB 🔴 +0.01 KiB (+0.00%)
/blog 542.09 KiB 542.10 KiB 🔴 +0.00 KiB (+0.00%)
/maintainers 541.19 KiB 541.19 KiB 🔴 +0.01 KiB (+0.00%)
/showcase 539.14 KiB 539.14 KiB 🔴 +0.01 KiB (+0.00%)
/chat 537.61 KiB 537.62 KiB 🔴 +0.01 KiB (+0.00%)
/chat/c/:conversationId 538.33 KiB 538.34 KiB 🔴 +0.01 KiB (+0.00%)

Page sizes sum the JS and CSS in the TanStack Start manifest for each route and its layouts. Shared files count once per page.

Compared with main at b64bef2. Gzip sizes are summed per file. Build run

@tannerlinsley

Copy link
Copy Markdown
Member

The installed Algolia connector exposes hits and items as the same array, so this keeps search results and pagination unchanged while removing the deprecated property access.

AI review notes: Reviewed both changed call sites at f5b3379 and verified connectInfiniteHits returns hits: items and items: items. CI passed; reported JavaScript gzip decreases 0.06 KiB and CSS is unchanged. I did not repeat the author’s browser search test. CodeRabbit skipped this diff, which is not an independent approval.

@tannerlinsley
tannerlinsley merged commit c63d86f into main Nov 23, 2026
11 checks passed
@tannerlinsley
tannerlinsley deleted the refactor/search-infinite-hits-items branch November 23, 2026 17:59
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