-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: reset total state when switching directory filters #6878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix: reset total state when switching directory filters #6878
Conversation
Fixed issue where switching from empty teams filter to users or channels would show empty results. The problem was that changeType and toggleWorkspace were only resetting data array but not the total count, causing the load logic to think all data was already loaded. Now both data and total are reset when switching filters, ensuring proper state cleanup before new searches.
WalkthroughThe DirectoryView now stops any ongoing load and resets search state (clears data and sets total to -1) before changing type or toggling global/workspace, then triggers a fresh search to avoid stale empty results. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. Comment |
OtavioStasiak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main problem is that when you click to change the filter, sometimes newSearch is triggered as false. This is probably related to the debounce, so you should investigate it to really fix the root cause.
|
ok checking again... |
|
@OtavioStasiak can u pls review again have addressed your changes... |
Fixed issue where switching from empty teams filter to users or channels would show empty results. The problem was that changeType and toggleWorkspace were only resetting data array but not the total count, causing the load logic to think all data was already loaded.
Now both data and total are reset when switching filters, ensuring proper state cleanup before new searches.
Closes #6879
Before (Issue)
before.mov
After (Fix)
after.mov
Types of changes
Checklist
Further comments
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.