From 6ebd76fe6ae94cd420a96d1a54a170a0b81719a9 Mon Sep 17 00:00:00 2001 From: samlhuillier Date: Wed, 29 Nov 2023 11:06:02 -0600 Subject: [PATCH] fix styling on chatbot and similar files sidebar --- electron/main/index.ts | 2 - src/components/Chat/Chat.tsx | 2 +- src/components/FileEditorContainer.tsx | 47 ++++++++++--------- .../Similarity/SimilarFilesSidebar.tsx | 47 ++++++++++++------- 4 files changed, 57 insertions(+), 41 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 1694487f..fe33c81d 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -378,9 +378,7 @@ ipcMain.handle( console.log("writing file", filePath); // so here we can use the table we've created to add and remove things from the database. And all of the methods can be async to not hold up any threads await updateNoteInTable(dbTable, filePath, content); - console.log("content to write", content); await fs.writeFileSync(filePath, content, "utf-8"); - console.log("finished writing file..."); win?.webContents.send("vector-database-update"); } ); diff --git a/src/components/Chat/Chat.tsx b/src/components/Chat/Chat.tsx index 9b670b06..1d5e0a14 100644 --- a/src/components/Chat/Chat.tsx +++ b/src/components/Chat/Chat.tsx @@ -80,7 +80,7 @@ const ChatWithLLM: React.FC = () => { return (
-
+
{loading &&

Loading...

}
{messages.map((message, index) => ( diff --git a/src/components/FileEditorContainer.tsx b/src/components/FileEditorContainer.tsx index 52d8c004..e12e628e 100644 --- a/src/components/FileEditorContainer.tsx +++ b/src/components/FileEditorContainer.tsx @@ -46,28 +46,33 @@ const FileEditorContainer: React.FC = ({}) => { />
{selectedFilePath && ( -
-
- -
-
- -
- {showChatbot && ( -
- +
+
+
+ +
+
+
- )} +
+
+ )} + {showChatbot && ( +
+
)}
diff --git a/src/components/Similarity/SimilarFilesSidebar.tsx b/src/components/Similarity/SimilarFilesSidebar.tsx index ac4d974e..a208a106 100644 --- a/src/components/Similarity/SimilarFilesSidebar.tsx +++ b/src/components/Similarity/SimilarFilesSidebar.tsx @@ -59,25 +59,38 @@ const SimilarEntriesComponent: React.FC = ({ }, [filePath]); return ( -
- {loading ? ( -

Loading...

- ) : ( -
- {similarEntries.map((entry, index) => ( -
onFileSelect(entry.notepath)} - > -

- {entry.content} -

-
- ))} +
+ {similarEntries.map((entry, index) => ( +
onFileSelect(entry.notepath)} + > +

+ {entry.content} +

- )} + ))}
+ //
+ // {loading ? ( + //

Loading...

+ // ) : ( + //
+ // {similarEntries.map((entry, index) => ( + //
onFileSelect(entry.notepath)} + // > + //

+ // {entry.content} + //

+ //
+ // ))} + //
+ // )} + //
); };