From 5958e1035418954fc2d9a0c31776eaa87f09b4c2 Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Sun, 4 Feb 2024 00:56:42 +0530 Subject: [PATCH] Add Sidepanel Settings Body component and update button styles in EmptySidePanel component --- README.md | 5 + src/components/Common/Playground/Message.tsx | 20 ++- src/components/Sidepanel/Chat/empty.tsx | 2 +- src/components/Sidepanel/Chat/form.tsx | 6 +- src/components/Sidepanel/Settings/body.tsx | 177 +++++++++++++++++++ src/hooks/useMessage.tsx | 49 +++-- src/routes/index.tsx | 4 +- src/routes/sidepanel-settings.tsx | 2 + src/services/ollama.ts | 38 ++++ 9 files changed, 271 insertions(+), 32 deletions(-) create mode 100644 src/components/Sidepanel/Settings/body.tsx diff --git a/README.md b/README.md index afc3a04..8b91b7c 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ A simple browser extension to assist you in talking with the current page, along with a web UI for the [Ollama](https://github.com/ollama/ollama) project. + ## Features - [X] Fully local, no data is sent to any server @@ -13,6 +14,10 @@ A simple browser extension to assist you in talking with the current page, along - [ ] Other Local AI providers +## V1 + +If you are looking for the V1 of this project, you can find it on v1 branch. I created it as a hackathon project and it is not maintained anymore. + ## License MIT \ No newline at end of file diff --git a/src/components/Common/Playground/Message.tsx b/src/components/Common/Playground/Message.tsx index c75869a..d946b45 100644 --- a/src/components/Common/Playground/Message.tsx +++ b/src/components/Common/Playground/Message.tsx @@ -79,15 +79,17 @@ export const PlaygroundMessage = (props: Props) => { {props.images && (
- {props.images.map((image, index) => ( -
- Uploaded -
- ))} + {props.images + .filter((image) => image.length > 0) + .map((image, index) => ( +
+ Uploaded +
+ ))}
)} diff --git a/src/components/Sidepanel/Chat/empty.tsx b/src/components/Sidepanel/Chat/empty.tsx index 188e4af..c7fe6cd 100644 --- a/src/components/Sidepanel/Chat/empty.tsx +++ b/src/components/Sidepanel/Chat/empty.tsx @@ -79,7 +79,7 @@ export const EmptySidePanel = () => { saveOllamaURL(ollamaURL) refetch() }} - className="bg-blue-500 mt-4 hover:bg-blue-600 text-white px-4 py-2 rounded-md"> + className="bg-pink-500 mt-4 hover:bg-pink-600 text-white px-4 py-2 rounded-md dark:bg-pink-600 dark:hover:bg-pink-700"> Retry diff --git a/src/components/Sidepanel/Chat/form.tsx b/src/components/Sidepanel/Chat/form.tsx index 34982ec..e935589 100644 --- a/src/components/Sidepanel/Chat/form.tsx +++ b/src/components/Sidepanel/Chat/form.tsx @@ -57,7 +57,7 @@ export const SidepanelForm = ({ dropedFile }: Props) => { }) return ( -
+
{chatMode === "normal" && form.values.image && (
@@ -136,7 +136,7 @@ export const SidepanelForm = ({ dropedFile }: Props) => { } }} ref={textareaRef} - className="pl-4 pr-2 py-2 w-full resize-none bg-transparent focus-within:outline-none sm:text-sm focus:ring-0 focus-visible:ring-0 ring-0 dark:ring-0 border-0 dark:text-gray-100" + className="px-2 py-2 w-full resize-none bg-transparent focus-within:outline-none sm:text-sm focus:ring-0 focus-visible:ring-0 ring-0 dark:ring-0 border-0 dark:text-gray-100" required rows={1} tabIndex={0} @@ -145,7 +145,7 @@ export const SidepanelForm = ({ dropedFile }: Props) => { /> +
+
+
+

Prompt

+
+ setSelectedValue(e.target.value)}> + Normal + Rag + +
+ + {selectedValue === "normal" && ( +
+ + System Prompt + +