diff --git a/src/interface/web/app/agents/agents.module.css b/src/interface/web/app/agents/agents.module.css index 8433a88f..73cbd7a3 100644 --- a/src/interface/web/app/agents/agents.module.css +++ b/src/interface/web/app/agents/agents.module.css @@ -46,7 +46,7 @@ div.agentList { } -@media only screen and (max-width: 700px) { +@media only screen and (max-width: 768px) { div.agentList { width: 100%; padding: 0; @@ -54,4 +54,9 @@ div.agentList { margin-left: auto; grid-template-columns: 1fr; } + + div.sidePanel { + position: relative; + height: 100%; + } } diff --git a/src/interface/web/app/agents/page.tsx b/src/interface/web/app/agents/page.tsx index 5e68a0b9..8a9f955a 100644 --- a/src/interface/web/app/agents/page.tsx +++ b/src/interface/web/app/agents/page.tsx @@ -266,9 +266,6 @@ export default function Agents() { return (
-
- -
{ showLoginPrompt &&
-
+

Agents

diff --git a/src/interface/web/app/automations/automations.module.css b/src/interface/web/app/automations/automations.module.css index 99f094c3..f0c35244 100644 --- a/src/interface/web/app/automations/automations.module.css +++ b/src/interface/web/app/automations/automations.module.css @@ -28,4 +28,9 @@ div.sidePanel { div.pageLayout { max-width: 90vw; } + + div.sidePanel { + position: relative; + height: 100%; + } } diff --git a/src/interface/web/app/automations/page.tsx b/src/interface/web/app/automations/page.tsx index 9416cee7..c933f8fd 100644 --- a/src/interface/web/app/automations/page.tsx +++ b/src/interface/web/app/automations/page.tsx @@ -936,9 +936,6 @@ export default function Automations() { return (
-
- -
-

Automations

+

Automations

{ authenticatedData ? ( diff --git a/src/interface/web/app/chat/page.tsx b/src/interface/web/app/chat/page.tsx index 1768a228..702dc894 100644 --- a/src/interface/web/app/chat/page.tsx +++ b/src/interface/web/app/chat/page.tsx @@ -196,7 +196,7 @@ export default function Chat() { } // Track context used for chat response. References are rendered at the end of the chat - ({context, onlineContext} = processMessageChunk(event, currentMessage, context, onlineContext)); + ({ context, onlineContext } = processMessageChunk(event, currentMessage, context, onlineContext)); setMessages([...messages]); } @@ -231,16 +231,34 @@ export default function Chat() { {title} -
- -
+ { + !isMobileWidth && +
+ +
+ }
- + { + isMobileWidth && +
+ +
+ }
+ { + !isMobileWidth && +
+ {title &&

{title}

} +
+ } }> (props.title); - const [isMobileWidth, setIsMobileWidth] = useState(false); const [darkMode, setDarkMode] = useState(false); const [initialLoadDone, setInitialLoadDone] = useState(false); useEffect(() => { setIsMobileWidth(window.innerWidth < 768); - if (props.title) { - setDisplayTitle(props.title); - } else if (!props.title) { - setDisplayTitle(undefined); - } - - }, [props.title]); - - useEffect(() => { window.addEventListener('resize', () => { setIsMobileWidth(window.innerWidth < 768); @@ -94,15 +75,6 @@ export default function NavMenu(props: NavMenuProps) { return (
-
- {displayTitle &&

{displayTitle}

} - { - !displayTitle && props.showLogo && - - - - } -
{ isMobileWidth ? diff --git a/src/interface/web/app/components/sidePanel/chatHistorySidePanel.tsx b/src/interface/web/app/components/sidePanel/chatHistorySidePanel.tsx index b02ea754..00e5e26c 100644 --- a/src/interface/web/app/components/sidePanel/chatHistorySidePanel.tsx +++ b/src/interface/web/app/components/sidePanel/chatHistorySidePanel.tsx @@ -76,6 +76,7 @@ import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, import { modifyFileFilterForConversation } from "@/app/common/chatFunctions"; import { ScrollAreaScrollbar } from "@radix-ui/react-scroll-area"; import { KhojLogo, KhojLogoType } from "@/app/components/logo/khogLogo"; +import NavMenu from "../navMenu/navMenu"; // Define a fetcher function const fetcher = (url: string) => fetch(url).then((res) => res.json()); @@ -660,11 +661,8 @@ export default function SidePanel(props: SidePanelProps) { }, [chatSessions]); return ( -
+
- - {props.isMobileWidth && || } - { authenticatedData && props.isMobileWidth ? { @@ -672,7 +670,7 @@ export default function SidePanel(props: SidePanelProps) { setEnabled(open); } }> - + Sessions and Files @@ -698,15 +696,33 @@ export default function SidePanel(props: SidePanelProps) { : -
- - {enabled ? : } +
+ + - +
+ + {enabled ? : } + + +
+
+ +
} + { + props.isMobileWidth && + + + + } + { + props.isMobileWidth && + + }
{ authenticatedData && !props.isMobileWidth && enabled && diff --git a/src/interface/web/app/components/sidePanel/sidePanel.module.css b/src/interface/web/app/components/sidePanel/sidePanel.module.css index 77fddd13..e984eb6a 100644 --- a/src/interface/web/app/components/sidePanel/sidePanel.module.css +++ b/src/interface/web/app/components/sidePanel/sidePanel.module.css @@ -123,9 +123,9 @@ div.modalSessionsList div.session { @media screen and (max-width: 768px) { div.panel { - padding: 0.5rem; - position: fixed; - width: fit-content; + padding: 0.25rem; + /* position: fixed; */ + width: 100%; } div.expanded { diff --git a/src/interface/web/app/page.module.css b/src/interface/web/app/page.module.css index 32c89473..0f02c77a 100644 --- a/src/interface/web/app/page.module.css +++ b/src/interface/web/app/page.module.css @@ -78,7 +78,13 @@ div.chatBoxBody { display: grid; height: 100%; margin: auto; - grid-template-rows: auto 1fr; +} + +div.homeGreetings { + display: grid; + height: 100%; + margin: auto; + grid-template-rows: 1fr 2fr; } @@ -108,6 +114,10 @@ div.sidePanel { grid-template-rows: auto; } + div.sidePanel { + position: relative; + } + div.chatBox { padding: 0; } @@ -117,4 +127,8 @@ div.sidePanel { grid-template-columns: 1fr; } + div.homeGreetings { + grid-template-rows: auto; + } + } diff --git a/src/interface/web/app/page.tsx b/src/interface/web/app/page.tsx index c28eacda..82e4e192 100644 --- a/src/interface/web/app/page.tsx +++ b/src/interface/web/app/page.tsx @@ -6,7 +6,6 @@ import React, { useEffect, useState } from 'react'; import SuggestionCard from './components/suggestions/suggestionCard'; import SidePanel from './components/sidePanel/chatHistorySidePanel'; -import NavMenu from './components/navMenu/navMenu'; import Loading from './components/loading/loading'; import useSWR from 'swr'; import Image from 'next/image'; @@ -157,8 +156,8 @@ function ChatBodyData(props: ChatBodyDataProps) { } return ( -
-
+
+

{greeting}

@@ -218,7 +217,7 @@ function ChatBodyData(props: ChatBodyDataProps) {
@@ -310,7 +309,6 @@ export default function Home() { />
-
-
+
+
-
- -
- { - isMobileWidth &&
Search
- } -
- - setSearchQuery(e.currentTarget.value)} - onKeyDown={(e) => e.key === 'Enter' && search()} - type="search" - placeholder="Search Documents" /> - -
- { - focusSearchResult && -
- - {focusNote(focusSearchResult)} +
+
+
+
+ + setSearchQuery(e.currentTarget.value)} + onKeyDown={(e) => e.key === 'Enter' && search()} + type="search" + placeholder="Search Documents" /> +
- } - { - !focusSearchResult && searchResults && searchResults.length > 0 && -
- - { - searchResults.map((result, index) => { - return ( - - ); - }) - } - -
- } - { - searchResults == null && - - - - - - - Search across your documents - - - - {exampleQuery} - - - } - { - searchResults && searchResults.length === 0 && - - - - - - - No documents found - - - -
- To use search, upload your docs to your account. -
- -
- Learn More + { + focusSearchResult && +
+ + {focusNote(focusSearchResult)} +
+ } + { + !focusSearchResult && searchResults && searchResults.length > 0 && +
+ + { + searchResults.map((result, index) => { + return ( + + ); + }) + } + +
+ } + { + searchResults == null && + + + + + + + Search across your documents + + + + {exampleQuery} + + + } + { + searchResults && searchResults.length === 0 && + + + + + + + No documents found + + + +
+ To use search, upload your docs to your account.
- -
-
- } + +
+ Learn More +
+ + + + } +
diff --git a/src/interface/web/app/search/search.module.css b/src/interface/web/app/search/search.module.css index b063fde6..f4f24a46 100644 --- a/src/interface/web/app/search/search.module.css +++ b/src/interface/web/app/search/search.module.css @@ -1,12 +1,22 @@ div.searchLayout { display: grid; - grid-template-columns: auto 1fr; + grid-template-columns: 1fr; gap: 1rem; height: 100vh; } +div.sidePanel { + position: fixed; + height: 100%; +} + @media screen and (max-width: 768px) { div.searchLayout { gap: 0; } + + div.sidePanel { + position: relative; + height: 100%; + } }