diff --git a/frontend/components/search/search-bar.tsx b/frontend/components/search/search-bar.tsx index b3362fc0..b4572c76 100644 --- a/frontend/components/search/search-bar.tsx +++ b/frontend/components/search/search-bar.tsx @@ -203,7 +203,7 @@ const SearchBar: React.FC = ({ loading: () => <>, }); - const { isSearch, isShadcnUI, setIsSearch, setIsShadcnUI } = useUIStore(); + const { isSearch, isShadcnUI, showMindMap, setIsSearch, setIsShadcnUI, setShowMindMap } = useUIStore(); return (
@@ -325,7 +325,7 @@ const SearchBar: React.FC = ({
-
+
{showShadcnUI && (
setIsShadcnUI(checked)} /> @@ -334,6 +334,12 @@ const SearchBar: React.FC = ({ )} {showModelSelection && } {showSourceSelection && } + {showModelSelection && ( +
+ setShowMindMap(checked)} /> + +
+ )} {showWebSearch && (
setIsSearch(checked)} /> diff --git a/frontend/components/search/search-message.tsx b/frontend/components/search/search-message.tsx index 91989105..79d3d816 100644 --- a/frontend/components/search/search-message.tsx +++ b/frontend/components/search/search-message.tsx @@ -13,6 +13,7 @@ import ExpandableSection from '@/components/search/expandable-section'; import MindMap from '@/components/search/mindmap'; import { useTranslations } from 'next-intl'; import UISection from '@/components/code/ui-section'; +import { useUIStore } from '@/lib/store'; const SearchMessage = memo( (props: { @@ -48,6 +49,7 @@ const SearchMessage = memo( }, [message.attachments, isUser, content]); const t = useTranslations('SearchMessage'); + const { showMindMap } = useUIStore(); return (
@@ -62,11 +64,6 @@ const SearchMessage = memo( {(images.length > 0 || !isLoading) && !isUser && !isReadOnly && ( )} - {!isUser && content && !isLoading && type != SearchCategory.UI && ( - - - - )} {sources.length > 0 && (
@@ -113,6 +110,12 @@ const SearchMessage = memo(
)} + {showMindMap && !isUser && content && !isLoading && type != SearchCategory.UI && ( + + + + )} + {isUser && } {isUser && attachments && attachments.length > 0 && (
diff --git a/frontend/lib/store.ts b/frontend/lib/store.ts index a4214a63..beb1cb17 100644 --- a/frontend/lib/store.ts +++ b/frontend/lib/store.ts @@ -23,8 +23,10 @@ export const useProfileStore = create()( type UIState = { isSearch: boolean; isShadcnUI: boolean; + showMindMap: boolean; setIsSearch: (isSearch: boolean) => void; setIsShadcnUI: (isShadcnUI: boolean) => void; + setShowMindMap: (showMindMap: boolean) => void; }; export const useUIStore = create()( @@ -32,8 +34,10 @@ export const useUIStore = create()( (set) => ({ isSearch: true, isShadcnUI: true, + showMindMap: false, setIsSearch: (search: boolean) => set({ isSearch: search }), setIsShadcnUI: (shadcnUI: boolean) => set({ isShadcnUI: shadcnUI }), + setShowMindMap: (showMindMap: boolean) => set({ showMindMap }), }), { name: 'UI-config',