diff --git a/src/renderer/src/pages/home/Chat.tsx b/src/renderer/src/pages/home/Chat.tsx index 1618d5e633..3c82f34eb9 100644 --- a/src/renderer/src/pages/home/Chat.tsx +++ b/src/renderer/src/pages/home/Chat.tsx @@ -13,6 +13,7 @@ import { Assistant, Topic } from '@renderer/types' import { classNames } from '@renderer/utils' import { Flex } from 'antd' import { debounce } from 'lodash' +import { AnimatePresence, motion } from 'motion/react' import React, { FC, useState } from 'react' import { useHotkeys } from 'react-hotkeys-hook' import styled from 'styled-components' @@ -43,7 +44,6 @@ const Chat: FC = (props) => { const contentSearchRef = React.useRef(null) const [filterIncludeUser, setFilterIncludeUser] = useState(false) - const maxWidth = useChatMaxWidth() const { setTimeoutTimer } = useTimer() useHotkeys('esc', () => { @@ -131,7 +131,7 @@ const Chat: FC = (props) => { vertical flex={1} justify="space-between" - style={{ maxWidth, height: mainHeight }}> + style={{ maxWidth: '100%', height: mainHeight }}> = (props) => { {isMultiSelectMode && } - {topicPosition === 'right' && showTopics && ( - - )} + + {topicPosition === 'right' && showTopics && ( + + + + )} + ) diff --git a/src/renderer/src/pages/home/ChatNavbar.tsx b/src/renderer/src/pages/home/ChatNavbar.tsx index 4ceb89cf5f..4b4f94909f 100644 --- a/src/renderer/src/pages/home/ChatNavbar.tsx +++ b/src/renderer/src/pages/home/ChatNavbar.tsx @@ -13,6 +13,7 @@ import { Assistant, Topic } from '@renderer/types' import { Tooltip } from 'antd' import { t } from 'i18next' import { Menu, PanelLeftClose, PanelRightClose, Search } from 'lucide-react' +import { AnimatePresence, motion } from 'motion/react' import { FC } from 'react' import styled from 'styled-components' @@ -80,11 +81,19 @@ const HeaderNavbar: FC = ({ activeAssistant, setActiveAssistant, activeTo )} - {!showAssistants && ( - - - - )} + + {!showAssistants && ( + + + + + + )} + diff --git a/src/renderer/src/pages/home/HomePage.tsx b/src/renderer/src/pages/home/HomePage.tsx index a32eff2bb1..0e3be2e7b7 100644 --- a/src/renderer/src/pages/home/HomePage.tsx +++ b/src/renderer/src/pages/home/HomePage.tsx @@ -7,6 +7,7 @@ import NavigationService from '@renderer/services/NavigationService' import { newMessagesActions } from '@renderer/store/newMessage' import { Assistant, Topic } from '@renderer/types' import { MIN_WINDOW_HEIGHT, MIN_WINDOW_WIDTH, SECOND_MIN_WINDOW_WIDTH } from '@shared/config/constant' +import { AnimatePresence, motion } from 'motion/react' import { FC, startTransition, useCallback, useEffect, useState } from 'react' import { useDispatch } from 'react-redux' import { useLocation, useNavigate } from 'react-router-dom' @@ -100,17 +101,26 @@ const HomePage: FC = () => { /> )} - {showAssistants && ( - - - - )} + + {showAssistants && ( + + + + + + )} + = ({ activeAssistant, setActiveAssistant, activeTo return ( - {showAssistants && ( - - - - - - - - EventEmitter.emit(EVENT_NAMES.ADD_NEW_TOPIC)} style={{ marginRight: 5 }}> - - - - - )} + + {showAssistants && ( + + + + + + + + + EventEmitter.emit(EVENT_NAMES.ADD_NEW_TOPIC)} style={{ marginRight: 5 }}> + + + + + + )} + {!showAssistants && ( @@ -93,11 +103,20 @@ const HeaderNavbar: FC = ({ activeAssistant, setActiveAssistant, activeTo )} - {!showAssistants && ( - - - - )} + + {!showAssistants && ( + + + + + + )} +