@lobehub/chat 0.82.8 → 0.82.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.json +1 -1
  3. package/src/app/chat/{features/Header → (desktop)/features/ChatHeader}/Desktop.tsx +2 -2
  4. package/src/app/chat/{features/Header → (desktop)/features/ChatHeader}/index.tsx +1 -1
  5. package/src/app/chat/(desktop)/features/ChatInput/index.tsx +22 -0
  6. package/src/app/chat/{features/SessionList/Header → (desktop)/features/SessionHeader}/Desktop.tsx +1 -1
  7. package/src/app/chat/{features/SessionList/Header → (desktop)/features/SessionHeader}/index.tsx +1 -1
  8. package/src/app/chat/{features → (desktop)/features}/SessionList/Desktop.tsx +1 -1
  9. package/src/app/chat/(desktop)/features/SessionList/index.tsx +20 -0
  10. package/src/app/chat/{features/Sidebar → (desktop)/features/SideBar}/Desktop.tsx +4 -4
  11. package/src/app/chat/(desktop)/features/SideBar/index.tsx +20 -0
  12. package/src/app/chat/(desktop)/index.tsx +24 -0
  13. package/src/app/chat/{layout.desktop.tsx → (desktop)/layout/Desktop.tsx} +4 -4
  14. package/src/app/chat/(desktop)/layout/index.tsx +25 -0
  15. package/src/app/chat/(mobile)/features/ChatHeader.tsx +1 -0
  16. package/src/app/chat/(mobile)/features/ChatInput.tsx +14 -0
  17. package/src/app/chat/(mobile)/features/SessionList.tsx +12 -0
  18. package/src/app/chat/(mobile)/features/Topics.tsx +12 -0
  19. package/src/app/chat/(mobile)/index.tsx +20 -0
  20. package/src/app/chat/(mobile)/layout.tsx +15 -0
  21. package/src/app/chat/(mobile)/mobile/page.tsx +21 -0
  22. package/src/app/chat/{features/Header → components/ChatHeader}/Mobile.tsx +2 -1
  23. package/src/app/chat/{features/Header → components/ChatHeader}/ShareButton/Preview.tsx +3 -3
  24. package/src/app/chat/{features/Conversation/Input → components/ChatInput}/index.tsx +23 -21
  25. package/src/app/chat/components/Inspector/index.tsx +17 -0
  26. package/src/app/chat/{features → components}/SessionList/Mobile.tsx +1 -1
  27. package/src/app/chat/{features → components}/SessionList/index.tsx +3 -10
  28. package/src/app/chat/features/Conversation/index.tsx +8 -4
  29. package/src/app/chat/features/PageTitle.tsx +19 -0
  30. package/src/app/chat/layout.tsx +14 -0
  31. package/src/app/chat/page.tsx +9 -4
  32. package/src/app/chat/settings/(desktop)/Header/index.tsx +13 -0
  33. package/src/app/chat/settings/{layout.desktop.tsx → (desktop)/layout.desktop.tsx} +5 -4
  34. package/src/app/chat/settings/(mobile)/Header.tsx +12 -0
  35. package/src/app/chat/settings/{layout.mobile.tsx → (mobile)/layout.mobile.tsx} +3 -1
  36. package/src/app/chat/settings/{features → components}/Header/index.tsx +4 -13
  37. package/src/app/chat/settings/layout.tsx +14 -0
  38. package/src/app/chat/settings/page.tsx +36 -5
  39. package/src/app/metadata.ts +4 -1
  40. package/src/app/welcome/page.tsx +2 -6
  41. package/src/components/PageTitle.tsx +11 -0
  42. package/src/layout/AppMobileLayout.tsx +15 -24
  43. package/src/utils/responsive.ts +1 -0
  44. package/src/app/chat/features/Sidebar/index.tsx +0 -29
  45. package/src/app/chat/index.tsx +0 -54
  46. package/src/app/chat/layout.mobile.tsx +0 -20
  47. package/src/app/chat/mobile/index.tsx +0 -38
  48. package/src/app/chat/mobile/page.tsx +0 -7
  49. package/src/app/chat/settings/index.tsx +0 -51
  50. /package/src/app/chat/{features/Conversation/Input → (desktop)/features/ChatInput}/Desktop.tsx +0 -0
  51. /package/src/app/chat/{features/SessionList/Header/Mobile.tsx → (mobile)/features/SessionHeader.tsx} +0 -0
  52. /package/src/app/chat/{features/Header → components/ChatHeader}/PluginTag/PluginStatus.tsx +0 -0
  53. /package/src/app/chat/{features/Header → components/ChatHeader}/PluginTag/index.tsx +0 -0
  54. /package/src/app/chat/{features/Header → components/ChatHeader}/ShareButton/Inner.tsx +0 -0
  55. /package/src/app/chat/{features/Header → components/ChatHeader}/ShareButton/index.tsx +0 -0
  56. /package/src/app/chat/{features/Header → components/ChatHeader}/ShareButton/style.ts +0 -0
  57. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/ActionBar/ActionLeft.tsx +0 -0
  58. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/ActionBar/ActionRight.tsx +0 -0
  59. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/ActionBar/Token.tsx +0 -0
  60. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/Footer/SaveTopic.tsx +0 -0
  61. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/Footer/index.tsx +0 -0
  62. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/Mobile.tsx +0 -0
  63. /package/src/app/chat/{features/Sidebar → components/Inspector}/Mobile.tsx +0 -0
  64. /package/src/app/chat/{features/Sidebar → components/Inspector}/SystemRole/Header.tsx +0 -0
  65. /package/src/app/chat/{features/Sidebar → components/Inspector}/SystemRole/index.tsx +0 -0
  66. /package/src/app/chat/{features/Sidebar → components/Inspector}/SystemRole/style.ts +0 -0
  67. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/DefaultContent.tsx +0 -0
  68. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/SkeletonList.tsx +0 -0
  69. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/TopicContent.tsx +0 -0
  70. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/TopicItem.tsx +0 -0
  71. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/index.tsx +0 -0
  72. /package/src/app/chat/{features/Sidebar → components/Inspector}/TopicSearchBar/index.tsx +0 -0
  73. /package/src/app/chat/{features → components}/SessionList/CollapseGroup/index.tsx +0 -0
  74. /package/src/app/chat/{features → components}/SessionList/Inbox/index.tsx +0 -0
  75. /package/src/app/chat/{features → components}/SessionList/List/AddButton.tsx +0 -0
  76. /package/src/app/chat/{features → components}/SessionList/List/Item/Actions.tsx +0 -0
  77. /package/src/app/chat/{features → components}/SessionList/List/Item/index.tsx +0 -0
  78. /package/src/app/chat/{features → components}/SessionList/List/SkeletonList.tsx +0 -0
  79. /package/src/app/chat/{features → components}/SessionList/List/index.tsx +0 -0
  80. /package/src/app/chat/settings/{features → (desktop)}/Header/Desktop.tsx +0 -0
  81. /package/src/app/chat/settings/{features → components}/Header/Mobile.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.82.9](https://github.com/lobehub/lobe-chat/compare/v0.82.8...v0.82.9)
6
+
7
+ <sup>Released on **2023-10-05**</sup>
8
+
9
+ <br/>
10
+
11
+ <details>
12
+ <summary><kbd>Improvements and Fixes</kbd></summary>
13
+
14
+ </details>
15
+
16
+ <div align="right">
17
+
18
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
19
+
20
+ </div>
21
+
5
22
  ### [Version 0.82.8](https://github.com/lobehub/lobe-chat/compare/v0.82.7...v0.82.8)
6
23
 
7
24
  <sup>Released on **2023-09-30**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.82.8",
3
+ "version": "0.82.9",
4
4
  "description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -12,8 +12,8 @@ import { useSessionChatInit, useSessionStore } from '@/store/session';
12
12
  import { agentSelectors, sessionSelectors } from '@/store/session/selectors';
13
13
  import { pathString } from '@/utils/url';
14
14
 
15
- import PluginTag from './PluginTag';
16
- import ShareButton from './ShareButton';
15
+ import PluginTag from '../../../components/ChatHeader/PluginTag';
16
+ import ShareButton from '../../../components/ChatHeader/ShareButton';
17
17
 
18
18
  const Header = memo(() => {
19
19
  const init = useSessionChatInit();
@@ -1,8 +1,8 @@
1
1
  import { useResponsive } from 'antd-style';
2
2
  import { memo } from 'react';
3
3
 
4
+ import Mobile from '../../../components/ChatHeader/Mobile';
4
5
  import Desktop from './Desktop';
5
- import Mobile from './Mobile';
6
6
 
7
7
  const Header = memo(() => {
8
8
  const { mobile } = useResponsive();
@@ -0,0 +1,22 @@
1
+ import { useResponsive } from 'antd-style';
2
+ import { memo, useState } from 'react';
3
+
4
+ import { ChatInputContent } from '../../../components/ChatInput';
5
+ import Mobile from '../../../components/ChatInput/Mobile';
6
+ import Desktop from './Desktop';
7
+
8
+ const ChatInput = () => {
9
+ const [expand, setExpand] = useState<boolean>(false);
10
+
11
+ const { mobile } = useResponsive();
12
+
13
+ const Render = mobile ? Mobile : Desktop;
14
+
15
+ return (
16
+ <Render expand={expand}>
17
+ <ChatInputContent expand={expand} onExpandChange={setExpand} />
18
+ </Render>
19
+ );
20
+ };
21
+
22
+ export default memo(ChatInput);
@@ -7,7 +7,7 @@ import { Flexbox } from 'react-layout-kit';
7
7
 
8
8
  import { useSessionStore } from '@/store/session';
9
9
 
10
- import SessionSearchBar from '../../SessionSearchBar';
10
+ import SessionSearchBar from '../../../features/SessionSearchBar';
11
11
 
12
12
  export const useStyles = createStyles(({ css, token }) => ({
13
13
  logo: css`
@@ -1,8 +1,8 @@
1
1
  import { useResponsive } from 'antd-style';
2
2
  import { memo } from 'react';
3
3
 
4
+ import Mobile from '../../../(mobile)/features/SessionHeader';
4
5
  import Desktop from './Desktop';
5
- import Mobile from './Mobile';
6
6
 
7
7
  const Header = memo(() => {
8
8
  const { mobile } = useResponsive();
@@ -4,7 +4,7 @@ import { ReactNode, memo } from 'react';
4
4
 
5
5
  import FolderPanel from '@/features/FolderPanel';
6
6
 
7
- import Header from './Header';
7
+ import Header from '../SessionHeader';
8
8
 
9
9
  const useStyles = createStyles(({ stylish }) => stylish.noScrollbar);
10
10
 
@@ -0,0 +1,20 @@
1
+ import { useResponsive } from 'antd-style';
2
+ import { memo } from 'react';
3
+
4
+ import { SessionListContent } from '../../../components/SessionList';
5
+ import Mobile from '../../../components/SessionList/Mobile';
6
+ import Desktop from './Desktop';
7
+
8
+ const ResponsiveSessionList = memo(() => {
9
+ const { mobile } = useResponsive();
10
+
11
+ const Wrapper = mobile ? Mobile : Desktop;
12
+
13
+ return (
14
+ <Wrapper>
15
+ <SessionListContent />
16
+ </Wrapper>
17
+ );
18
+ });
19
+
20
+ export default ResponsiveSessionList;
@@ -6,9 +6,9 @@ import SafeSpacing from '@/components/SafeSpacing';
6
6
  import { CHAT_SIDEBAR_WIDTH } from '@/const/layoutTokens';
7
7
  import { useGlobalStore } from '@/store/global';
8
8
  import { useSessionStore } from '@/store/session';
9
- import { sessionSelectors } from '@/store/session/slices/session/selectors';
9
+ import { sessionSelectors } from '@/store/session/selectors';
10
10
 
11
- import SystemRole from './SystemRole';
11
+ import SystemRole from '../../../components/Inspector/SystemRole';
12
12
 
13
13
  const useStyles = createStyles(({ css, token }) => ({
14
14
  content: css`
@@ -23,7 +23,7 @@ const useStyles = createStyles(({ css, token }) => ({
23
23
  `,
24
24
  }));
25
25
 
26
- const SideBar = memo<{ children: ReactNode }>(({ children }) => {
26
+ const Desktop = memo<{ children: ReactNode }>(({ children }) => {
27
27
  const { styles } = useStyles();
28
28
  const [showAgentSettings, toggleConfig] = useGlobalStore((s) => [
29
29
  s.preference.showChatSideBar,
@@ -55,4 +55,4 @@ const SideBar = memo<{ children: ReactNode }>(({ children }) => {
55
55
  );
56
56
  });
57
57
 
58
- export default SideBar;
58
+ export default Desktop;
@@ -0,0 +1,20 @@
1
+ import { useResponsive } from 'antd-style';
2
+ import { memo } from 'react';
3
+
4
+ import { InspectorContent } from '../../../components/Inspector';
5
+ import Mobile from '../../../components/Inspector/Mobile';
6
+ import Desktop from './Desktop';
7
+
8
+ const SideBar = memo(() => {
9
+ const { mobile } = useResponsive();
10
+
11
+ const Render = mobile ? Mobile : Desktop;
12
+
13
+ return (
14
+ <Render>
15
+ <InspectorContent />
16
+ </Render>
17
+ );
18
+ });
19
+
20
+ export default SideBar;
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+ import { Flexbox } from 'react-layout-kit';
5
+
6
+ import Conversation from '../features/Conversation';
7
+ import PageTitle from '../features/PageTitle';
8
+ import ChatHeader from './features/ChatHeader';
9
+ import ChatInput from './features/ChatInput';
10
+ import SideBar from './features/SideBar';
11
+
12
+ const DesktopPage = memo(() => {
13
+ return (
14
+ <>
15
+ <PageTitle />
16
+ <ChatHeader />
17
+ <Flexbox flex={1} height={'calc(100vh - 64px)'} horizontal>
18
+ <Conversation chatInput={<ChatInput />} />
19
+ <SideBar />
20
+ </Flexbox>
21
+ </>
22
+ );
23
+ });
24
+ export default DesktopPage;
@@ -5,14 +5,14 @@ import AppLayout from '@/layout/AppLayout';
5
5
  import { useSwitchSideBarOnInit } from '@/store/global';
6
6
  import { SidebarTabKey } from '@/store/global/initialState';
7
7
 
8
- import { Sessions } from './features/SessionList';
8
+ import ResponsiveSessionList from '../features/SessionList';
9
9
 
10
- const ChatLayout = memo<PropsWithChildren>(({ children }) => {
10
+ const Desktop = memo<PropsWithChildren>(({ children }) => {
11
11
  useSwitchSideBarOnInit(SidebarTabKey.Chat);
12
12
 
13
13
  return (
14
14
  <AppLayout>
15
- <Sessions />
15
+ <ResponsiveSessionList />
16
16
  <Flexbox
17
17
  flex={1}
18
18
  height={'100vh'}
@@ -25,4 +25,4 @@ const ChatLayout = memo<PropsWithChildren>(({ children }) => {
25
25
  );
26
26
  });
27
27
 
28
- export default ChatLayout;
28
+ export default Desktop;
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+
3
+ import { useResponsive } from 'antd-style';
4
+ import { PropsWithChildren, memo } from 'react';
5
+
6
+ import { useEffectAfterSessionHydrated } from '@/store/session/hooks';
7
+
8
+ import MobileLayout from '../../(mobile)/layout';
9
+ import DesktopLayout from './Desktop';
10
+
11
+ const Chat = memo<PropsWithChildren>(({ children }) => {
12
+ const { mobile } = useResponsive();
13
+
14
+ const RenderLayout = mobile ? MobileLayout : DesktopLayout;
15
+
16
+ useEffectAfterSessionHydrated(
17
+ (store) => {
18
+ store.setState({ isMobile: mobile });
19
+ },
20
+ [mobile],
21
+ );
22
+
23
+ return <RenderLayout>{children}</RenderLayout>;
24
+ });
25
+ export default Chat;
@@ -0,0 +1 @@
1
+ export { default } from '../../components/ChatHeader/Mobile';
@@ -0,0 +1,14 @@
1
+ import { memo } from 'react';
2
+
3
+ import { ChatInputContent } from '../../components/ChatInput';
4
+ import Mobile from '../../components/ChatInput/Mobile';
5
+
6
+ const ChatInput = () => {
7
+ return (
8
+ <Mobile>
9
+ <ChatInputContent mobile />
10
+ </Mobile>
11
+ );
12
+ };
13
+
14
+ export default memo(ChatInput);
@@ -0,0 +1,12 @@
1
+ import { memo } from 'react';
2
+
3
+ import { SessionListContent } from '../../components/SessionList';
4
+ import Wrapper from '../../components/SessionList/Mobile';
5
+
6
+ const SessionList = memo(() => (
7
+ <Wrapper>
8
+ <SessionListContent />
9
+ </Wrapper>
10
+ ));
11
+
12
+ export default SessionList;
@@ -0,0 +1,12 @@
1
+ import { memo } from 'react';
2
+
3
+ import { InspectorContent } from '../../components/Inspector';
4
+ import Mobile from '../../components/Inspector/Mobile';
5
+
6
+ const Topics = memo(() => (
7
+ <Mobile>
8
+ <InspectorContent />
9
+ </Mobile>
10
+ ));
11
+
12
+ export default Topics;
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+
5
+ import AppMobileLayout from '@/layout/AppMobileLayout';
6
+
7
+ import PageTitle from '../features/PageTitle';
8
+ import SessionHeader from './features/SessionHeader';
9
+ import SessionList from './features/SessionList';
10
+
11
+ const ChatMobilePage = memo(() => {
12
+ return (
13
+ <AppMobileLayout navBar={<SessionHeader />} showTabBar>
14
+ <PageTitle />
15
+ <SessionList />
16
+ </AppMobileLayout>
17
+ );
18
+ });
19
+
20
+ export default ChatMobilePage;
@@ -0,0 +1,15 @@
1
+ 'use client';
2
+
3
+ import { PropsWithChildren, memo } from 'react';
4
+
5
+ import { useEffectAfterSessionHydrated } from '@/store/session';
6
+
7
+ const ChatMobileLayout = memo<PropsWithChildren>(({ children }) => {
8
+ useEffectAfterSessionHydrated((store) => {
9
+ store.setState({ isMobile: true });
10
+ }, []);
11
+
12
+ return children;
13
+ });
14
+
15
+ export default ChatMobileLayout;
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+ import { Flexbox } from 'react-layout-kit';
5
+
6
+ import AppMobileLayout from '@/layout/AppMobileLayout';
7
+
8
+ import Conversation from '../../features/Conversation';
9
+ import Header from '../features/ChatHeader';
10
+ import ChatInput from '../features/ChatInput';
11
+ import Topics from '../features/Topics';
12
+
13
+ const Chat = memo(() => (
14
+ <AppMobileLayout navBar={<Header />}>
15
+ <Flexbox height={'calc(100vh - 44px)'} horizontal>
16
+ <Conversation chatInput={<ChatInput />} mobile />
17
+ <Topics />
18
+ </Flexbox>
19
+ </AppMobileLayout>
20
+ ));
21
+ export default Chat;
@@ -4,13 +4,14 @@ import { useRouter } from 'next/navigation';
4
4
  import { memo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
7
- import ShareButton from '@/app/chat/features/Header/ShareButton';
8
7
  import { MOBILE_HEADER_ICON_SIZE } from '@/const/layoutTokens';
9
8
  import { useGlobalStore } from '@/store/global';
10
9
  import { useSessionStore } from '@/store/session';
11
10
  import { agentSelectors, sessionSelectors } from '@/store/session/selectors';
12
11
  import { pathString } from '@/utils/url';
13
12
 
13
+ import ShareButton from './ShareButton';
14
+
14
15
  const MobileHeader = memo(() => {
15
16
  const { t } = useTranslation('common');
16
17
  const router = useRouter();
@@ -6,14 +6,14 @@ import { toJpeg, toPng, toSvg } from 'html-to-image';
6
6
  import { memo, useCallback, useState } from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { Flexbox } from 'react-layout-kit';
9
+ import ChatList from 'src/app/chat/features/Conversation/ChatList';
9
10
 
10
- import pkg from '@/../package.json';
11
- import ChatList from '@/app/chat/features/Conversation/ChatList';
12
- import PluginTag from '@/app/chat/features/Header/PluginTag';
11
+ import PluginTag from '@/app/chat/components/ChatHeader/PluginTag';
13
12
  import { useSessionStore } from '@/store/session';
14
13
  import { agentSelectors } from '@/store/session/slices/agentConfig';
15
14
  import { sessionSelectors } from '@/store/session/slices/session/selectors';
16
15
 
16
+ import pkg from '../../../../../../package.json';
17
17
  import { useStyles } from './style';
18
18
 
19
19
  export enum ImageType {
@@ -9,28 +9,32 @@ import { useSessionStore } from '@/store/session';
9
9
 
10
10
  import ActionLeft from './ActionBar/ActionLeft';
11
11
  import ActionsRight from './ActionBar/ActionRight';
12
- import Desktop from './Desktop';
13
12
  import Footer from './Footer';
14
- import Mobile from './Mobile';
15
13
 
16
14
  const Token = dynamic(() => import('./ActionBar/Token'), { ssr: false });
17
15
 
18
- const ChatInput = () => {
19
- const { t } = useTranslation('common');
20
- const [expand, setExpand] = useState<boolean>(false);
21
- const [message, setMessage] = useState('');
22
- const { mobile } = useResponsive();
16
+ interface ChatContentProps {
17
+ expand?: boolean;
18
+ mobile?: boolean;
19
+ onExpandChange?: (expand: boolean) => void;
20
+ }
23
21
 
24
- const [isLoading, sendMessage, stopGenerateMessage] = useSessionStore((s) => [
25
- !!s.chatLoadingId,
26
- s.sendMessage,
27
- s.stopGenerateMessage,
28
- ]);
22
+ export const ChatInputContent = memo<ChatContentProps>(
23
+ ({ expand, onExpandChange, mobile: defaultMobile }) => {
24
+ const { t } = useTranslation('common');
29
25
 
30
- const Render = mobile ? Mobile : Desktop;
26
+ const [message, setMessage] = useState('');
27
+ const { mobile: runtimeMobile } = useResponsive();
31
28
 
32
- return (
33
- <Render expand={expand}>
29
+ const mobile = runtimeMobile || defaultMobile;
30
+
31
+ const [isLoading, sendMessage, stopGenerateMessage] = useSessionStore((s) => [
32
+ !!s.chatLoadingId,
33
+ s.sendMessage,
34
+ s.stopGenerateMessage,
35
+ ]);
36
+
37
+ return (
34
38
  <ChatInputArea
35
39
  actions={
36
40
  <>
@@ -45,7 +49,7 @@ const ChatInput = () => {
45
49
  footer={<Footer />}
46
50
  loading={isLoading}
47
51
  minHeight={mobile ? 0 : CHAT_TEXTAREA_HEIGHT}
48
- onExpandChange={setExpand}
52
+ onExpandChange={onExpandChange}
49
53
  onInputChange={setMessage}
50
54
  onSend={sendMessage}
51
55
  onStop={stopGenerateMessage}
@@ -56,8 +60,6 @@ const ChatInput = () => {
56
60
  }}
57
61
  value={message}
58
62
  />
59
- </Render>
60
- );
61
- };
62
-
63
- export default memo(ChatInput);
63
+ );
64
+ },
65
+ );
@@ -0,0 +1,17 @@
1
+ import { Flexbox } from 'react-layout-kit';
2
+
3
+ import { Topic } from './Topic';
4
+ import TopicSearchBar from './TopicSearchBar';
5
+
6
+ export const InspectorContent = () => {
7
+ return (
8
+ <Flexbox height={'100%'} style={{ overflow: 'hidden' }}>
9
+ <Flexbox padding={16}>
10
+ <TopicSearchBar />
11
+ </Flexbox>
12
+ <Flexbox gap={16} paddingInline={16} style={{ overflowY: 'auto', position: 'relative' }}>
13
+ <Topic />
14
+ </Flexbox>
15
+ </Flexbox>
16
+ );
17
+ };
@@ -1,6 +1,6 @@
1
1
  import { ReactNode, memo } from 'react';
2
2
 
3
- import SessionSearchBar from '../SessionSearchBar';
3
+ import SessionSearchBar from '../../features/SessionSearchBar';
4
4
 
5
5
  const Sessions = memo<{ children: ReactNode }>(({ children }) => {
6
6
  return (
@@ -1,20 +1,13 @@
1
1
  import { CollapseProps } from 'antd';
2
- import { useResponsive } from 'antd-style';
3
2
  import { memo, useMemo } from 'react';
4
3
  import { useTranslation } from 'react-i18next';
5
4
 
6
5
  import CollapseGroup from './CollapseGroup';
7
- import Desktop from './Desktop';
8
6
  import Inbox from './Inbox';
9
7
  import SessionList from './List';
10
- import Mobile from './Mobile';
11
8
 
12
- export const Sessions = memo(() => {
13
- const { mobile } = useResponsive();
9
+ export const SessionListContent = memo(() => {
14
10
  const { t } = useTranslation('common');
15
-
16
- const Render = mobile ? Mobile : Desktop;
17
-
18
11
  const items: CollapseProps['items'] = useMemo(
19
12
  () => [
20
13
  {
@@ -27,9 +20,9 @@ export const Sessions = memo(() => {
27
20
  );
28
21
 
29
22
  return (
30
- <Render>
23
+ <>
31
24
  <Inbox />
32
25
  <CollapseGroup defaultActiveKey={['sessionList']} items={items} />
33
- </Render>
26
+ </>
34
27
  );
35
28
  });
@@ -1,6 +1,6 @@
1
1
  import { BackBottom } from '@lobehub/ui';
2
2
  import { createStyles } from 'antd-style';
3
- import { memo, useRef } from 'react';
3
+ import { ReactNode, memo, useRef } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Flexbox } from 'react-layout-kit';
6
6
 
@@ -8,7 +8,6 @@ import SafeSpacing from '@/components/SafeSpacing';
8
8
  import { usePluginStore } from '@/store/plugin';
9
9
 
10
10
  import ChatList from './ChatList';
11
- import ChatInput from './Input';
12
11
  import ChatScrollAnchor from './ScrollAnchor';
13
12
 
14
13
  const useStyles = createStyles(
@@ -23,7 +22,12 @@ const useStyles = createStyles(
23
22
  `,
24
23
  );
25
24
 
26
- const Conversation = memo<{ mobile?: boolean }>(({ mobile }) => {
25
+ interface ConversationProps {
26
+ chatInput: ReactNode;
27
+ mobile?: boolean;
28
+ }
29
+
30
+ const Conversation = memo<ConversationProps>(({ mobile, chatInput }) => {
27
31
  const ref = useRef(null);
28
32
  const { t } = useTranslation('common');
29
33
  const { styles } = useStyles();
@@ -41,7 +45,7 @@ const Conversation = memo<{ mobile?: boolean }>(({ mobile }) => {
41
45
  </div>
42
46
  <BackBottom target={ref} text={t('backToBottom')} />
43
47
  </div>
44
- <ChatInput />
48
+ {chatInput}
45
49
  </Flexbox>
46
50
  );
47
51
  });
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+
5
+ import PageTitle from '@/components/PageTitle';
6
+ import { useSessionStore } from '@/store/session';
7
+ import { agentSelectors } from '@/store/session/selectors';
8
+ import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
9
+
10
+ const Title = memo(() => {
11
+ const [avatar, title] = useSessionStore((s) => [
12
+ agentSelectors.currentAgentAvatar(s),
13
+ agentSelectors.currentAgentTitle(s),
14
+ ]);
15
+ const pageTitle = genSiteHeadTitle([avatar, title].filter(Boolean).join(' '));
16
+
17
+ return <PageTitle title={pageTitle} />;
18
+ });
19
+ export default Title;
@@ -0,0 +1,14 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ import { isMobileDevice } from '@/utils/responsive';
4
+
5
+ import Desktop from './(desktop)/layout';
6
+ import Mobile from './(mobile)/layout';
7
+
8
+ const Layout = ({ children }: PropsWithChildren) => {
9
+ const mobile = isMobileDevice();
10
+
11
+ return mobile ? <Mobile>{children}</Mobile> : <Desktop>{children}</Desktop>;
12
+ };
13
+
14
+ export default Layout;
@@ -1,7 +1,12 @@
1
- import Page from './index';
1
+ import { isMobileDevice } from '@/utils/responsive';
2
2
 
3
- const Index = () => {
4
- return <Page />;
3
+ import DesktopPage from './(desktop)';
4
+ import MobilePage from './(mobile)';
5
+
6
+ const Page = () => {
7
+ const mobile = isMobileDevice();
8
+
9
+ return mobile ? <MobilePage /> : <DesktopPage />;
5
10
  };
6
11
 
7
- export default Index;
12
+ export default Page;
@@ -0,0 +1,13 @@
1
+ import { memo } from 'react';
2
+
3
+ import { HeaderContent } from '@/app/chat/settings/components/Header';
4
+
5
+ import Layout from './Desktop';
6
+
7
+ const Header = memo(() => (
8
+ <Layout>
9
+ <HeaderContent />
10
+ </Layout>
11
+ ));
12
+
13
+ export default Header;