refactor(sidebar): streamline DocumentsSidebar and FolderTreeView for improved performance

- Removed unnecessary filtering logic in FolderTreeView to simplify document rendering.
- Updated DocumentsSidebar to eliminate redundant props and enhance layout consistency.
- Adjusted Sidebar component to conditionally render DocumentsSidebar based on the documentsPanel state.
This commit is contained in:
Anish Sarkar 2026-07-06 12:49:41 +05:30
parent 53259b6105
commit e24abd7eac
5 changed files with 102 additions and 890 deletions

View file

@ -27,7 +27,6 @@ import {
RightPanelToggleButton,
} from "../right-panel/RightPanel";
import {
DocumentsSidebar,
InboxSidebarContent,
MobileSidebar,
MobileSidebarTrigger,
@ -313,6 +312,7 @@ export function LayoutShell({
onChatArchive={onChatArchive}
onViewAllChats={onViewAllChats}
isAllChatsActive={isAllChatsPage}
documentsPanel={documentsPanel}
user={user}
onSettings={onSettings}
onManageMembers={onManageMembers}
@ -366,14 +366,6 @@ export function LayoutShell({
)}
</AnimatePresence>
</SidebarSlideOutPanel>
{/* Mobile Documents Sidebar - separate (not part of slide-out group) */}
{documentsPanel && (
<DocumentsSidebar
open={documentsPanel.open}
onOpenChange={documentsPanel.onOpenChange}
/>
)}
</div>
</TooltipProvider>
</SidebarProvider>