@lobehub/chat 0.155.4 → 0.155.5

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 (131) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +2 -2
  3. package/README.zh-CN.md +8 -8
  4. package/package.json +1 -1
  5. package/src/app/(main)/(mobile)/me/features/Header.tsx +2 -9
  6. package/src/app/(main)/(mobile)/me/loading.tsx +1 -12
  7. package/src/app/(main)/(mobile)/me/page.tsx +2 -5
  8. package/src/app/(main)/@nav/_layout/Mobile.tsx +1 -1
  9. package/src/app/(main)/_layout/Mobile.tsx +5 -1
  10. package/src/app/(main)/chat/(workspace)/@conversation/default.tsx +23 -0
  11. package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/index.tsx +6 -2
  12. package/src/app/(main)/chat/{(mobile)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Mobile}/index.tsx +9 -4
  13. package/src/app/(main)/chat/(workspace)/@topic/default.tsx +19 -0
  14. package/src/app/(main)/chat/{(desktop)/features/SideBar/SystemRole/index.tsx → (workspace)/@topic/features/SystemRole/SystemRoleContent.tsx} +2 -0
  15. package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/index.tsx +18 -0
  16. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Header.tsx +2 -0
  17. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/index.tsx +26 -28
  18. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/TopicSearchBar/index.tsx +4 -2
  19. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/index.tsx +3 -4
  20. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/HeaderAction.tsx +2 -0
  21. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/Main.tsx +3 -1
  22. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/Tags.tsx +1 -1
  23. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/index.tsx +1 -2
  24. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/HotKeys.tsx +2 -0
  25. package/src/app/(main)/chat/{(desktop)/features/SideBar/index.tsx → (workspace)/_layout/Desktop/TopicPanel.tsx} +23 -20
  26. package/src/app/(main)/chat/(workspace)/_layout/Desktop/index.tsx +35 -0
  27. package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/index.tsx +35 -0
  28. package/src/app/(main)/chat/(workspace)/_layout/Mobile/TopicModal.tsx +26 -0
  29. package/src/app/(main)/chat/(workspace)/_layout/Mobile/index.tsx +21 -0
  30. package/src/app/(main)/chat/(workspace)/_layout/type.ts +7 -0
  31. package/src/app/(main)/chat/{features → (workspace)/features}/PluginTag/index.tsx +2 -0
  32. package/src/app/(main)/chat/{features → (workspace)/features}/SettingButton.tsx +3 -1
  33. package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/index.tsx +5 -6
  34. package/src/app/(main)/chat/{features/TelemetryNotification/index.tsx → (workspace)/features/TelemetryNotification.tsx} +2 -0
  35. package/src/app/(main)/chat/(workspace)/features/useWorkspaceModal.tsx +27 -0
  36. package/src/app/(main)/chat/(workspace)/layout.ts +11 -0
  37. package/src/app/(main)/chat/(workspace)/page.tsx +19 -0
  38. package/src/app/(main)/chat/@session/_layout/Desktop/PanelBody.tsx +22 -0
  39. package/src/app/(main)/chat/{_layout → @session/_layout}/Desktop/SessionHeader.tsx +2 -0
  40. package/src/app/(main)/chat/@session/_layout/Desktop/index.tsx +15 -0
  41. package/src/app/(main)/chat/{(mobile)/features → @session/_layout/Mobile}/SessionHeader.tsx +7 -20
  42. package/src/app/(main)/chat/@session/_layout/Mobile/index.tsx +19 -0
  43. package/src/app/(main)/chat/@session/default.tsx +23 -0
  44. package/src/app/(main)/chat/{components/SessionHydration/index.tsx → @session/features/SessionHydration.tsx} +1 -0
  45. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/DefaultMode.tsx +3 -3
  46. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Inbox/index.tsx +2 -2
  47. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/index.tsx +3 -4
  48. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/ListItem/index.tsx +12 -10
  49. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/SearchMode.tsx +4 -2
  50. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/index.tsx +2 -0
  51. package/src/app/(main)/chat/{features/SessionSearchBar/index.tsx → @session/features/SessionSearchBar.tsx} +3 -5
  52. package/src/app/(main)/chat/_layout/Desktop/SessionPanel.tsx +79 -0
  53. package/src/app/(main)/chat/_layout/Desktop/index.tsx +11 -7
  54. package/src/app/(main)/chat/_layout/Mobile.tsx +52 -0
  55. package/src/app/(main)/chat/_layout/type.ts +1 -0
  56. package/src/app/(main)/chat/error.tsx +5 -0
  57. package/src/app/(main)/chat/features/Migration/index.tsx +3 -8
  58. package/src/app/(main)/chat/not-found.tsx +3 -0
  59. package/src/app/(main)/chat/settings/_layout/Mobile/Header.tsx +3 -4
  60. package/src/app/(main)/chat/settings/features/HeaderContent.tsx +2 -2
  61. package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +2 -2
  62. package/src/app/(main)/market/@detail/features/Header.tsx +2 -2
  63. package/src/components/Cell/Divider.tsx +2 -2
  64. package/src/components/Cell/index.tsx +2 -2
  65. package/src/components/StoreHydration/ChatHydration/index.tsx +2 -2
  66. package/src/const/session.ts +2 -0
  67. package/src/const/url.ts +5 -1
  68. package/src/features/ChatInput/ActionBar/Tools/index.tsx +3 -2
  69. package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +1 -1
  70. package/src/features/Conversation/components/InboxWelcome/index.tsx +2 -2
  71. package/src/features/Conversation/components/SkeletonList.tsx +21 -8
  72. package/src/features/Conversation/components/VirtualizedList/index.tsx +19 -17
  73. package/src/features/Conversation/index.tsx +12 -31
  74. package/src/features/PluginStore/InstalledPluginList.tsx +28 -21
  75. package/src/features/PluginStore/OnlineList.tsx +4 -10
  76. package/src/features/PluginStore/PluginItem/Action.tsx +3 -2
  77. package/src/features/PluginStore/PluginItem/index.tsx +2 -0
  78. package/src/features/PluginStore/index.tsx +4 -2
  79. package/src/features/User/UserAvatar.tsx +2 -1
  80. package/src/features/User/UserPanel/useMenu.tsx +1 -1
  81. package/src/layout/GlobalProvider/AppTheme.tsx +7 -17
  82. package/src/store/global/action.ts +2 -0
  83. package/src/store/global/initialState.ts +2 -0
  84. package/src/styles/global.ts +12 -9
  85. package/src/styles/mobileHeader.ts +1 -1
  86. package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +0 -27
  87. package/src/app/(main)/(mobile)/me/features/style.ts +0 -29
  88. package/src/app/(main)/chat/(desktop)/features/Conversation.tsx +0 -19
  89. package/src/app/(main)/chat/(desktop)/index.tsx +0 -22
  90. package/src/app/(main)/chat/(mobile)/features/SessionList.tsx +0 -17
  91. package/src/app/(main)/chat/(mobile)/features/TopicList.tsx +0 -29
  92. package/src/app/(main)/chat/(mobile)/index.tsx +0 -26
  93. package/src/app/(main)/chat/(mobile)/mobile/ChatHeader/index.tsx +0 -56
  94. package/src/app/(main)/chat/(mobile)/mobile/page.tsx +0 -26
  95. package/src/app/(main)/chat/_layout/Desktop/SessionList.tsx +0 -39
  96. package/src/app/(main)/chat/_layout/Mobile/index.tsx +0 -9
  97. package/src/app/(main)/chat/page.tsx +0 -25
  98. package/src/features/FolderPanel/index.tsx +0 -60
  99. package/src/utils/screen.ts +0 -14
  100. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/DragUpload.tsx +0 -0
  101. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/LocalFiles.tsx +0 -0
  102. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/SendMore.tsx +0 -0
  103. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/index.tsx +0 -0
  104. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Header/index.tsx +0 -0
  105. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/TextArea.test.tsx +0 -0
  106. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/TextArea.tsx +0 -0
  107. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/__tests__/useAutoFocus.test.ts +0 -0
  108. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/useAutoFocus.ts +0 -0
  109. /package/src/app/(main)/chat/{(mobile)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Mobile}/Files.tsx +0 -0
  110. /package/src/app/(main)/chat/{(desktop)/features/SideBar → (workspace)/@topic/features}/SystemRole/style.ts +0 -0
  111. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/DefaultContent.tsx +0 -0
  112. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/SkeletonList.tsx +0 -0
  113. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/TopicContent.tsx +0 -0
  114. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/TopicItem.tsx +0 -0
  115. /package/src/app/(main)/chat/{(mobile)/mobile → (workspace)/_layout/Mobile}/ChatHeader/ChatHeaderTitle.tsx +0 -0
  116. /package/src/app/(main)/chat/{features → (workspace)/features}/PluginTag/PluginStatus.tsx +0 -0
  117. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/Preview.tsx +0 -0
  118. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/ShareModal.tsx +0 -0
  119. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/style.ts +0 -0
  120. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/type.ts +0 -0
  121. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/useScreenshot.ts +0 -0
  122. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/CollapseGroup/Actions.tsx +0 -0
  123. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/CollapseGroup/index.tsx +0 -0
  124. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/AddButton.tsx +0 -0
  125. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/Item/Actions.tsx +0 -0
  126. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/Item/index.tsx +0 -0
  127. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx +0 -0
  128. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/ConfigGroupModal/index.tsx +0 -0
  129. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/CreateGroupModal.tsx +0 -0
  130. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/RenameGroupModal.tsx +0 -0
  131. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/SkeletonList.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.155.5](https://github.com/lobehub/lobe-chat/compare/v0.155.4...v0.155.5)
6
+
7
+ <sup>Released on **2024-05-08**</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.155.4](https://github.com/lobehub/lobe-chat/compare/v0.155.3...v0.155.4)
6
23
 
7
24
  <sup>Released on **2024-05-08**</sup>
package/README.md CHANGED
@@ -263,12 +263,12 @@ Our marketplace is not just a showcase platform but also a collaborative space.
263
263
 
264
264
  | Recent Submits | Description |
265
265
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
266
+ | [SF Symbols Finder](https://chat-preview.lobehub.com/market?agent=sf-symbols-finder)<br/><sup>By **[inquiry-paring0a](https://github.com/inquiry-paring0a)** on **2024-05-08**</sup> | Master Apple SF Symbols, select symbols that match the description<br/>`sf-symbols` `expert` `icon` `symbol` `plugin` |
266
267
  | [Video to Blog Post Assistant](https://chat-preview.lobehub.com/market?agent=video-2-blog-assistant)<br/><sup>By **[yayoinoyume](https://github.com/yayoinoyume)** on **2024-05-06**</sup> | Helps you quickly organize messy subtitles into beautiful blog posts<br/>`subtitle-organization` `blog-post-formatting` `video-to-blog` |
267
268
  | [Art Evaluation Tutor](https://chat-preview.lobehub.com/market?agent=wanwusheng-art)<br/><sup>By **[dingyufei615](https://github.com/dingyufei615)** on **2024-05-06**</sup> | Specializes in teaching children's art, meticulously evaluates works, pays attention to details, and adapts to students of different age groups.<br/>`art-education` `evaluation` `creativity` `teaching` `painting` |
268
269
  | [iOS Code Artist](https://chat-preview.lobehub.com/market?agent=ios-develop)<br/><sup>By **[Alcu1n](https://github.com/Alcu1n)** on **2024-05-03**</sup> | iOS development expert with 15 years of experience, proficient in Swift, SwiftUI, Flutter. Clear logic in code, precise debugging, providing project frameworks from 0 to 1.<br/>`i-os-development` `coding` `debugging` `project-planning` `logical-thinking` |
269
- | [Sales Description Specialist](https://chat-preview.lobehub.com/market?agent=verkauf-kleinanzeigen)<br/><sup>By **[highseen](https://github.com/highseen)** on **2024-04-30**</sup> | Assists in the sale of used items through research, pricing, description, and title creation.<br/>`product-sales` `research` `description` |
270
270
 
271
- > 📊 Total agents: [<kbd>**247**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
271
+ > 📊 Total agents: [<kbd>**248**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
272
272
 
273
273
  <!-- AGENT LIST -->
274
274
 
package/README.zh-CN.md CHANGED
@@ -249,14 +249,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
249
249
 
250
250
  <!-- AGENT LIST -->
251
251
 
252
- | 最近新增 | 助手说明 |
253
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
254
- | [视频转博客文章助手](https://chat-preview.lobehub.com/market?agent=video-2-blog-assistant)<br/><sup>By **[yayoinoyume](https://github.com/yayoinoyume)** on **2024-05-06**</sup> | 帮你快速整理缭乱的字幕,变成精美的博客文章<br/>`字幕整理` `博文格式` `视频变博客` |
255
- | [美术评价导师](https://chat-preview.lobehub.com/market?agent=wanwusheng-art)<br/><sup>By **[dingyufei615](https://github.com/dingyufei615)** on **2024-05-06**</sup> | 擅长少儿美术教学,细致评价作品,关注细节,适应不同年龄段学生。<br/>`美术教育` `评价` `创意` `教学` `绘画` |
256
- | [iOS 代码艺术家](https://chat-preview.lobehub.com/market?agent=ios-develop)<br/><sup>By **[Alcu1n](https://github.com/Alcu1n)** on **2024-05-03**</sup> | iOS 开发专家,15 年经验,精通 Swift、SwiftUI、Flutter。逻辑清晰的代码,精准 debug,提供 0 到 1 的项目框架。<br/>`i-os开发` `编码` `调试` `项目规划` `逻辑思维` |
257
- | [销售描述专家](https://chat-preview.lobehub.com/market?agent=verkauf-kleinanzeigen)<br/><sup>By **[highseen](https://github.com/highseen)** on **2024-04-30**</sup> | 通过研究、定价、描述和标题设计帮助销售二手物品。<br/>`产品销售` `研究` `描述` |
258
-
259
- > 📊 Total agents: [<kbd>**247**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
252
+ | 最近新增 | 助手说明 |
253
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
254
+ | [SF Symbols 查找器](https://chat-preview.lobehub.com/market?agent=sf-symbols-finder)<br/><sup>By **[inquiry-paring0a](https://github.com/inquiry-paring0a)** on **2024-05-08**</sup> | 精通苹果 SF Symbols,可根据描述选择符合的 Symbols<br/>`sf-symbols` `专家` `图标` `符号` `插件` |
255
+ | [视频转博客文章助手](https://chat-preview.lobehub.com/market?agent=video-2-blog-assistant)<br/><sup>By **[yayoinoyume](https://github.com/yayoinoyume)** on **2024-05-06**</sup> | 帮你快速整理缭乱的字幕,变成精美的博客文章<br/>`字幕整理` `博文格式` `视频变博客` |
256
+ | [美术评价导师](https://chat-preview.lobehub.com/market?agent=wanwusheng-art)<br/><sup>By **[dingyufei615](https://github.com/dingyufei615)** on **2024-05-06**</sup> | 擅长少儿美术教学,细致评价作品,关注细节,适应不同年龄段学生。<br/>`美术教育` `评价` `创意` `教学` `绘画` |
257
+ | [iOS 代码艺术家](https://chat-preview.lobehub.com/market?agent=ios-develop)<br/><sup>By **[Alcu1n](https://github.com/Alcu1n)** on **2024-05-03**</sup> | iOS 开发专家,15 年经验,精通 Swift、SwiftUI、Flutter。逻辑清晰的代码,精准 debug,提供 0 到 1 的项目框架。<br/>`i-os开发` `编码` `调试` `项目规划` `逻辑思维` |
258
+
259
+ > 📊 Total agents: [<kbd>**248**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
260
260
 
261
261
  <!-- AGENT LIST -->
262
262
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.155.4",
3
+ "version": "0.155.5",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -1,35 +1,28 @@
1
1
  'use client';
2
2
 
3
3
  import { ActionIcon, MobileNavBar } from '@lobehub/ui';
4
- import { useScroll } from 'ahooks';
5
4
  import { useTheme } from 'antd-style';
6
5
  import { Moon, Sun } from 'lucide-react';
7
6
  import { memo } from 'react';
8
7
 
9
8
  import { MOBILE_HEADER_ICON_SIZE } from '@/const/layoutTokens';
10
9
  import { useUserStore } from '@/store/user';
11
- import { mobileHeaderFixed } from '@/styles/mobileHeader';
10
+ import { mobileHeaderSticky } from '@/styles/mobileHeader';
12
11
 
13
12
  const Header = memo(() => {
14
13
  const theme = useTheme();
15
- const scroll = useScroll(() => document.querySelector('#lobe-mobile-scroll-container'));
16
14
  const switchThemeMode = useUserStore((s) => s.switchThemeMode);
17
- const showBackground = (scroll as any)?.top > 44;
18
15
 
19
16
  return (
20
17
  <MobileNavBar
21
18
  right={
22
19
  <ActionIcon
23
- color={showBackground ? undefined : theme.colorBgLayout}
24
20
  icon={theme.isDarkMode ? Moon : Sun}
25
21
  onClick={() => switchThemeMode(theme.isDarkMode ? 'light' : 'dark')}
26
22
  size={MOBILE_HEADER_ICON_SIZE}
27
23
  />
28
24
  }
29
- style={{
30
- ...mobileHeaderFixed,
31
- background: showBackground ? undefined : 'transparent',
32
- }}
25
+ style={mobileHeaderSticky}
33
26
  />
34
27
  );
35
28
  });
@@ -7,21 +7,10 @@ import { Flexbox } from 'react-layout-kit';
7
7
  import Divider from '@/components/Cell/Divider';
8
8
  import SkeletonLoading from '@/components/SkeletonLoading';
9
9
 
10
- import { useStyles } from './features/style';
11
-
12
10
  const Loading = memo(() => {
13
- const { styles } = useStyles();
14
11
  return (
15
12
  <>
16
- <Flexbox align={'center'} className={styles.bannerBox} justify={'center'} />
17
- <Flexbox
18
- align={'center'}
19
- className={styles.info}
20
- gap={12}
21
- horizontal
22
- paddingBlock={12}
23
- paddingInline={12}
24
- >
13
+ <Flexbox align={'center'} gap={12} horizontal paddingBlock={12} paddingInline={12}>
25
14
  <Skeleton.Avatar active shape={'circle'} size={48} />
26
15
  <Skeleton.Button active block />
27
16
  </Flexbox>
@@ -7,7 +7,6 @@ import DataStatistics from '@/features/User/DataStatistics';
7
7
  import UserInfo from '@/features/User/UserInfo';
8
8
  import { isMobileDevice } from '@/utils/responsive';
9
9
 
10
- import AvatarBanner from './features/AvatarBanner';
11
10
  import Cate from './features/Cate';
12
11
  import ExtraCate from './features/ExtraCate';
13
12
 
@@ -18,10 +17,8 @@ const Page = () => {
18
17
 
19
18
  return (
20
19
  <>
21
- <AvatarBanner>
22
- <UserInfo />
23
- <DataStatistics paddingInline={16} />
24
- </AvatarBanner>
20
+ <UserInfo />
21
+ <DataStatistics paddingInline={12} style={{ paddingBottom: 6 }} />
25
22
  <Divider />
26
23
  <Cate />
27
24
  <ExtraCate />
@@ -63,7 +63,7 @@ const Nav = memo(() => {
63
63
  [t],
64
64
  );
65
65
 
66
- return <MobileTabBar activeKey={activeKey} className={styles.container} items={items} safeArea />;
66
+ return <MobileTabBar activeKey={activeKey} className={styles.container} items={items} />;
67
67
  });
68
68
 
69
69
  Nav.displayName = 'MobileNav';
@@ -3,13 +3,17 @@
3
3
  import { usePathname } from 'next/navigation';
4
4
  import { memo } from 'react';
5
5
 
6
+ import { useQuery } from '@/hooks/useQuery';
7
+
6
8
  import { LayoutProps } from './type';
7
9
 
8
10
  const MOBILE_IGNORE_NAV_ROUTES = ['/settings/', '/chat/'];
9
11
 
10
12
  const Layout = memo(({ children, nav }: LayoutProps) => {
13
+ const { showMobileWorkspace } = useQuery();
11
14
  const pathname = usePathname();
12
- const hideNav = MOBILE_IGNORE_NAV_ROUTES.some((path) => pathname.startsWith(path));
15
+ const hideNav =
16
+ showMobileWorkspace || MOBILE_IGNORE_NAV_ROUTES.some((path) => pathname.startsWith(path));
13
17
 
14
18
  return (
15
19
  <>
@@ -0,0 +1,23 @@
1
+ import ChatHydration from '@/components/StoreHydration/ChatHydration';
2
+ import Conversation from '@/features/Conversation';
3
+ import { isMobileDevice } from '@/utils/responsive';
4
+
5
+ import DesktopChatInput from './features/ChatInput/Desktop';
6
+ import MobileChatInput from './features/ChatInput/Mobile';
7
+
8
+ const ChatConversation = () => {
9
+ const mobile = isMobileDevice();
10
+ const ChatInput = mobile ? MobileChatInput : DesktopChatInput;
11
+
12
+ return (
13
+ <>
14
+ <Conversation mobile={mobile} />
15
+ <ChatInput />
16
+ <ChatHydration />
17
+ </>
18
+ );
19
+ };
20
+
21
+ ChatConversation.displayName = 'ChatConversation';
22
+
23
+ export default ChatConversation;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { DraggablePanel } from '@lobehub/ui';
2
4
  import { memo, useState } from 'react';
3
5
  import { Flexbox } from 'react-layout-kit';
@@ -13,7 +15,7 @@ import Footer from './Footer';
13
15
  import Head from './Header';
14
16
  import TextArea from './TextArea';
15
17
 
16
- const ChatInput = memo(() => {
18
+ const DesktopChatInput = memo(() => {
17
19
  const [expand, setExpand] = useState<boolean>(false);
18
20
 
19
21
  const [inputHeight, updatePreference] = useGlobalStore((s) => [
@@ -52,4 +54,6 @@ const ChatInput = memo(() => {
52
54
  );
53
55
  });
54
56
 
55
- export default ChatInput;
57
+ DesktopChatInput.displayName = 'DesktopChatInput';
58
+
59
+ export default DesktopChatInput;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { MobileChatInputArea, MobileChatSendButton } from '@lobehub/ui';
2
4
  import { useTheme } from 'antd-style';
3
5
  import { memo } from 'react';
@@ -10,7 +12,7 @@ import { useChatInput } from '@/features/ChatInput/useChatInput';
10
12
 
11
13
  import Files from './Files';
12
14
 
13
- const ChatInputMobileLayout = memo(() => {
15
+ const MobileChatInput = memo(() => {
14
16
  const { t } = useTranslation('chat');
15
17
  const theme = useTheme();
16
18
  const { ref, onSend, loading, value, onInput, onStop, expand, setExpand } = useChatInput();
@@ -23,11 +25,12 @@ const ChatInputMobileLayout = memo(() => {
23
25
  onSend={onSend}
24
26
  placeholder={t('sendPlaceholder')}
25
27
  ref={ref}
26
- safeArea
27
28
  setExpand={setExpand}
28
29
  style={{
29
- background: `linear-gradient(to bottom, ${theme.colorFillQuaternary}, transparent)`,
30
+ background: theme.colorBgLayout,
31
+ top: expand ? 0 : undefined,
30
32
  width: '100%',
33
+ zIndex: 101,
31
34
  }}
32
35
  textAreaLeftAddons={<STT mobile />}
33
36
  textAreaRightAddons={
@@ -44,4 +47,6 @@ const ChatInputMobileLayout = memo(() => {
44
47
  );
45
48
  });
46
49
 
47
- export default ChatInputMobileLayout;
50
+ MobileChatInput.displayName = 'MobileChatInput';
51
+
52
+ export default MobileChatInput;
@@ -0,0 +1,19 @@
1
+ import { isMobileDevice } from '@/utils/responsive';
2
+
3
+ import SystemRole from './features/SystemRole';
4
+ import TopicListContent from './features/TopicListContent';
5
+
6
+ const Topic = () => {
7
+ const mobile = isMobileDevice();
8
+
9
+ return (
10
+ <>
11
+ {!mobile && <SystemRole />}
12
+ <TopicListContent mobile={mobile} />
13
+ </>
14
+ );
15
+ };
16
+
17
+ Topic.displayName = 'ChatTopic';
18
+
19
+ export default Topic;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { ActionIcon, EditableMessage } from '@lobehub/ui';
2
4
  import { Skeleton } from 'antd';
3
5
  import { Edit } from 'lucide-react';
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+
5
+ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
6
+ import { useSessionStore } from '@/store/session';
7
+ import { sessionSelectors } from '@/store/session/selectors';
8
+
9
+ import SystemRoleContent from './SystemRoleContent';
10
+
11
+ const SystemRole = memo(() => {
12
+ const { isAgentEditable: showSystemRole } = useServerConfigStore(featureFlagsSelectors);
13
+ const isInbox = useSessionStore(sessionSelectors.isInboxSession);
14
+
15
+ return showSystemRole && !isInbox && <SystemRoleContent />;
16
+ });
17
+
18
+ export default SystemRole;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { ActionIcon, Icon } from '@lobehub/ui';
2
4
  import { App, Dropdown, MenuProps } from 'antd';
3
5
  import { MoreHorizontal, Search, Trash } from 'lucide-react';
@@ -1,5 +1,7 @@
1
+ 'use client';
2
+
1
3
  import { EmptyCard } from '@lobehub/ui';
2
- import { css, cx, useThemeMode } from 'antd-style';
4
+ import { useThemeMode } from 'antd-style';
3
5
  import isEqual from 'fast-deep-equal';
4
6
  import React, { memo, useCallback, useRef } from 'react';
5
7
  import { useTranslation } from 'react-i18next';
@@ -15,13 +17,7 @@ import { ChatTopic } from '@/types/topic';
15
17
  import { Placeholder, SkeletonList } from './SkeletonList';
16
18
  import TopicItem from './TopicItem';
17
19
 
18
- const container = css`
19
- > div {
20
- padding-inline: 8px;
21
- }
22
- `;
23
-
24
- export const Topic = memo(() => {
20
+ export const Topic = memo<{ mobile?: boolean }>(({ mobile }) => {
25
21
  const { t } = useTranslation('chat');
26
22
  const virtuosoRef = useRef<VirtuosoHandle>(null);
27
23
  const { isDarkMode } = useThemeMode();
@@ -62,29 +58,31 @@ export const Topic = memo(() => {
62
58
  return !topicsInit ? (
63
59
  <SkeletonList />
64
60
  ) : (
65
- <Flexbox gap={2} height={'100%'} style={{ marginBottom: 12 }}>
61
+ <Flexbox
62
+ gap={2}
63
+ height={'100%'}
64
+ paddingInline={mobile ? undefined : 8}
65
+ style={{ marginBottom: 12 }}
66
+ >
66
67
  {topicLength === 0 && (
67
- <Flexbox flex={1} paddingInline={8}>
68
- <EmptyCard
69
- alt={t('topic.guide.desc')}
70
- cover={imageUrl(`empty_topic_${isDarkMode ? 'dark' : 'light'}.webp`)}
71
- desc={t('topic.guide.desc')}
72
- height={120}
73
- imageProps={{
74
- priority: true,
75
- }}
76
- onVisibleChange={(visible) => {
77
- updateGuideState({ topic: visible });
78
- }}
79
- style={{ marginBottom: 6 }}
80
- title={t('topic.guide.title')}
81
- visible={visible}
82
- width={200}
83
- />
84
- </Flexbox>
68
+ <EmptyCard
69
+ alt={t('topic.guide.desc')}
70
+ cover={imageUrl(`empty_topic_${isDarkMode ? 'dark' : 'light'}.webp`)}
71
+ desc={t('topic.guide.desc')}
72
+ height={120}
73
+ imageProps={{
74
+ priority: true,
75
+ }}
76
+ onVisibleChange={(visible) => {
77
+ updateGuideState({ topic: visible });
78
+ }}
79
+ style={{ flex: 'none', marginBottom: 12 }}
80
+ title={t('topic.guide.title')}
81
+ visible={visible}
82
+ width={200}
83
+ />
85
84
  )}
86
85
  <Virtuoso
87
- className={cx(container)}
88
86
  components={{ ScrollSeekPlaceholder: Placeholder }}
89
87
  computeItemKey={(_, item) => item.id}
90
88
  data={topics}
@@ -1,16 +1,18 @@
1
+ 'use client';
2
+
1
3
  import { SearchBar } from '@lobehub/ui';
2
4
  import { useUnmount } from 'ahooks';
3
- import { useResponsive } from 'antd-style';
4
5
  import { memo, useState } from 'react';
5
6
  import { useTranslation } from 'react-i18next';
6
7
 
7
8
  import { useChatStore } from '@/store/chat';
9
+ import { useServerConfigStore } from '@/store/serverConfig';
8
10
 
9
11
  const TopicSearchBar = memo<{ onClear?: () => void }>(({ onClear }) => {
10
12
  const { t } = useTranslation('chat');
11
13
 
12
14
  const [keywords, setKeywords] = useState('');
13
- const { mobile } = useResponsive();
15
+ const mobile = useServerConfigStore((s) => s.isMobile);
14
16
  const [activeSessionId, useSearchTopics] = useChatStore((s) => [s.activeId, s.useSearchTopics]);
15
17
 
16
18
  useSearchTopics(keywords, activeSessionId);
@@ -1,19 +1,18 @@
1
- import { memo } from 'react';
2
1
  import { Flexbox } from 'react-layout-kit';
3
2
 
4
3
  import Header from './Header';
5
4
  import { Topic } from './Topic';
6
5
  import TopicSearchBar from './TopicSearchBar';
7
6
 
8
- const TopicListContent = memo<{ mobile?: boolean }>(({ mobile }) => {
7
+ const TopicListContent = ({ mobile }: { mobile?: boolean }) => {
9
8
  return (
10
9
  <Flexbox gap={mobile ? 8 : 0} height={'100%'} style={{ overflow: 'hidden' }}>
11
10
  {mobile ? <TopicSearchBar /> : <Header />}
12
11
  <Flexbox gap={16} height={'100%'} style={{ paddingTop: 6, position: 'relative' }}>
13
- <Topic />
12
+ <Topic mobile={mobile} />
14
13
  </Flexbox>
15
14
  </Flexbox>
16
15
  );
17
- });
16
+ };
18
17
 
19
18
  export default TopicListContent;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { ActionIcon } from '@lobehub/ui';
2
4
  import { PanelRightClose, PanelRightOpen } from 'lucide-react';
3
5
  import { memo } from 'react';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { Avatar, ChatHeaderTitle } from '@lobehub/ui';
2
4
  import { Skeleton } from 'antd';
3
5
  import { memo } from 'react';
@@ -41,7 +43,7 @@ const Main = memo(() => {
41
43
  <Avatar
42
44
  avatar={avatar}
43
45
  background={backgroundColor}
44
- onClick={openChatSettings}
46
+ onClick={() => openChatSettings()}
45
47
  size={40}
46
48
  title={title}
47
49
  />
@@ -19,7 +19,7 @@ const TitleTags = memo(() => {
19
19
  const showPlugin = useUserStore(modelProviderSelectors.isModelEnabledFunctionCall(model));
20
20
 
21
21
  return (
22
- <Flexbox gap={8} horizontal>
22
+ <Flexbox align={'center'} horizontal>
23
23
  <ModelSwitchPanel>
24
24
  <ModelTag model={model} />
25
25
  </ModelSwitchPanel>
@@ -1,9 +1,8 @@
1
1
  import { ChatHeader } from '@lobehub/ui';
2
- import { memo } from 'react';
3
2
 
4
3
  import HeaderAction from './HeaderAction';
5
4
  import Main from './Main';
6
5
 
7
- const Header = memo(() => <ChatHeader left={<Main />} right={<HeaderAction />} />);
6
+ const Header = () => <ChatHeader left={<Main />} right={<HeaderAction />} style={{ zIndex: 11 }} />;
8
7
 
9
8
  export default Header;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import isEqual from 'fast-deep-equal';
2
4
  import { useCallback } from 'react';
3
5
  import { useHotkeys } from 'react-hotkeys-hook';
@@ -1,18 +1,12 @@
1
+ 'use client';
2
+
1
3
  import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui';
2
- import { createStyles } from 'antd-style';
3
- import dynamic from 'next/dynamic';
4
- import { memo } from 'react';
4
+ import { createStyles, useResponsive } from 'antd-style';
5
+ import { PropsWithChildren, memo, useEffect, useLayoutEffect, useState } from 'react';
5
6
 
6
7
  import SafeSpacing from '@/components/SafeSpacing';
7
8
  import { CHAT_SIDEBAR_WIDTH } from '@/const/layoutTokens';
8
9
  import { useGlobalStore } from '@/store/global';
9
- import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
10
- import { useSessionStore } from '@/store/session';
11
- import { sessionSelectors } from '@/store/session/selectors';
12
-
13
- import TopicListContent from '../../../features/TopicListContent';
14
-
15
- const SystemRole = dynamic(() => import('./SystemRole'));
16
10
 
17
11
  const useStyles = createStyles(({ css, token }) => ({
18
12
  content: css`
@@ -21,7 +15,7 @@ const useStyles = createStyles(({ css, token }) => ({
21
15
  height: 100% !important;
22
16
  `,
23
17
  drawer: css`
24
- z-index: 0;
18
+ z-index: 10;
25
19
  background: ${token.colorBgLayout};
26
20
  `,
27
21
  header: css`
@@ -29,15 +23,25 @@ const useStyles = createStyles(({ css, token }) => ({
29
23
  `,
30
24
  }));
31
25
 
32
- const Desktop = memo(() => {
26
+ const TopicPanel = memo(({ children }: PropsWithChildren) => {
33
27
  const { styles } = useStyles();
34
- const [showAgentSettings, toggleConfig] = useGlobalStore((s) => [
28
+ const { md = true, lg = true } = useResponsive();
29
+ const [showAgentSettings, toggleConfig, isPreferenceInit] = useGlobalStore((s) => [
35
30
  s.preference.showChatSideBar,
36
31
  s.toggleChatSideBar,
32
+ s.isPreferenceInit,
37
33
  ]);
34
+ const [expand, setExpand] = useState(showAgentSettings);
35
+
36
+ useLayoutEffect(() => {
37
+ if (!isPreferenceInit) return;
38
+ setExpand(showAgentSettings);
39
+ }, [isPreferenceInit, showAgentSettings]);
38
40
 
39
- const { isAgentEditable: showSystemRole } = useServerConfigStore(featureFlagsSelectors);
40
- const isInbox = useSessionStore(sessionSelectors.isInboxSession);
41
+ useEffect(() => {
42
+ if (lg && showAgentSettings) setExpand(true);
43
+ if (!lg) setExpand(false);
44
+ }, [lg, showAgentSettings]);
41
45
 
42
46
  return (
43
47
  <DraggablePanel
@@ -45,9 +49,9 @@ const Desktop = memo(() => {
45
49
  classNames={{
46
50
  content: styles.content,
47
51
  }}
48
- expand={showAgentSettings}
52
+ expand={expand}
49
53
  minWidth={CHAT_SIDEBAR_WIDTH}
50
- mode={'fixed'}
54
+ mode={md ? 'fixed' : 'float'}
51
55
  onExpandChange={toggleConfig}
52
56
  placement={'right'}
53
57
  showHandlerWideArea={false}
@@ -61,11 +65,10 @@ const Desktop = memo(() => {
61
65
  }}
62
66
  >
63
67
  <SafeSpacing />
64
- {showSystemRole && !isInbox && <SystemRole />}
65
- <TopicListContent />
68
+ {children}
66
69
  </DraggablePanelContainer>
67
70
  </DraggablePanel>
68
71
  );
69
72
  });
70
73
 
71
- export default Desktop;
74
+ export default TopicPanel;
@@ -0,0 +1,35 @@
1
+ import { Flexbox } from 'react-layout-kit';
2
+
3
+ import { LayoutProps } from '../type';
4
+ import ChatHeader from './ChatHeader';
5
+ import HotKeys from './HotKeys';
6
+ import TopicPanel from './TopicPanel';
7
+
8
+ const Layout = ({ children, topic, conversation }: LayoutProps) => {
9
+ return (
10
+ <>
11
+ <ChatHeader />
12
+ <Flexbox
13
+ height={'100%'}
14
+ horizontal
15
+ style={{ overflow: 'hidden', position: 'relative' }}
16
+ width={'100%'}
17
+ >
18
+ <Flexbox
19
+ height={'100%'}
20
+ style={{ overflow: 'hidden', position: 'relative' }}
21
+ width={'100%'}
22
+ >
23
+ {conversation}
24
+ </Flexbox>
25
+ {children}
26
+ <TopicPanel>{topic}</TopicPanel>
27
+ </Flexbox>
28
+ <HotKeys />
29
+ </>
30
+ );
31
+ };
32
+
33
+ Layout.displayName = 'DesktopConversationLayout';
34
+
35
+ export default Layout;