mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-10 22:32:16 +02:00
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:
parent
53259b6105
commit
e24abd7eac
5 changed files with 102 additions and 890 deletions
|
|
@ -260,16 +260,6 @@ export function FolderTreeView({
|
|||
|
||||
const nodes: React.ReactNode[] = [];
|
||||
|
||||
if (parentId === null) {
|
||||
const processingDocs = childDocs.filter((d) => {
|
||||
const state = d.status?.state;
|
||||
return state === "pending" || state === "processing";
|
||||
});
|
||||
for (const d of processingDocs) {
|
||||
nodes.push(renderDocumentNode(d, depth));
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < visibleFolders.length; i++) {
|
||||
const f = visibleFolders[i];
|
||||
const siblingPositions = {
|
||||
|
|
@ -314,15 +304,7 @@ export function FolderTreeView({
|
|||
}
|
||||
}
|
||||
|
||||
const remainingDocs =
|
||||
parentId === null
|
||||
? childDocs.filter((d) => {
|
||||
const state = d.status?.state;
|
||||
return state !== "pending" && state !== "processing";
|
||||
})
|
||||
: childDocs;
|
||||
|
||||
for (const d of remainingDocs) {
|
||||
for (const d of childDocs) {
|
||||
nodes.push(renderDocumentNode(d, depth));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue