diff --git a/web/src/app/assistants/SidebarWrapper.tsx b/web/src/app/assistants/SidebarWrapper.tsx index 77838097f..b850d55ce 100644 --- a/web/src/app/assistants/SidebarWrapper.tsx +++ b/web/src/app/assistants/SidebarWrapper.tsx @@ -20,26 +20,22 @@ import { useRouter } from "next/navigation"; import { pageType } from "../chat/sessionSidebar/types"; import FixedLogo from "../chat/shared_chat_search/FixedLogo"; import { SettingsContext } from "@/components/settings/SettingsProvider"; +import { useChatContext } from "@/components/context/ChatContext"; interface SidebarWrapperProps { - chatSessions?: ChatSession[]; - folders?: Folder[]; initiallyToggled: boolean; - openedFolders?: { [key: number]: boolean }; page: pageType; size?: "sm" | "lg"; children: ReactNode; } export default function SidebarWrapper({ - chatSessions, initiallyToggled, - folders, - openedFolders, page, size = "sm", children, }: SidebarWrapperProps) { + const { chatSessions, folders, openedFolders } = useChatContext(); const [toggledSidebar, setToggledSidebar] = useState(initiallyToggled); const [showDocSidebar, setShowDocSidebar] = useState(false); // State to track if sidebar is open // Used to maintain a "time out" for history sidebar so our existing refs can have time to process change diff --git a/web/src/app/assistants/gallery/WrappedAssistantsGallery.tsx b/web/src/app/assistants/gallery/WrappedAssistantsGallery.tsx index afb5f6a7a..4169d85d8 100644 --- a/web/src/app/assistants/gallery/WrappedAssistantsGallery.tsx +++ b/web/src/app/assistants/gallery/WrappedAssistantsGallery.tsx @@ -1,31 +1,15 @@ "use client"; import SidebarWrapper from "../SidebarWrapper"; -import { ChatSession } from "@/app/chat/interfaces"; -import { Folder } from "@/app/chat/folders/interfaces"; -import { Persona } from "@/app/admin/assistants/interfaces"; -import { User } from "@/lib/types"; import { AssistantsGallery } from "./AssistantsGallery"; export default function WrappedAssistantsGallery({ - chatSessions, - initiallyToggled, - folders, - openedFolders, + toggleSidebar, }: { - chatSessions: ChatSession[]; - folders: Folder[]; - initiallyToggled: boolean; - openedFolders?: { [key: number]: boolean }; + toggleSidebar: boolean; }) { return ( - + ); diff --git a/web/src/app/assistants/gallery/page.tsx b/web/src/app/assistants/gallery/page.tsx index ccb59b95d..691d5757a 100644 --- a/web/src/app/assistants/gallery/page.tsx +++ b/web/src/app/assistants/gallery/page.tsx @@ -5,6 +5,7 @@ import { unstable_noStore as noStore } from "next/cache"; import { redirect } from "next/navigation"; import WrappedAssistantsGallery from "./WrappedAssistantsGallery"; import { cookies } from "next/headers"; +import { ChatProvider } from "@/components/context/ChatContext"; export default async function GalleryPage(props: { searchParams: Promise<{ [key: string]: string }>; @@ -26,22 +27,38 @@ export default async function GalleryPage(props: { openedFolders, toggleSidebar, shouldShowWelcomeModal, + availableSources, + ccPairs, + documentSets, + tags, + llmProviders, + defaultAssistantId, } = data; return ( - <> + {shouldShowWelcomeModal && ( )} - - + + ); } diff --git a/web/src/app/assistants/mine/WrappedAssistantsMine.tsx b/web/src/app/assistants/mine/WrappedAssistantsMine.tsx index 3e54662b8..d5b581e40 100644 --- a/web/src/app/assistants/mine/WrappedAssistantsMine.tsx +++ b/web/src/app/assistants/mine/WrappedAssistantsMine.tsx @@ -1,28 +1,14 @@ "use client"; import { AssistantsList } from "./AssistantsList"; import SidebarWrapper from "../SidebarWrapper"; -import { ChatSession } from "@/app/chat/interfaces"; -import { Folder } from "@/app/chat/folders/interfaces"; export default function WrappedAssistantsMine({ - chatSessions, initiallyToggled, - folders, - openedFolders, }: { - chatSessions: ChatSession[]; - folders: Folder[]; initiallyToggled: boolean; - openedFolders?: { [key: number]: boolean }; }) { return ( - + ); diff --git a/web/src/app/assistants/mine/page.tsx b/web/src/app/assistants/mine/page.tsx index 7058e7d3d..d6e66c5f1 100644 --- a/web/src/app/assistants/mine/page.tsx +++ b/web/src/app/assistants/mine/page.tsx @@ -6,6 +6,7 @@ import { redirect } from "next/navigation"; import WrappedAssistantsMine from "./WrappedAssistantsMine"; import { WelcomeModal } from "@/components/initialSetup/welcome/WelcomeModalWrapper"; import { cookies } from "next/headers"; +import { ChatProvider } from "@/components/context/ChatContext"; export default async function GalleryPage(props: { searchParams: Promise<{ [key: string]: string }>; @@ -27,21 +28,37 @@ export default async function GalleryPage(props: { openedFolders, toggleSidebar, shouldShowWelcomeModal, + availableSources, + ccPairs, + documentSets, + tags, + llmProviders, + defaultAssistantId, } = data; return ( - <> + {shouldShowWelcomeModal && ( )} - - + + ); }