@lobehub/chat 0.155.4 → 0.155.6

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 (149) hide show
  1. package/CHANGELOG.md +42 -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}/Footer/index.tsx +2 -1
  12. package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/TextArea.test.tsx +6 -6
  13. package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/TextArea.tsx +2 -1
  14. package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/index.tsx +6 -2
  15. package/src/app/(main)/chat/{(mobile)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Mobile}/index.tsx +9 -4
  16. package/src/app/(main)/chat/(workspace)/@topic/default.tsx +19 -0
  17. package/src/app/(main)/chat/{(desktop)/features/SideBar/SystemRole/index.tsx → (workspace)/@topic/features/SystemRole/SystemRoleContent.tsx} +2 -0
  18. package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/index.tsx +18 -0
  19. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Header.tsx +2 -0
  20. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/index.tsx +26 -28
  21. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/TopicSearchBar/index.tsx +4 -2
  22. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/index.tsx +3 -4
  23. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/HeaderAction.tsx +2 -0
  24. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/Main.tsx +3 -1
  25. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/Tags.tsx +1 -1
  26. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/index.tsx +1 -2
  27. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/HotKeys.tsx +2 -0
  28. package/src/app/(main)/chat/{(desktop)/features/SideBar/index.tsx → (workspace)/_layout/Desktop/TopicPanel.tsx} +23 -20
  29. package/src/app/(main)/chat/(workspace)/_layout/Desktop/index.tsx +35 -0
  30. package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/index.tsx +35 -0
  31. package/src/app/(main)/chat/(workspace)/_layout/Mobile/TopicModal.tsx +26 -0
  32. package/src/app/(main)/chat/(workspace)/_layout/Mobile/index.tsx +21 -0
  33. package/src/app/(main)/chat/(workspace)/_layout/type.ts +7 -0
  34. package/src/app/(main)/chat/{features → (workspace)/features}/PluginTag/index.tsx +2 -0
  35. package/src/app/(main)/chat/{features → (workspace)/features}/SettingButton.tsx +3 -1
  36. package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/index.tsx +5 -6
  37. package/src/app/(main)/chat/{features/TelemetryNotification/index.tsx → (workspace)/features/TelemetryNotification.tsx} +2 -0
  38. package/src/app/(main)/chat/(workspace)/features/useWorkspaceModal.tsx +27 -0
  39. package/src/app/(main)/chat/(workspace)/layout.ts +11 -0
  40. package/src/app/(main)/chat/(workspace)/page.tsx +19 -0
  41. package/src/app/(main)/chat/@session/_layout/Desktop/PanelBody.tsx +22 -0
  42. package/src/app/(main)/chat/{_layout → @session/_layout}/Desktop/SessionHeader.tsx +2 -0
  43. package/src/app/(main)/chat/@session/_layout/Desktop/index.tsx +15 -0
  44. package/src/app/(main)/chat/{(mobile)/features → @session/_layout/Mobile}/SessionHeader.tsx +7 -20
  45. package/src/app/(main)/chat/@session/_layout/Mobile/index.tsx +19 -0
  46. package/src/app/(main)/chat/@session/default.tsx +23 -0
  47. package/src/app/(main)/chat/{components/SessionHydration/index.tsx → @session/features/SessionHydration.tsx} +1 -0
  48. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/DefaultMode.tsx +3 -3
  49. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Inbox/index.tsx +2 -2
  50. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/Item/index.tsx +2 -1
  51. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/index.tsx +3 -4
  52. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/ListItem/index.tsx +12 -10
  53. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/SearchMode.tsx +4 -2
  54. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/index.tsx +2 -0
  55. package/src/app/(main)/chat/{features/SessionSearchBar/index.tsx → @session/features/SessionSearchBar.tsx} +3 -5
  56. package/src/app/(main)/chat/_layout/Desktop/SessionPanel.tsx +79 -0
  57. package/src/app/(main)/chat/_layout/Desktop/index.tsx +11 -7
  58. package/src/app/(main)/chat/_layout/Mobile.tsx +52 -0
  59. package/src/app/(main)/chat/_layout/type.ts +1 -0
  60. package/src/app/(main)/chat/error.tsx +5 -0
  61. package/src/app/(main)/chat/features/Migration/index.tsx +3 -8
  62. package/src/app/(main)/chat/not-found.tsx +3 -0
  63. package/src/app/(main)/chat/settings/_layout/Mobile/Header.tsx +3 -4
  64. package/src/app/(main)/chat/settings/features/HeaderContent.tsx +2 -2
  65. package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +2 -2
  66. package/src/app/(main)/market/@detail/features/Header.tsx +2 -2
  67. package/src/components/Cell/Divider.tsx +2 -2
  68. package/src/components/Cell/index.tsx +2 -2
  69. package/src/components/ModelTag/ModelIcon.tsx +2 -2
  70. package/src/components/StoreHydration/ChatHydration/index.tsx +2 -2
  71. package/src/const/session.ts +2 -0
  72. package/src/const/url.ts +5 -1
  73. package/src/features/ChatInput/ActionBar/Tools/index.tsx +3 -2
  74. package/src/features/ChatInput/STT/browser.tsx +2 -1
  75. package/src/features/ChatInput/STT/openai.tsx +2 -1
  76. package/src/features/ChatInput/useChatInput.ts +2 -1
  77. package/src/features/ChatInput/useSend.ts +2 -1
  78. package/src/features/Conversation/Actions/customAction.ts +9 -0
  79. package/src/features/Conversation/Extras/Assistant.tsx +2 -1
  80. package/src/features/Conversation/Extras/User.tsx +2 -1
  81. package/src/features/Conversation/components/AutoScroll.tsx +1 -1
  82. package/src/features/Conversation/components/ChatItem/index.tsx +22 -12
  83. package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +1 -1
  84. package/src/features/Conversation/components/InboxWelcome/index.tsx +2 -2
  85. package/src/features/Conversation/components/SkeletonList.tsx +21 -8
  86. package/src/features/Conversation/components/VirtualizedList/index.tsx +19 -17
  87. package/src/features/Conversation/index.tsx +12 -31
  88. package/src/features/PluginStore/InstalledPluginList.tsx +28 -21
  89. package/src/features/PluginStore/OnlineList.tsx +4 -10
  90. package/src/features/PluginStore/PluginItem/Action.tsx +3 -2
  91. package/src/features/PluginStore/PluginItem/index.tsx +2 -0
  92. package/src/features/PluginStore/index.tsx +4 -2
  93. package/src/features/User/UserAvatar.tsx +2 -1
  94. package/src/features/User/UserPanel/useMenu.tsx +1 -1
  95. package/src/layout/GlobalProvider/AppTheme.tsx +7 -17
  96. package/src/libs/agent-runtime/openrouter/index.ts +4 -1
  97. package/src/store/chat/slices/message/action.test.ts +52 -2
  98. package/src/store/chat/slices/message/action.ts +40 -13
  99. package/src/store/chat/slices/message/initialState.ts +13 -1
  100. package/src/store/chat/slices/message/selectors.test.ts +1 -1
  101. package/src/store/chat/slices/message/selectors.ts +10 -1
  102. package/src/store/chat/slices/plugin/action.test.ts +10 -2
  103. package/src/store/chat/slices/plugin/action.ts +6 -2
  104. package/src/store/global/action.ts +2 -0
  105. package/src/store/global/initialState.ts +2 -0
  106. package/src/styles/global.ts +12 -9
  107. package/src/styles/mobileHeader.ts +1 -1
  108. package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +0 -27
  109. package/src/app/(main)/(mobile)/me/features/style.ts +0 -29
  110. package/src/app/(main)/chat/(desktop)/features/Conversation.tsx +0 -19
  111. package/src/app/(main)/chat/(desktop)/index.tsx +0 -22
  112. package/src/app/(main)/chat/(mobile)/features/SessionList.tsx +0 -17
  113. package/src/app/(main)/chat/(mobile)/features/TopicList.tsx +0 -29
  114. package/src/app/(main)/chat/(mobile)/index.tsx +0 -26
  115. package/src/app/(main)/chat/(mobile)/mobile/ChatHeader/index.tsx +0 -56
  116. package/src/app/(main)/chat/(mobile)/mobile/page.tsx +0 -26
  117. package/src/app/(main)/chat/_layout/Desktop/SessionList.tsx +0 -39
  118. package/src/app/(main)/chat/_layout/Mobile/index.tsx +0 -9
  119. package/src/app/(main)/chat/page.tsx +0 -25
  120. package/src/features/FolderPanel/index.tsx +0 -60
  121. package/src/utils/screen.ts +0 -14
  122. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/DragUpload.tsx +0 -0
  123. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/LocalFiles.tsx +0 -0
  124. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/SendMore.tsx +0 -0
  125. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Header/index.tsx +0 -0
  126. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/__tests__/useAutoFocus.test.ts +0 -0
  127. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/useAutoFocus.ts +0 -0
  128. /package/src/app/(main)/chat/{(mobile)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Mobile}/Files.tsx +0 -0
  129. /package/src/app/(main)/chat/{(desktop)/features/SideBar → (workspace)/@topic/features}/SystemRole/style.ts +0 -0
  130. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/DefaultContent.tsx +0 -0
  131. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/SkeletonList.tsx +0 -0
  132. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/TopicContent.tsx +0 -0
  133. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/TopicItem.tsx +0 -0
  134. /package/src/app/(main)/chat/{(mobile)/mobile → (workspace)/_layout/Mobile}/ChatHeader/ChatHeaderTitle.tsx +0 -0
  135. /package/src/app/(main)/chat/{features → (workspace)/features}/PluginTag/PluginStatus.tsx +0 -0
  136. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/Preview.tsx +0 -0
  137. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/ShareModal.tsx +0 -0
  138. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/style.ts +0 -0
  139. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/type.ts +0 -0
  140. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/useScreenshot.ts +0 -0
  141. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/CollapseGroup/Actions.tsx +0 -0
  142. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/CollapseGroup/index.tsx +0 -0
  143. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/AddButton.tsx +0 -0
  144. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/Item/Actions.tsx +0 -0
  145. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx +0 -0
  146. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/ConfigGroupModal/index.tsx +0 -0
  147. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/CreateGroupModal.tsx +0 -0
  148. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/RenameGroupModal.tsx +0 -0
  149. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/SkeletonList.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.155.6](https://github.com/lobehub/lobe-chat/compare/v0.155.5...v0.155.6)
6
+
7
+ <sup>Released on **2024-05-08**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix editing long message issue.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix editing long message issue, closes [#2431](https://github.com/lobehub/lobe-chat/issues/2431) ([380d8da](https://github.com/lobehub/lobe-chat/commit/380d8da))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 0.155.5](https://github.com/lobehub/lobe-chat/compare/v0.155.4...v0.155.5)
31
+
32
+ <sup>Released on **2024-05-08**</sup>
33
+
34
+ <br/>
35
+
36
+ <details>
37
+ <summary><kbd>Improvements and Fixes</kbd></summary>
38
+
39
+ </details>
40
+
41
+ <div align="right">
42
+
43
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
44
+
45
+ </div>
46
+
5
47
  ### [Version 0.155.4](https://github.com/lobehub/lobe-chat/compare/v0.155.3...v0.155.4)
6
48
 
7
49
  <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.6",
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;
@@ -13,6 +13,7 @@ import { useSendMessage } from '@/features/ChatInput/useSend';
13
13
  import { useAgentStore } from '@/store/agent';
14
14
  import { agentSelectors } from '@/store/agent/slices/chat';
15
15
  import { useChatStore } from '@/store/chat';
16
+ import { chatSelectors } from '@/store/chat/selectors';
16
17
  import { useUserStore } from '@/store/user';
17
18
  import { modelProviderSelectors, preferenceSelectors } from '@/store/user/selectors';
18
19
  import { isMacOS } from '@/utils/platform';
@@ -60,7 +61,7 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
60
61
  const { theme, styles } = useStyles();
61
62
 
62
63
  const [loading, stopGenerateMessage] = useChatStore((s) => [
63
- !!s.chatLoadingId,
64
+ chatSelectors.isAIGenerating(s),
64
65
  s.stopGenerateMessage,
65
66
  ]);
66
67
 
@@ -195,7 +195,7 @@ describe('<InputArea />', () => {
195
195
  it('does not send message when loading or shift key is pressed', () => {
196
196
  const sendMessageMock = vi.fn();
197
197
  act(() => {
198
- useChatStore.setState({ chatLoadingId: '123', sendMessage: sendMessageMock });
198
+ useChatStore.setState({ chatLoadingIds: ['123'], sendMessage: sendMessageMock });
199
199
  });
200
200
 
201
201
  render(<InputArea setExpand={setExpandMock} />);
@@ -209,7 +209,7 @@ describe('<InputArea />', () => {
209
209
  const sendMessageMock = vi.fn();
210
210
  act(() => {
211
211
  useChatStore.setState({
212
- chatLoadingId: '',
212
+ chatLoadingIds: [],
213
213
  inputMessage: 'abc',
214
214
  sendMessage: sendMessageMock,
215
215
  });
@@ -228,7 +228,7 @@ describe('<InputArea />', () => {
228
228
  const sendMessageMock = vi.fn();
229
229
  act(() => {
230
230
  useChatStore.setState({
231
- chatLoadingId: '',
231
+ chatLoadingIds: [],
232
232
  inputMessage: '123',
233
233
  sendMessage: sendMessageMock,
234
234
  });
@@ -247,7 +247,7 @@ describe('<InputArea />', () => {
247
247
  const updateInputMessageMock = vi.fn();
248
248
  act(() => {
249
249
  useChatStore.setState({
250
- chatLoadingId: '',
250
+ chatLoadingIds: [],
251
251
  inputMessage: 'Test',
252
252
  sendMessage: sendMessageMock,
253
253
  updateInputMessage: updateInputMessageMock,
@@ -271,7 +271,7 @@ describe('<InputArea />', () => {
271
271
  const sendMessageMock = vi.fn();
272
272
  act(() => {
273
273
  useChatStore.setState({
274
- chatLoadingId: '',
274
+ chatLoadingIds: [],
275
275
  inputMessage: '123',
276
276
  sendMessage: sendMessageMock,
277
277
  });
@@ -295,7 +295,7 @@ describe('<InputArea />', () => {
295
295
  const updateInputMessageMock = vi.fn();
296
296
  act(() => {
297
297
  useChatStore.setState({
298
- chatLoadingId: '',
298
+ chatLoadingIds: [],
299
299
  inputMessage: 'Test',
300
300
  sendMessage: sendMessageMock,
301
301
  updateInputMessage: updateInputMessageMock,
@@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next';
6
6
 
7
7
  import { useSendMessage } from '@/features/ChatInput/useSend';
8
8
  import { useChatStore } from '@/store/chat';
9
+ import { chatSelectors } from '@/store/chat/selectors';
9
10
  import { useUserStore } from '@/store/user';
10
11
  import { preferenceSelectors } from '@/store/user/selectors';
11
12
  import { isCommandPressed } from '@/utils/keyboard';
@@ -42,7 +43,7 @@ const InputArea = memo<InputAreaProps>(({ setExpand }) => {
42
43
  const isChineseInput = useRef(false);
43
44
 
44
45
  const [loading, value, updateInputMessage] = useChatStore((s) => [
45
- !!s.chatLoadingId,
46
+ chatSelectors.isAIGenerating(s),
46
47
  s.inputMessage,
47
48
  s.updateInputMessage,
48
49
  ]);
@@ -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';