diff --git a/client/src/components/Chat/Header.tsx b/client/src/components/Chat/Header.tsx index 227a9d20ca..0f19db956d 100644 --- a/client/src/components/Chat/Header.tsx +++ b/client/src/components/Chat/Header.tsx @@ -6,8 +6,8 @@ import HeaderOptions from './Input/HeaderOptions'; export default function Header() { const { navVisible } = useOutletContext(); return ( -
-
+
+
{!navVisible && } diff --git a/client/src/components/Chat/Input/OptionsPopover.tsx b/client/src/components/Chat/Input/OptionsPopover.tsx index 4d1e47ab61..c20c5fa325 100644 --- a/client/src/components/Chat/Input/OptionsPopover.tsx +++ b/client/src/components/Chat/Input/OptionsPopover.tsx @@ -28,15 +28,22 @@ export default function OptionsPopover({ popoverRef, () => closePopover(), ['dialog-template-content', 'shadcn-button', 'advanced-settings'], - (target) => { - const tagName = (target as Element)?.tagName; + (_target) => { + const target = _target as Element; + if ( + target?.id === 'presets-button' || + (target?.parentNode instanceof Element && target.parentNode.id === 'presets-button') + ) { + return false; + } + const tagName = target?.tagName; return tagName === 'path' || tagName === 'svg' || tagName === 'circle'; }, ); const localize = useLocalize(); const cardStyle = - 'shadow-xl rounded-md min-w-[75px] font-normal bg-white border-black/10 border dark:bg-gray-700 text-black dark:text-white'; + 'shadow-xl rounded-md min-w-[75px] font-normal bg-white border-black/10 border dark:bg-gray-700 text-black dark:text-white '; if (!visible) { return null; @@ -45,7 +52,7 @@ export default function OptionsPopover({ return ( -
+
); } diff --git a/client/src/components/Chat/Menus/NewChat.tsx b/client/src/components/Chat/Menus/NewChat.tsx index 82bd2c8db9..28af271c64 100644 --- a/client/src/components/Chat/Menus/NewChat.tsx +++ b/client/src/components/Chat/Menus/NewChat.tsx @@ -1,11 +1,16 @@ import { useChatContext } from '~/Providers'; +import { useMediaQuery } from '~/hooks'; export default function Header() { const { newConversation } = useChatContext(); + const isSmallScreen = useMediaQuery('(max-width: 768px)'); + if (isSmallScreen) { + return null; + } return (
+ {presets && presets.length === 0 && ( +
+
+ {/* TODO: Create Preset from here */} + {localize('com_endpoint_no_presets')} +
+
+ )} {presets && + presets.length > 0 && presets.map((preset, i) => { if (!preset) { return null; @@ -70,8 +83,7 @@ const PresetItems: FC<{
onSelectPreset(preset)} @@ -83,7 +95,7 @@ const PresetItems: FC<{ >
+
{ > - {presets.length ? ( - - ) : ( -
{localize('com_endpoint_no_presets')}
- )} +
- + ); }; diff --git a/client/src/components/Chat/Menus/UI/MenuItem.tsx b/client/src/components/Chat/Menus/UI/MenuItem.tsx index 4e4d103c17..30806573e9 100644 --- a/client/src/components/Chat/Menus/UI/MenuItem.tsx +++ b/client/src/components/Chat/Menus/UI/MenuItem.tsx @@ -81,7 +81,7 @@ const MenuItem: FC = ({ viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" - className="icon-md block hidden gap-x-1 group-hover:flex " + className="icon-md invisible block gap-x-1 group-hover:visible group-hover:flex" > void; + toggleNav: () => void; }) { const location = useLocation(); const { pathname } = location; @@ -24,6 +26,7 @@ export default function Conversations({ key={convo.conversationId} conversation={convo} retainView={moveToTop} + toggleNav={toggleNav} i={i} /> ); diff --git a/client/src/components/Conversations/Convo.tsx b/client/src/components/Conversations/Convo.tsx index 5493c040fa..86c9aebe2a 100644 --- a/client/src/components/Conversations/Convo.tsx +++ b/client/src/components/Conversations/Convo.tsx @@ -13,7 +13,7 @@ import store from '~/store'; type KeyEvent = KeyboardEvent; -export default function Conversation({ conversation, retainView, i }) { +export default function Conversation({ conversation, retainView, toggleNav, i }) { const { conversationId: currentConvoId } = useParams(); const activeConvos = useRecoilValue(store.allConversationsSelector); const updateConvoMutation = useUpdateConversationMutation(currentConvoId ?? ''); @@ -31,6 +31,8 @@ export default function Conversation({ conversation, retainView, i }) { return; } + toggleNav(); + // set document title document.title = title; diff --git a/client/src/components/Endpoints/EndpointSettings.tsx b/client/src/components/Endpoints/EndpointSettings.tsx index a5405542bf..29b3e3dc30 100644 --- a/client/src/components/Endpoints/EndpointSettings.tsx +++ b/client/src/components/Endpoints/EndpointSettings.tsx @@ -23,7 +23,9 @@ export default function Settings({ if (OptionComponent) { return ( -
+
+
); diff --git a/client/src/components/Input/ModelSelect/PluginsByIndex.tsx b/client/src/components/Input/ModelSelect/PluginsByIndex.tsx index 9a68242332..3cf2eb59cf 100644 --- a/client/src/components/Input/ModelSelect/PluginsByIndex.tsx +++ b/client/src/components/Input/ModelSelect/PluginsByIndex.tsx @@ -102,24 +102,26 @@ export default function PluginsByIndex({ )} /> - - + {visible && ( + <> + + + + )} ); } diff --git a/client/src/components/Nav/Nav.tsx b/client/src/components/Nav/Nav.tsx index f50058bddd..fe024d7409 100644 --- a/client/src/components/Nav/Nav.tsx +++ b/client/src/components/Nav/Nav.tsx @@ -144,6 +144,12 @@ export default function Nav({ navVisible, setNavVisible }) { setNavVisible((prev: boolean) => !prev); }; + const itemToggleNav = () => { + if (isSmallScreen) { + toggleNavVisible(); + } + }; + const containerClasses = getConversationsQuery.isLoading && pageNumber === 1 ? 'flex flex-col gap-2 text-gray-100 text-sm h-full justify-center items-center' @@ -167,12 +173,12 @@ export default function Nav({ navVisible, setNavVisible }) {