From 20c1e341368d0c8e999a5cf0fb93b31a42e7ed52 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 16 Jun 2026 23:34:12 +0200 Subject: [PATCH] Refactor: Simplify sidebar UI by updating database listing and restricting new chat button visibility based on active mode --- src/App.jsx | 101 +++++----------------------------------------------- 1 file changed, 8 insertions(+), 93 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index ad4e1cd..85b5631 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1582,48 +1582,12 @@ async function createNewChat() { )} {activeSidebarMode === 'dbs' && (
- {libraries.length === 0 ? ( -
No databases yet.
- ) : ( - libraries.map(library => ( -
setActiveLibrarySlug(library.slug)} - > - {editingLibrarySlug === library.slug ? ( - setEditingLibrarySlug(null)} - onKeyDown={(e) => { - if (e.key === 'Enter') { - handleLibraryRename(library.slug, e.target.value) - } else if (e.key === 'Escape') { - setEditingLibrarySlug(null) - } - }} - autoFocus - /> - ) : ( - <> - {library.name} -
- {chatLibrarySlug === library.slug &&
Chat
} - {isLibrarySyncing(library.slug) &&
Syncing
} - - -
- - )} -
- )) - )} +
+ Knowledge +
+ {isLibrarySyncing(activeLibrary?.slug) &&
Syncing
} +
+
)} {activeSidebarMode === 'settings' && ( @@ -1643,58 +1607,9 @@ async function createNewChat() { /> )} - {(activeSidebarMode === 'chats' || activeSidebarMode === 'dbs') && ( + {activeSidebarMode === 'chats' && (
- {activeSidebarMode === 'chats' && ( - - )} - {activeSidebarMode === 'dbs' && ( - isCreatingLibrary ? ( -
- setNewLibraryName(e.target.value)} - onKeyDown={(e) => { - if (e.key === 'Enter') { - createLibrary() - } else if (e.key === 'Escape') { - setIsCreatingLibrary(false) - setNewLibraryName('') - setLibraryCreateError('') - } - }} - placeholder="Database name" - autoFocus - /> - {libraryCreateError &&
{libraryCreateError}
} -
- - -
-
- ) : ( - - ) - )} +
)}