diff --git a/web/app/_components/HistoryList/index.tsx b/web/app/_components/HistoryList/index.tsx index 3cbb482f6..880521597 100644 --- a/web/app/_components/HistoryList/index.tsx +++ b/web/app/_components/HistoryList/index.tsx @@ -15,32 +15,33 @@ const HistoryList: React.FC = () => { useEffect(() => { getUserConversations() + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) return ( -
+
-
    - {conversations.length > 0 ? ( - conversations + {conversations.length > 0 ? ( +
      + {conversations .filter( (e) => searchText.trim() === '' || e.name?.toLowerCase().includes(searchText.toLowerCase().trim()) ) - .map((convo) => ( + .map((convo, i) => ( - )) - ) : ( - - )} -
    + ))} +
+ ) : ( + + )}
) } diff --git a/web/app/_components/InputToolbar/index.tsx b/web/app/_components/InputToolbar/index.tsx index 4895d90cf..40cd140af 100644 --- a/web/app/_components/InputToolbar/index.tsx +++ b/web/app/_components/InputToolbar/index.tsx @@ -43,15 +43,7 @@ const InputToolbar: React.FC = () => { } if (!activeConvoId) { - return ( -
- } - /> -
- ) + return null } if ( (activeConvoId && inputState === 'model-mismatch') || @@ -94,13 +86,13 @@ const InputToolbar: React.FC = () => {
)} -
+ {/*
} /> -
+
*/} {/* My text input */}
diff --git a/web/app/_components/LeftHeaderAction/index.tsx b/web/app/_components/LeftHeaderAction/index.tsx index c506cb139..e8e978bc5 100644 --- a/web/app/_components/LeftHeaderAction/index.tsx +++ b/web/app/_components/LeftHeaderAction/index.tsx @@ -2,22 +2,37 @@ import React from 'react' import SecondaryButton from '../SecondaryButton' -import { useSetAtom } from 'jotai' +import { useSetAtom, useAtomValue } from 'jotai' import { MainViewState, setMainViewStateAtom, } from '@helpers/atoms/MainView.atom' import { MagnifyingGlassIcon, PlusIcon } from '@heroicons/react/24/outline' +import useCreateConversation from '@hooks/useCreateConversation' import { useGetDownloadedModels } from '@hooks/useGetDownloadedModels' +import { Button } from '@uikit' +import { activeAssistantModelAtom } from '@helpers/atoms/Model.atom' +import { showingModalNoActiveModel } from '@helpers/atoms/Modal.atom' const LeftHeaderAction: React.FC = () => { const setMainView = useSetAtom(setMainViewStateAtom) const { downloadedModels } = useGetDownloadedModels() + const activeModel = useAtomValue(activeAssistantModelAtom) + const { requestCreateConvo } = useCreateConversation() + const setShowModalNoActiveModel = useSetAtom(showingModalNoActiveModel) const onExploreClick = () => { setMainView(MainViewState.ExploreModel) } + const onNewConversationClick = () => { + if (activeModel) { + requestCreateConvo(activeModel) + } else { + setShowModalNoActiveModel(true) + } + } + const onCreateBotClicked = () => { if (downloadedModels.length === 0) { alert('You need to download at least one model to create a bot.') @@ -27,19 +42,28 @@ const LeftHeaderAction: React.FC = () => { } return ( -
- } - /> - } - /> +
+
+ } + /> + } + /> +
+
) } diff --git a/web/app/_components/SecondaryButton/index.tsx b/web/app/_components/SecondaryButton/index.tsx index 2491edeba..be1d85146 100644 --- a/web/app/_components/SecondaryButton/index.tsx +++ b/web/app/_components/SecondaryButton/index.tsx @@ -16,7 +16,13 @@ const SecondaryButton: React.FC = ({ className, icon, }) => ( - diff --git a/web/screens/Chat/index.tsx b/web/screens/Chat/index.tsx index fe3f0217c..5472ce067 100644 --- a/web/screens/Chat/index.tsx +++ b/web/screens/Chat/index.tsx @@ -10,10 +10,8 @@ const ChatScreen = () => { return (
-
- - -
+ +