mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
♻️ refactor: rename chat folder to agent (#11409)
* clean state * rename folder structure * improve * update
This commit is contained in:
@@ -6,7 +6,7 @@ import CronTopicList from './Topic/CronTopicList';
|
||||
|
||||
export enum ChatSidebarKey {
|
||||
CronTopics = 'cronTopics',
|
||||
Topic = 'topic'
|
||||
Topic = 'topic',
|
||||
}
|
||||
|
||||
const Body = memo(() => {
|
||||
@@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui';
|
||||
import { type FC } from 'react';
|
||||
import { Outlet } from 'react-router-dom';
|
||||
|
||||
import AgentIdSync from '@/app/[variants]/(main)/chat/_layout/AgentIdSync';
|
||||
import AgentIdSync from '@/app/[variants]/(main)/agent/_layout/AgentIdSync';
|
||||
import { isDesktop } from '@/const/version';
|
||||
import ProtocolUrlHandler from '@/features/ProtocolUrlHandler';
|
||||
import { useInitAgentConfig } from '@/hooks/useInitAgentConfig';
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { Block, Flexbox } from '@lobehub/ui';
|
||||
import { createStaticStyles , responsive } from 'antd-style';
|
||||
import { createStaticStyles, responsive } from 'antd-style';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -8,13 +8,12 @@ import PluginTag from '@/features/PluginTag';
|
||||
import { useAgentEnableSearch } from '@/hooks/useAgentEnableSearch';
|
||||
import { useModelSupportToolUse } from '@/hooks/useModelSupportToolUse';
|
||||
import { useAgentStore } from '@/store/agent';
|
||||
import { agentChatConfigSelectors, agentSelectors } from '@/store/agent/selectors';
|
||||
import { agentSelectors } from '@/store/agent/selectors';
|
||||
import { useSessionStore } from '@/store/session';
|
||||
import { sessionSelectors } from '@/store/session/selectors';
|
||||
import { useUserStore } from '@/store/user';
|
||||
import { authSelectors } from '@/store/user/selectors';
|
||||
|
||||
import HistoryLimitTags from './HistoryLimitTags';
|
||||
import KnowledgeTag from './KnowledgeTag';
|
||||
import MemberCountTag from './MemberCountTag';
|
||||
import SearchTags from './SearchTags';
|
||||
@@ -29,7 +28,6 @@ const TitleTags = memo(() => {
|
||||
|
||||
const plugins = useAgentStore(agentSelectors.displayableAgentPlugins, isEqual);
|
||||
const enabledKnowledge = useAgentStore(agentSelectors.currentEnabledKnowledge, isEqual);
|
||||
const enableHistoryCount = useAgentStore(agentChatConfigSelectors.enableHistoryCount);
|
||||
|
||||
const showPlugin = useModelSupportToolUse(model, provider);
|
||||
const isLogin = useUserStore(authSelectors.isLogin);
|
||||
@@ -55,7 +53,6 @@ const TitleTags = memo(() => {
|
||||
{isAgentEnableSearch && <SearchTags />}
|
||||
{showPlugin && plugins?.length > 0 && <PluginTag plugins={plugins} />}
|
||||
{hasKnowledge && <KnowledgeTag data={enabledKnowledge} />}
|
||||
{enableHistoryCount && <HistoryLimitTags />}
|
||||
</Flexbox>
|
||||
);
|
||||
});
|
||||
@@ -3,9 +3,7 @@ import { PortalContent } from '@/features/Portal/router';
|
||||
import Body from '../features/Body';
|
||||
|
||||
const Layout = () => {
|
||||
return (
|
||||
<PortalContent renderBody={(body) => <Body>{body}</Body>} />
|
||||
);
|
||||
return <PortalContent renderBody={(body) => <Body>{body}</Body>} />;
|
||||
};
|
||||
|
||||
export default Layout;
|
||||
@@ -1,9 +1,10 @@
|
||||
import { Suspense, memo } from 'react';
|
||||
|
||||
import DesktopLayout from '@/app/[variants]/(main)/chat/features/Portal/_layout/Desktop';
|
||||
import MobileLayout from '@/app/[variants]/(main)/chat/features/Portal/_layout/Mobile';
|
||||
import Loading from '@/components/Loading/BrandTextLoading';
|
||||
|
||||
import DesktopLayout from '../_layout/Desktop';
|
||||
import MobileLayout from '../_layout/Mobile';
|
||||
|
||||
interface PortalPanelProps {
|
||||
mobile?: boolean;
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
import { Suspense } from 'react';
|
||||
|
||||
import Portal from '@/app/[variants]/(main)/chat/features/Portal/features/Portal';
|
||||
import PortalPanel from '@/app/[variants]/(main)/chat/features/Portal/features/PortalPanel';
|
||||
import Loading from '@/components/Loading/BrandTextLoading';
|
||||
|
||||
import Portal from './features/Portal';
|
||||
import PortalPanel from './features/PortalPanel';
|
||||
|
||||
const ChatPortal = () => {
|
||||
return (
|
||||
<Portal>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user