perf: lower network requests after select all checkbox#1576
perf: lower network requests after select all checkbox#1576nizzyabi merged 3 commits intoMail-0:stagingfrom
Conversation
WalkthroughThe SelectAllCheckbox component was refactored to defer fetching all matching thread IDs until the user explicitly requests it via a toast action. A caching mechanism for fetched IDs was introduced, and the maximum number of thread IDs fetched per page was increased. The component now manages fetching state and cache invalidation based on folder or query changes. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SelectAllCheckbox
participant Toast
participant ThreadFetcher
participant BulkSelection
User->>SelectAllCheckbox: Toggle "Select All"
SelectAllCheckbox->>Toast: Show "Select all conversations" action
User->>Toast: Click "Select all conversations"
alt IDs not cached
SelectAllCheckbox->>ThreadFetcher: Fetch all matching thread IDs
ThreadFetcher-->>SelectAllCheckbox: Return thread IDs
SelectAllCheckbox->>BulkSelection: Update with all IDs
SelectAllCheckbox->>SelectAllCheckbox: Cache IDs
else IDs cached
SelectAllCheckbox->>BulkSelection: Update with cached IDs
end
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
PR Summary
Optimized select-all checkbox functionality to reduce network overhead in the mail application's thread selection system.
- Implemented thread ID caching using
useRefinapps/mail/components/mail/select-all-checkbox.tsxto prevent redundant fetching - Increased
MAX_PER_PAGEfrom 100 to 500 threads to minimize pagination requests - Deferred thread ID fetching to toast action callback for better performance
- Added cache clearing mechanism via
useEffectwhen folder or search parameters change - Simplified UI by removing specific thread count from selection toast
1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
decrease network requests trips
also removes the "select all x conversations" to make it more fast
perf.mp4
Summary by CodeRabbit
New Features
Refactor
Style