From 4bc1a87fcf24f47f77257d2d2f5671636dee93b0 Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Sat, 25 Feb 2023 08:43:00 +0530 Subject: [PATCH 1/4] preserves whitespaces and newlines in message --- frontend/src/conversation/Conversation.tsx | 2 +- frontend/src/conversation/ConversationBubble.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index ab9d9eb..f07749b 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -48,7 +48,7 @@ export default function Conversation() {
{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 1283c79..661a3fc 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -33,7 +33,7 @@ const ConversationBubble = forwardRef< {type === 'ERROR' && ( alert )} - {message} +

{message}

); From f90abd8753ef93df566a7dafd491bd68dc1a97ec Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Sat, 25 Feb 2023 09:52:15 +0530 Subject: [PATCH 2/4] fixes the middleware setup --- frontend/src/store.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/store.ts b/frontend/src/store.ts index 23097d7..e5da25c 100644 --- a/frontend/src/store.ts +++ b/frontend/src/store.ts @@ -20,12 +20,12 @@ const store = configureStore({ preference: prefSlice.reducer, conversation: conversationSlice.reducer, }, - middleware: (getDefaultMiddleware) => [ - ...getDefaultMiddleware(), - prefListenerMiddleware.middleware, - ], + middleware: (getDefaultMiddleware) => + getDefaultMiddleware().concat(prefListenerMiddleware.middleware), }); export type RootState = ReturnType; export type AppDispatch = typeof store.dispatch; export default store; + +// TODO : use https://redux-toolkit.js.org/tutorials/typescript#define-typed-hooks everywere instead of direct useDispatch From 63af495693a550698c1f542b193d8cc16e4c00b2 Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Sat, 25 Feb 2023 11:11:15 +0530 Subject: [PATCH 3/4] incorporates 13 from Nicks list --- frontend/src/conversation/Conversation.tsx | 2 +- frontend/src/conversation/ConversationBubble.tsx | 12 ++++++++---- frontend/src/store.ts | 2 ++ frontend/tailwind.config.cjs | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index f07749b..99bd2db 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -30,7 +30,7 @@ export default function Conversation() { return (
-
+
{messages.map((message, index) => { return (
Date: Sat, 25 Feb 2023 11:51:17 +0530 Subject: [PATCH 4/4] on mobile view the app used to launch with nav bar open, this fixes it. About page had same large horizontal margin which made about page very narrow. This fixes it. --- frontend/src/About.tsx | 2 +- frontend/src/App.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 0f2b5db..814943d 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -4,7 +4,7 @@ export default function About() { return ( //Parent div for all content shown through App.tsx routing needs to have this styling. Might change when state management is updated. -
+

About DocsGPT 🦖

diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index b0c6cb2..2cbe582 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -6,7 +6,10 @@ import { useState } from 'react'; import { ActiveState } from './models/misc'; export default function App() { - const [navState, setNavState] = useState('ACTIVE'); + //TODO : below media query is disjoint from tailwind. Please wire it together. + const [navState, setNavState] = useState( + window.matchMedia('((min-width: 768px)').matches ? 'ACTIVE' : 'INACTIVE', + ); return (