From f8f60c62fe83beb741db72cab667f7ce129371dc Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 4 Dec 2023 11:23:51 +0200 Subject: [PATCH 1/4] Add getLocalPrompt and setLocalPrompt functions to preferenceApi.ts --- frontend/src/preferences/preferenceApi.ts | 9 +++++++++ frontend/src/preferences/preferenceSlice.ts | 10 ++++++++++ frontend/src/store.ts | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/frontend/src/preferences/preferenceApi.ts b/frontend/src/preferences/preferenceApi.ts index aac06a01..81fd3131 100644 --- a/frontend/src/preferences/preferenceApi.ts +++ b/frontend/src/preferences/preferenceApi.ts @@ -66,10 +66,19 @@ export function getLocalRecentDocs(): string | null { return doc; } +export function getLocalPrompt(): string | null { + const prompt = localStorage.getItem('DocsGPTPrompt'); + return prompt; +} + export function setLocalApiKey(key: string): void { localStorage.setItem('DocsGPTApiKey', key); } +export function setLocalPrompt(prompt: string): void { + localStorage.setItem('DocsGPTPrompt', prompt); +} + export function setLocalRecentDocs(doc: Doc): void { localStorage.setItem('DocsGPTRecentDocs', JSON.stringify(doc)); let namePath = doc.name; diff --git a/frontend/src/preferences/preferenceSlice.ts b/frontend/src/preferences/preferenceSlice.ts index beeac465..0aa8b3b5 100644 --- a/frontend/src/preferences/preferenceSlice.ts +++ b/frontend/src/preferences/preferenceSlice.ts @@ -81,6 +81,16 @@ prefListenerMiddleware.startListening({ }, }); +prefListenerMiddleware.startListening({ + matcher: isAnyOf(setPrompt), + effect: (action, listenerApi) => { + localStorage.setItem( + 'DocsGPTPrompt', + JSON.stringify((listenerApi.getState() as RootState).preference.prompt), + ); + }, +}); + export const selectApiKey = (state: RootState) => state.preference.apiKey; export const selectApiKeyStatus = (state: RootState) => !!state.preference.apiKey; diff --git a/frontend/src/store.ts b/frontend/src/store.ts index 84225f61..234cc8e9 100644 --- a/frontend/src/store.ts +++ b/frontend/src/store.ts @@ -6,6 +6,7 @@ import { } from './preferences/preferenceSlice'; const key = localStorage.getItem('DocsGPTApiKey'); +const prompt = localStorage.getItem('DocsGPTPrompt'); const doc = localStorage.getItem('DocsGPTRecentDocs'); const store = configureStore({ @@ -13,7 +14,10 @@ const store = configureStore({ preference: { apiKey: key ?? '', selectedDocs: doc !== null ? JSON.parse(doc) : null, - prompt: { name: 'default', id: 'default', type: 'private' }, + prompt: + prompt !== null + ? JSON.parse(prompt) + : { name: 'default', id: 'default', type: 'private' }, conversations: null, sourceDocs: [ { From 23a1730106616a75a67ffd73a09493f8e1165d65 Mon Sep 17 00:00:00 2001 From: HeetVekariya Date: Fri, 8 Dec 2023 20:36:12 +0530 Subject: [PATCH 2/4] fix: API docs text overflow --- frontend/src/conversation/ConversationBubble.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 1d7c8564..e9de78ac 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -244,8 +244,8 @@ const ConversationBubble = forwardRef< ? 'rgba(125, 84, 209, 0.3)' : '#EEEEEE' : isLikeClicked - ? 'rgba(125, 84, 209, 0.3)' - : '#ffffff', + ? 'rgba(125, 84, 209, 0.3)' + : '#ffffff', }} >
-

{sources[openSource].text}

+

+ {sources[openSource].text} +

)} From d43927a1678ae50dcbcd6e8f757cf6739c88b433 Mon Sep 17 00:00:00 2001 From: Pavel Date: Sun, 10 Dec 2023 16:28:20 +0300 Subject: [PATCH 3/4] Fix_hero Fix of hero section for chrome and firefox. Fix of conversations-container pushing containers below. --- frontend/src/Hero.tsx | 18 +++++++++--------- frontend/src/Navigation.tsx | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index cb55ca1f..2d07e24b 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -36,14 +36,14 @@ export default function Hero({ className = '' }: { className?: string }) {
{/* first */} -
+
{/* Add Mobile check here */} {isMobile ? ( @@ -84,11 +84,11 @@ export default function Hero({ className = '' }: { className?: string }) {
{/* second */} -
+
{/* Add Mobile check here */} {isMobile ? ( @@ -121,11 +121,11 @@ export default function Hero({ className = '' }: { className?: string }) {
{/* third */} -
+
{/* Add Mobile check here */} {isMobile ? ( diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index d3df8b44..c7b51cb1 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -242,7 +242,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {

{conversations && ( -
+

Chats

{conversations?.map((conversation) => ( Date: Mon, 11 Dec 2023 12:18:47 +0000 Subject: [PATCH 4/4] Revert "Merge pull request #797 from arc53/fix_boxes_hero" This reverts commit 0bf020a1b4d0f0f00220e09cef9e1fdbaeaeb3bb, reversing changes made to a62566e8fb18f8cf59714d8615c30f7fd6c4cbc1. --- frontend/src/Hero.tsx | 18 +++++++++--------- frontend/src/Navigation.tsx | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index 2d07e24b..cb55ca1f 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -36,14 +36,14 @@ export default function Hero({ className = '' }: { className?: string }) {
{/* first */} -
+
{/* Add Mobile check here */} {isMobile ? ( @@ -84,11 +84,11 @@ export default function Hero({ className = '' }: { className?: string }) {
{/* second */} -
+
{/* Add Mobile check here */} {isMobile ? ( @@ -121,11 +121,11 @@ export default function Hero({ className = '' }: { className?: string }) {
{/* third */} -
+
{/* Add Mobile check here */} {isMobile ? ( diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index c7b51cb1..d3df8b44 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -242,7 +242,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {

{conversations && ( -
+

Chats

{conversations?.map((conversation) => (