Skip to content

fix: reduce thread fetch limit#1579

Merged
AnishSarkar22 merged 2 commits into
MODSetter:mainfrom
AnishSarkar22:hotfix/ci-ui
Jul 7, 2026
Merged

fix: reduce thread fetch limit#1579
AnishSarkar22 merged 2 commits into
MODSetter:mainfrom
AnishSarkar22:hotfix/ci-ui

Conversation

@AnishSarkar22

@AnishSarkar22 AnishSarkar22 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR reduces the thread fetch limit from 40 to 6 across multiple components to optimize sidebar performance. The changes update query parameters in the data provider, sidebar components, and onboarding tour to fetch only 6 recent threads instead of 40, and also removes an unused isShared prop from the ChatListItem component.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/components/layout/providers/LayoutDataProvider.tsx
2 surfsense_web/components/layout/ui/sidebar/Sidebar.tsx
3 surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx
4 surfsense_web/components/onboarding-tour.tsx
5 surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx

Need help? Join our Discord

Summary by CodeRabbit

  • Bug Fixes
    • Recent chats now show a smaller, more relevant set of items in the sidebar.
    • The onboarding experience now checks a lighter recent-chat sample, helping it behave more consistently for returning users.
    • Chat list actions continue to work with updated options for archiving and restoring conversations.

… to 6 for improved performance

- Updated thread fetching logic across multiple components to limit the number of threads fetched to 6 instead of 40.
- Adjusted related placeholder data and chat display logic in the sidebar to reflect the new limit.
… components

- Removed the isShared prop from ChatListItemProps interface and its usage in the Sidebar component to simplify the code and improve clarity.
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@AnishSarkar22 AnishSarkar22 merged commit 261ace5 into MODSetter:main Jul 7, 2026
3 of 8 checks passed
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 555cfe34-fbb2-4696-a2b6-f1fa7efceb6c

📥 Commits

Reviewing files that changed from the base of the PR and between 431f826 and 04ea39f.

📒 Files selected for processing (5)
  • surfsense_web/components/layout/providers/LayoutDataProvider.tsx
  • surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx
  • surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx
  • surfsense_web/components/layout/ui/sidebar/Sidebar.tsx
  • surfsense_web/components/onboarding-tour.tsx

📝 Walkthrough

Walkthrough

Thread fetch limits were reduced from 40 to 6 across sidebar components (LayoutDataProvider, AllChatsSidebar, onboarding-tour) and Sidebar's rendered chat list. Separately, ChatListItemProps was updated to remove isShared and use archived, with Sidebar no longer passing isShared to ChatListItem.

Changes

Thread Limit Reduction and Prop Cleanup

Layer / File(s) Summary
Reduce thread query limits
surfsense_web/components/layout/providers/LayoutDataProvider.tsx, surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx, surfsense_web/components/onboarding-tour.tsx
Query keys and fetchThreads calls changed from limit 40 to limit 6, and placeholder data cache lookups updated to match.
ChatListItem prop update and Sidebar rendering
surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx, surfsense_web/components/layout/ui/sidebar/Sidebar.tsx
ChatListItemProps removes isShared and keeps archived; Sidebar slices recent chats to 6 items and no longer passes isShared to ChatListItem.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

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.

1 participant