@lobehub/lobehub 2.0.0-next.95 → 2.0.0-next.97

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 (267) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/apps/desktop/src/preload/index.ts +2 -2
  3. package/apps/desktop/src/preload/invoke.ts +1 -1
  4. package/apps/desktop/src/preload/routeInterceptor.ts +41 -41
  5. package/changelog/v1.json +18 -0
  6. package/locales/ar/common.json +21 -0
  7. package/locales/ar/hotkey.json +4 -0
  8. package/locales/ar/models.json +6 -0
  9. package/locales/bg-BG/common.json +21 -0
  10. package/locales/bg-BG/hotkey.json +4 -0
  11. package/locales/bg-BG/models.json +6 -0
  12. package/locales/de-DE/common.json +21 -0
  13. package/locales/de-DE/hotkey.json +4 -0
  14. package/locales/de-DE/models.json +6 -0
  15. package/locales/en-US/common.json +21 -0
  16. package/locales/en-US/hotkey.json +4 -0
  17. package/locales/en-US/models.json +6 -0
  18. package/locales/es-ES/common.json +21 -0
  19. package/locales/es-ES/hotkey.json +4 -0
  20. package/locales/es-ES/models.json +6 -0
  21. package/locales/fa-IR/common.json +21 -0
  22. package/locales/fa-IR/hotkey.json +4 -0
  23. package/locales/fa-IR/models.json +6 -0
  24. package/locales/fr-FR/common.json +21 -0
  25. package/locales/fr-FR/hotkey.json +4 -0
  26. package/locales/fr-FR/models.json +6 -0
  27. package/locales/it-IT/common.json +21 -0
  28. package/locales/it-IT/hotkey.json +4 -0
  29. package/locales/it-IT/models.json +6 -0
  30. package/locales/ja-JP/common.json +21 -0
  31. package/locales/ja-JP/hotkey.json +4 -0
  32. package/locales/ja-JP/models.json +6 -0
  33. package/locales/ko-KR/common.json +21 -0
  34. package/locales/ko-KR/hotkey.json +4 -0
  35. package/locales/ko-KR/models.json +6 -0
  36. package/locales/nl-NL/common.json +21 -0
  37. package/locales/nl-NL/hotkey.json +4 -0
  38. package/locales/nl-NL/models.json +6 -0
  39. package/locales/pl-PL/common.json +21 -0
  40. package/locales/pl-PL/hotkey.json +4 -0
  41. package/locales/pl-PL/models.json +6 -0
  42. package/locales/pt-BR/common.json +21 -0
  43. package/locales/pt-BR/hotkey.json +4 -0
  44. package/locales/pt-BR/models.json +6 -0
  45. package/locales/ru-RU/common.json +21 -0
  46. package/locales/ru-RU/hotkey.json +4 -0
  47. package/locales/ru-RU/models.json +6 -0
  48. package/locales/tr-TR/common.json +21 -0
  49. package/locales/tr-TR/hotkey.json +4 -0
  50. package/locales/tr-TR/models.json +6 -0
  51. package/locales/vi-VN/common.json +21 -0
  52. package/locales/vi-VN/hotkey.json +4 -0
  53. package/locales/vi-VN/models.json +6 -0
  54. package/locales/zh-CN/common.json +21 -0
  55. package/locales/zh-CN/hotkey.json +4 -0
  56. package/locales/zh-CN/models.json +6 -0
  57. package/locales/zh-TW/common.json +21 -0
  58. package/locales/zh-TW/hotkey.json +4 -0
  59. package/locales/zh-TW/models.json +6 -0
  60. package/package.json +3 -1
  61. package/packages/const/src/hotkeys.ts +6 -0
  62. package/packages/conversation-flow/src/__tests__/indexing.test.ts +513 -0
  63. package/packages/conversation-flow/src/__tests__/structuring.test.ts +600 -0
  64. package/packages/database/src/client/db.ts +12 -12
  65. package/packages/database/src/repositories/dataImporter/index.ts +10 -10
  66. package/packages/database/src/schemas/topic.ts +1 -1
  67. package/packages/database/src/server/models/ragEval/evaluation.ts +1 -1
  68. package/packages/types/src/hotkey.ts +1 -0
  69. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/ClassicChat.tsx +1 -1
  70. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/GroupChat.tsx +1 -1
  71. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/ChatItem/index.tsx +1 -1
  72. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/Content.tsx +2 -2
  73. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/index.tsx +1 -1
  74. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatMinimap/index.tsx +1 -1
  75. package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +41 -8
  76. package/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx +6 -4
  77. package/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/index.tsx +16 -4
  78. package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +15 -3
  79. package/src/app/[variants]/(main)/settings/provider/detail/index.tsx +23 -15
  80. package/src/components/InvalidAPIKey/APIKeyForm/Bedrock.tsx +1 -1
  81. package/src/components/InvalidAPIKey/APIKeyForm/ComfyUIForm.tsx +1 -1
  82. package/src/components/InvalidAPIKey/APIKeyForm/ProviderApiKeyForm.tsx +1 -1
  83. package/src/components/InvalidAPIKey/APIKeyForm/__tests__/ComfyUIForm.test.tsx +1 -1
  84. package/src/components/InvalidAPIKey/index.tsx +1 -1
  85. package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/getNodeContent.test.ts +1 -2
  86. package/src/features/{Conversation → ChatList}/Messages/Assistant/Actions/index.tsx +2 -2
  87. package/src/features/{Conversation → ChatList}/Messages/Assistant/Extra/index.test.tsx +3 -3
  88. package/src/features/{Conversation → ChatList}/Messages/Assistant/Extra/index.tsx +6 -5
  89. package/src/features/{Conversation → ChatList}/Messages/Assistant/MessageContent.tsx +1 -1
  90. package/src/features/{Conversation → ChatList}/Messages/Group/Actions/WithContentId.tsx +2 -2
  91. package/src/features/{Conversation → ChatList}/Messages/Group/ContentBlock.tsx +2 -2
  92. package/src/features/{Conversation → ChatList}/Messages/Group/Error/index.tsx +2 -1
  93. package/src/features/{Conversation → ChatList}/Messages/Group/Group.tsx +1 -1
  94. package/src/features/{Conversation → ChatList}/Messages/Group/GroupItem.tsx +3 -2
  95. package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/ApprovalActions.tsx +1 -1
  96. package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/index.tsx +1 -2
  97. package/src/features/{Conversation → ChatList}/Messages/Group/index.tsx +1 -1
  98. package/src/features/{Conversation → ChatList}/Messages/User/Extra.tsx +3 -3
  99. package/src/features/{Conversation → ChatList}/Messages/User/index.tsx +1 -1
  100. package/src/features/{Conversation → ChatList}/Messages/index.tsx +1 -1
  101. package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/Preview.tsx +1 -1
  102. package/src/features/{Conversation → ChatList}/components/SkeletonList.tsx +1 -1
  103. package/src/features/{Conversation → ChatList}/components/VirtualizedList/index.tsx +1 -1
  104. package/src/features/OllamaSetupGuide/index.tsx +1 -1
  105. package/src/features/PluginsUI/Render/MCPType/index.tsx +1 -1
  106. package/src/features/Portal/GroupThread/Body/ThreadChatItem.tsx +1 -1
  107. package/src/features/Portal/GroupThread/Body/ThreadChatList.tsx +1 -1
  108. package/src/features/Portal/Thread/Chat/ChatInput/index.tsx +1 -1
  109. package/src/features/Portal/Thread/Chat/ChatItem.tsx +1 -1
  110. package/src/features/Portal/Thread/Chat/ChatList.tsx +1 -1
  111. package/src/features/Portal/Thread/Chat/index.tsx +1 -1
  112. package/src/features/ShareModal/ShareImage/ChatList/index.tsx +1 -1
  113. package/src/layout/GlobalProvider/Cmdk.tsx +470 -0
  114. package/src/layout/GlobalProvider/CmdkLazy.tsx +17 -0
  115. package/src/layout/GlobalProvider/index.tsx +2 -0
  116. package/src/locales/default/common.ts +21 -0
  117. package/src/locales/default/hotkey.ts +4 -0
  118. package/src/services/debug.ts +4 -4
  119. package/src/services/electron/remoteServer.ts +5 -5
  120. package/src/services/electron/settings.ts +6 -6
  121. package/src/services/mcp.ts +18 -18
  122. package/src/services/models.ts +20 -20
  123. /package/src/features/{Conversation → ChatList}/Error/AccessCodeForm.tsx +0 -0
  124. /package/src/features/{Conversation → ChatList}/Error/ChatInvalidApiKey.tsx +0 -0
  125. /package/src/features/{Conversation → ChatList}/Error/ClerkLogin/index.tsx +0 -0
  126. /package/src/features/{Conversation → ChatList}/Error/ErrorJsonViewer.tsx +0 -0
  127. /package/src/features/{Conversation → ChatList}/Error/OAuthForm.tsx +0 -0
  128. /package/src/features/{Conversation → ChatList}/Error/OllamaBizError/InvalidOllamaModel.tsx +0 -0
  129. /package/src/features/{Conversation → ChatList}/Error/OllamaBizError/index.tsx +0 -0
  130. /package/src/features/{Conversation → ChatList}/Error/index.tsx +0 -0
  131. /package/src/features/{Conversation → ChatList}/Error/style.tsx +0 -0
  132. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/Render/Icon.tsx +0 -0
  133. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/Render/index.tsx +0 -0
  134. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/index.ts +0 -0
  135. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/rehypePlugin.test.ts +0 -0
  136. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/rehypePlugin.ts +0 -0
  137. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeThinking/Render.tsx +0 -0
  138. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeThinking/index.ts +0 -0
  139. /package/src/features/{Conversation → ChatList}/MarkdownElements/LocalFile/Render/index.tsx +0 -0
  140. /package/src/features/{Conversation → ChatList}/MarkdownElements/LocalFile/index.ts +0 -0
  141. /package/src/features/{Conversation → ChatList}/MarkdownElements/Mention/Render.tsx +0 -0
  142. /package/src/features/{Conversation → ChatList}/MarkdownElements/Mention/index.ts +0 -0
  143. /package/src/features/{Conversation → ChatList}/MarkdownElements/Thinking/Render.tsx +0 -0
  144. /package/src/features/{Conversation → ChatList}/MarkdownElements/Thinking/index.ts +0 -0
  145. /package/src/features/{Conversation → ChatList}/MarkdownElements/index.ts +0 -0
  146. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/__snapshots__/createRemarkSelfClosingTagPlugin.test.ts.snap +0 -0
  147. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkCustomTagPlugin.ts +0 -0
  148. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkCustomTagWithAttributesPlugin.ts +0 -0
  149. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkSelfClosingTagPlugin.test.ts +0 -0
  150. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkSelfClosingTagPlugin.ts +0 -0
  151. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/getNodeContent.ts +0 -0
  152. /package/src/features/{Conversation → ChatList}/MarkdownElements/type.ts +0 -0
  153. /package/src/features/{Conversation → ChatList}/MarkdownElements/utils.ts +0 -0
  154. /package/src/features/{Conversation → ChatList}/Messages/Assistant/Actions/Error.tsx +0 -0
  155. /package/src/features/{Conversation → ChatList}/Messages/Assistant/CollapsedMessage.tsx +0 -0
  156. /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/Item/index.tsx +0 -0
  157. /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/Item/style.ts +0 -0
  158. /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/index.tsx +0 -0
  159. /package/src/features/{Conversation → ChatList}/Messages/Assistant/IntentUnderstanding.tsx +0 -0
  160. /package/src/features/{Conversation → ChatList}/Messages/Assistant/Reasoning/index.tsx +0 -0
  161. /package/src/features/{Conversation → ChatList}/Messages/Assistant/SearchGrounding.tsx +0 -0
  162. /package/src/features/{Conversation → ChatList}/Messages/Assistant/index.tsx +0 -0
  163. /package/src/features/{Conversation → ChatList}/Messages/Default.tsx +0 -0
  164. /package/src/features/{Conversation → ChatList}/Messages/Group/Actions/WithoutContentId.tsx +0 -0
  165. /package/src/features/{Conversation → ChatList}/Messages/Group/Actions/index.tsx +0 -0
  166. /package/src/features/{Conversation → ChatList}/Messages/Group/CollapsedMessage.tsx +0 -0
  167. /package/src/features/{Conversation → ChatList}/Messages/Group/EditState.tsx +0 -0
  168. /package/src/features/{Conversation → ChatList}/Messages/Group/GroupContext.ts +0 -0
  169. /package/src/features/{Conversation → ChatList}/Messages/Group/MessageContent.tsx +0 -0
  170. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/BuiltinPluginTitle.tsx +0 -0
  171. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/Debug.tsx +0 -0
  172. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/PluginResult.tsx +0 -0
  173. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/PluginState.tsx +0 -0
  174. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/Settings.tsx +0 -0
  175. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/StatusIndicator.tsx +0 -0
  176. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/ToolTitle.tsx +0 -0
  177. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/index.tsx +0 -0
  178. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/AbortResponse.tsx +0 -0
  179. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/ObjectEntity.tsx +0 -0
  180. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/ValueCell.tsx +0 -0
  181. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/index.tsx +0 -0
  182. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/CustomRender.tsx +0 -0
  183. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/ErrorResponse.tsx +0 -0
  184. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/Fallback.tsx +0 -0
  185. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/KeyValueEditor.tsx +0 -0
  186. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/ModeSelector.tsx +0 -0
  187. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/index.tsx +0 -0
  188. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/LoadingPlaceholder/index.tsx +0 -0
  189. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/PluginSettings.tsx +0 -0
  190. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/RejectedResponse.tsx +0 -0
  191. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/index.tsx +0 -0
  192. /package/src/features/{Conversation → ChatList}/Messages/Group/Tools.tsx +0 -0
  193. /package/src/features/{Conversation → ChatList}/Messages/Supervisor/TodoList.tsx +0 -0
  194. /package/src/features/{Conversation → ChatList}/Messages/Supervisor/index.tsx +0 -0
  195. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/BuiltinPluginTitle.tsx +0 -0
  196. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/Debug.tsx +0 -0
  197. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/PluginResult.tsx +0 -0
  198. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/PluginState.tsx +0 -0
  199. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/Settings.tsx +0 -0
  200. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/ToolTitle.tsx +0 -0
  201. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/index.tsx +0 -0
  202. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/ObjectEntity.tsx +0 -0
  203. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/ValueCell.tsx +0 -0
  204. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/index.tsx +0 -0
  205. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/CustomRender.tsx +0 -0
  206. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/ErrorResponse.tsx +0 -0
  207. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/KeyValueEditor.tsx +0 -0
  208. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/PluginSettings.tsx +0 -0
  209. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/index.tsx +0 -0
  210. /package/src/features/{Conversation → ChatList}/Messages/Tool/ToolItem.tsx +0 -0
  211. /package/src/features/{Conversation → ChatList}/Messages/Tool/index.tsx +0 -0
  212. /package/src/features/{Conversation → ChatList}/Messages/User/Actions/ActionsBar.tsx +0 -0
  213. /package/src/features/{Conversation → ChatList}/Messages/User/Actions/MessageBranch.tsx +0 -0
  214. /package/src/features/{Conversation → ChatList}/Messages/User/Actions/index.tsx +0 -0
  215. /package/src/features/{Conversation → ChatList}/Messages/User/BelowMessage.tsx +0 -0
  216. /package/src/features/{Conversation → ChatList}/Messages/User/FileListViewer/Item.tsx +0 -0
  217. /package/src/features/{Conversation → ChatList}/Messages/User/FileListViewer/index.tsx +0 -0
  218. /package/src/features/{Conversation → ChatList}/Messages/User/ImageFileListViewer.tsx +0 -0
  219. /package/src/features/{Conversation → ChatList}/Messages/User/MarkdownRender/ContentPreview.tsx +0 -0
  220. /package/src/features/{Conversation → ChatList}/Messages/User/MarkdownRender/index.tsx +0 -0
  221. /package/src/features/{Conversation → ChatList}/Messages/User/MessageContent.tsx +0 -0
  222. /package/src/features/{Conversation → ChatList}/Messages/User/VideoFileListViewer.tsx +0 -0
  223. /package/src/features/{Conversation → ChatList}/components/AutoScroll.tsx +0 -0
  224. /package/src/features/{Conversation → ChatList}/components/BackBottom/index.tsx +0 -0
  225. /package/src/features/{Conversation → ChatList}/components/BackBottom/style.ts +0 -0
  226. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/PdfPreview.tsx +0 -0
  227. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/index.tsx +0 -0
  228. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/style.ts +0 -0
  229. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/template.ts +0 -0
  230. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/usePdfGeneration.ts +0 -0
  231. /package/src/features/{Conversation → ChatList}/components/Extras/ExtraContainer.tsx +0 -0
  232. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/FilePlayer.tsx +0 -0
  233. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/InitPlayer.tsx +0 -0
  234. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/Player.tsx +0 -0
  235. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/index.tsx +0 -0
  236. /package/src/features/{Conversation → ChatList}/components/Extras/Translate.tsx +0 -0
  237. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/AnimatedNumber.tsx +0 -0
  238. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/ModelCard.tsx +0 -0
  239. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/TokenProgress.tsx +0 -0
  240. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/index.tsx +0 -0
  241. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/pricing.ts +0 -0
  242. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/tokens.test.ts +0 -0
  243. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/tokens.ts +0 -0
  244. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/index.tsx +0 -0
  245. /package/src/features/{Conversation → ChatList}/components/History/HistoryDivider.tsx +0 -0
  246. /package/src/features/{Conversation → ChatList}/components/History/index.tsx +0 -0
  247. /package/src/features/{Conversation → ChatList}/components/OTPInput.tsx +0 -0
  248. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/index.tsx +0 -0
  249. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/style.ts +0 -0
  250. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/type.ts +0 -0
  251. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/Preview.tsx +0 -0
  252. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/index.tsx +0 -0
  253. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/template.test.ts +0 -0
  254. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/template.ts +0 -0
  255. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/type.ts +0 -0
  256. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/index.tsx +0 -0
  257. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/style.ts +0 -0
  258. /package/src/features/{Conversation → ChatList}/components/ThreadDivider/index.tsx +0 -0
  259. /package/src/features/{Conversation → ChatList}/components/VirtualizedList/VirtuosoContext.ts +0 -0
  260. /package/src/features/{Conversation → ChatList}/components/WideScreenContainer/index.tsx +0 -0
  261. /package/src/features/{Conversation → ChatList}/context/InPortalThreadContext.ts +0 -0
  262. /package/src/features/{Conversation → ChatList}/hooks/useChatListActionsBar.tsx +0 -0
  263. /package/src/features/{Conversation → ChatList}/hooks/useDoubleClickEdit.ts +0 -0
  264. /package/src/features/{Conversation → ChatList}/index.ts +0 -0
  265. /package/src/features/{Conversation → ChatList}/types/index.ts +0 -0
  266. /package/src/features/{Conversation → ChatList}/utils/markdown.test.ts +0 -0
  267. /package/src/features/{Conversation → ChatList}/utils/markdown.ts +0 -0
@@ -9,7 +9,6 @@ import { Flexbox } from 'react-layout-kit';
9
9
  import Avatar from '@/features/ChatItem/components/Avatar';
10
10
  import BorderSpacing from '@/features/ChatItem/components/BorderSpacing';
11
11
  import Title from '@/features/ChatItem/components/Title';
12
- import Usage from '@/features/Conversation/components/Extras/Usage';
13
12
  import { useOpenChatSettings } from '@/hooks/useInterceptingRoutes';
14
13
  import { useAgentStore } from '@/store/agent';
15
14
  import { agentChatConfigSelectors } from '@/store/agent/selectors';
@@ -19,6 +18,7 @@ import { useGlobalStore } from '@/store/global';
19
18
  import { useSessionStore } from '@/store/session';
20
19
  import { sessionSelectors } from '@/store/session/selectors';
21
20
 
21
+ import Usage from '../../components/Extras/Usage';
22
22
  import { GroupActionsBar } from './Actions';
23
23
  import EditState from './EditState';
24
24
  import Group from './Group';
@@ -1,9 +1,9 @@
1
1
  import { memo } from 'react';
2
2
  import { Flexbox } from 'react-layout-kit';
3
3
 
4
- import ExtraContainer from '@/features/Conversation/components/Extras/ExtraContainer';
5
- import TTS from '@/features/Conversation/components/Extras/TTS';
6
- import Translate from '@/features/Conversation/components/Extras/Translate';
4
+ import ExtraContainer from '@/features/ChatList/components/Extras/ExtraContainer';
5
+ import TTS from '@/features/ChatList/components/Extras/TTS';
6
+ import Translate from '@/features/ChatList/components/Extras/Translate';
7
7
  import { useChatStore } from '@/store/chat';
8
8
  import { messageStateSelectors } from '@/store/chat/selectors';
9
9
 
@@ -11,7 +11,7 @@ import BorderSpacing from '@/features/ChatItem/components/BorderSpacing';
11
11
  import MessageContent from '@/features/ChatItem/components/MessageContent';
12
12
  import Title from '@/features/ChatItem/components/Title';
13
13
  import { useStyles } from '@/features/ChatItem/style';
14
- import { markdownElements } from '@/features/Conversation/MarkdownElements';
14
+ import { markdownElements } from '@/features/ChatList/MarkdownElements';
15
15
  import { useUserAvatar } from '@/hooks/useUserAvatar';
16
16
  import { useAgentStore } from '@/store/agent';
17
17
  import { agentChatConfigSelectors } from '@/store/agent/selectors';
@@ -9,7 +9,7 @@ import { Flexbox } from 'react-layout-kit';
9
9
  import {
10
10
  removeVirtuaVisibleItem,
11
11
  upsertVirtuaVisibleItem,
12
- } from '@/features/Conversation/components/VirtualizedList/VirtuosoContext';
12
+ } from '@/features/ChatList/components/VirtualizedList/VirtuosoContext';
13
13
  import { getChatStoreState, useChatStore } from '@/store/chat';
14
14
  import { displayMessageSelectors, messageStateSelectors } from '@/store/chat/selectors';
15
15
 
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
8
8
  import { Flexbox } from 'react-layout-kit';
9
9
 
10
10
  import { ProductLogo } from '@/components/Branding';
11
- import { ChatItem } from '@/features/Conversation';
11
+ import { ChatItem } from '@/features/ChatList';
12
12
  import PluginTag from '@/features/PluginTag';
13
13
  import { useAgentStore } from '@/store/agent';
14
14
  import { agentSelectors } from '@/store/agent/selectors';
@@ -4,7 +4,7 @@ import { Skeleton } from 'antd';
4
4
  import { createStyles } from 'antd-style';
5
5
  import { memo } from 'react';
6
6
 
7
- import WideScreenContainer from '@/features/Conversation/components/WideScreenContainer';
7
+ import WideScreenContainer from '@/features/ChatList/components/WideScreenContainer';
8
8
 
9
9
  const useStyles = createStyles(({ css, prefixCls }) => ({
10
10
  message: css`
@@ -4,7 +4,7 @@ import isEqual from 'fast-deep-equal';
4
4
  import { ReactNode, memo, useCallback, useEffect, useRef, useState } from 'react';
5
5
  import { VList, VListHandle } from 'virtua';
6
6
 
7
- import WideScreenContainer from '@/features/Conversation/components/WideScreenContainer';
7
+ import WideScreenContainer from '@/features/ChatList/components/WideScreenContainer';
8
8
  import { useChatStore } from '@/store/chat';
9
9
  import { displayMessageSelectors } from '@/store/chat/selectors';
10
10
 
@@ -2,7 +2,7 @@ import { memo } from 'react';
2
2
 
3
3
  import OllamaSetupGuide from '@/components/OllamaSetupGuide';
4
4
  import { isDesktop } from '@/const/version';
5
- import { ErrorActionContainer } from '@/features/Conversation/Error/style';
5
+ import { ErrorActionContainer } from '@/features/ChatList/Error/style';
6
6
 
7
7
  import OllamaDesktopSetupGuide from './Desktop';
8
8
 
@@ -2,7 +2,7 @@ import { Image, Markdown } from '@lobehub/ui';
2
2
  import { memo } from 'react';
3
3
  import { Flexbox } from 'react-layout-kit';
4
4
 
5
- import Arguments from '@/features/Conversation/Messages/Group/Tool/Render/Arguments';
5
+ import Arguments from '@/features/ChatList/Messages/Group/Tool/Render/Arguments';
6
6
  import { ToolCallResult } from '@/libs/mcp';
7
7
 
8
8
  export interface MCPTypeProps {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { memo } from 'react';
4
4
 
5
- import { ChatItem } from '@/features/Conversation';
5
+ import { ChatItem } from '@/features/ChatList';
6
6
 
7
7
  export interface ThreadChatItemProps {
8
8
  id: string;
@@ -3,7 +3,7 @@
3
3
  import React, { memo, useCallback } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
 
6
- import { SkeletonList, VirtualizedList } from '@/features/Conversation';
6
+ import { SkeletonList, VirtualizedList } from '@/features/ChatList';
7
7
  import { useChatStore } from '@/store/chat';
8
8
  import { chatSelectors } from '@/store/chat/selectors';
9
9
  import { useChatGroupStore } from '@/store/chatGroup';
@@ -7,7 +7,7 @@ import { Trans } from 'react-i18next';
7
7
  import { Flexbox } from 'react-layout-kit';
8
8
 
9
9
  import { type ActionKeys, ChatInputProvider, DesktopChatInput } from '@/features/ChatInput';
10
- import WideScreenContainer from '@/features/Conversation/components/WideScreenContainer';
10
+ import WideScreenContainer from '@/features/ChatList/components/WideScreenContainer';
11
11
  import { useChatStore } from '@/store/chat';
12
12
  import { useGlobalStore } from '@/store/global';
13
13
  import { systemStatusSelectors } from '@/store/global/selectors';
@@ -1,6 +1,6 @@
1
1
  import React, { memo, useMemo } from 'react';
2
2
 
3
- import { ChatItem } from '@/features/Conversation';
3
+ import { ChatItem } from '@/features/ChatList';
4
4
  import { useAgentStore } from '@/store/agent';
5
5
  import { agentChatConfigSelectors } from '@/store/agent/selectors';
6
6
  import { useChatStore } from '@/store/chat';
@@ -1,7 +1,7 @@
1
1
  import React, { memo, useCallback } from 'react';
2
2
  import { Flexbox } from 'react-layout-kit';
3
3
 
4
- import { SkeletonList, VirtualizedList } from '@/features/Conversation';
4
+ import { SkeletonList, VirtualizedList } from '@/features/ChatList';
5
5
  import { useFetchThreads } from '@/hooks/useFetchThreads';
6
6
  import { useChatStore } from '@/store/chat';
7
7
  import { threadSelectors } from '@/store/chat/selectors';
@@ -1,7 +1,7 @@
1
1
  import { Suspense, memo } from 'react';
2
2
  import { Flexbox } from 'react-layout-kit';
3
3
 
4
- import { SkeletonList } from '@/features/Conversation';
4
+ import { SkeletonList } from '@/features/ChatList';
5
5
 
6
6
  import ChatInput from './ChatInput';
7
7
  import ChatList from './ChatList';
@@ -1,7 +1,7 @@
1
1
  import { memo } from 'react';
2
2
  import { Flexbox } from 'react-layout-kit';
3
3
 
4
- import { ChatItem } from '@/features/Conversation';
4
+ import { ChatItem } from '@/features/ChatList';
5
5
  import { useChatStore } from '@/store/chat';
6
6
  import { chatSelectors } from '@/store/chat/selectors';
7
7
 
@@ -0,0 +1,470 @@
1
+ 'use client';
2
+
3
+ import { Tag } from '@lobehub/ui';
4
+ import { createStyles } from 'antd-style';
5
+ import { Command } from 'cmdk';
6
+ import {
7
+ ArrowLeft,
8
+ ArrowUpDown,
9
+ BookOpen,
10
+ Bot,
11
+ Compass,
12
+ CornerDownLeft,
13
+ Github,
14
+ MessageCircle,
15
+ Monitor,
16
+ Moon,
17
+ Palette,
18
+ Settings,
19
+ Star,
20
+ Sun,
21
+ } from 'lucide-react';
22
+ import { usePathname, useRouter } from 'next/navigation';
23
+ import { memo, useEffect, useState } from 'react';
24
+ import { createPortal } from 'react-dom';
25
+ import { useTranslation } from 'react-i18next';
26
+
27
+ import { useHotkeyById } from '@/hooks/useHotkeys/useHotkeyById';
28
+ import { useGlobalStore } from '@/store/global';
29
+ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
30
+ import { useSessionStore } from '@/store/session';
31
+ import { HotkeyEnum } from '@/types/hotkey';
32
+
33
+ const useStyles = createStyles(({ css, token }) => ({
34
+ backTag: css`
35
+ cursor: pointer;
36
+
37
+ &:hover {
38
+ opacity: 0.8;
39
+ }
40
+ `,
41
+ commandFooter: css`
42
+ display: flex;
43
+ gap: 16px;
44
+ align-items: center;
45
+ justify-content: flex-end;
46
+
47
+ padding-block: 8px;
48
+ padding-inline: 16px;
49
+ border-block-start: 1px solid ${token.colorBorderSecondary};
50
+
51
+ background: ${token.colorBgContainer};
52
+ `,
53
+ commandRoot: css`
54
+ overflow: hidden;
55
+ display: flex;
56
+ flex-direction: column;
57
+
58
+ width: min(640px, 90vw);
59
+ max-height: min(500px, 70vh);
60
+ border-radius: ${token.borderRadiusLG}px;
61
+
62
+ background: ${token.colorBgElevated};
63
+ box-shadow: ${token.boxShadowSecondary};
64
+
65
+ animation: slide-down 0.12s ease-out;
66
+
67
+ @keyframes slide-down {
68
+ from {
69
+ transform: translateY(-20px) scale(0.96);
70
+ opacity: 0;
71
+ }
72
+
73
+ to {
74
+ transform: translateY(0) scale(1);
75
+ opacity: 1;
76
+ }
77
+ }
78
+
79
+ [cmdk-input] {
80
+ flex: 1;
81
+
82
+ min-width: 0;
83
+ padding: 0;
84
+ border: none;
85
+
86
+ font-family: inherit;
87
+ font-size: 16px;
88
+ color: ${token.colorText};
89
+
90
+ background: transparent;
91
+ outline: none;
92
+
93
+ &::placeholder {
94
+ color: ${token.colorTextPlaceholder};
95
+ }
96
+ }
97
+
98
+ [cmdk-list] {
99
+ overflow-y: auto;
100
+ max-height: 400px;
101
+ padding: 8px;
102
+ }
103
+
104
+ [cmdk-empty] {
105
+ padding-block: 32px;
106
+ padding-inline: 16px;
107
+
108
+ font-size: 14px;
109
+ color: ${token.colorTextTertiary};
110
+ text-align: center;
111
+ }
112
+
113
+ [cmdk-item] {
114
+ cursor: pointer;
115
+ user-select: none;
116
+
117
+ display: flex;
118
+ gap: 12px;
119
+ align-items: center;
120
+
121
+ padding-block: 12px;
122
+ padding-inline: 16px;
123
+ border-radius: ${token.borderRadius}px;
124
+
125
+ color: ${token.colorText};
126
+
127
+ transition: all 0.15s ease;
128
+
129
+ &[aria-selected='true'] {
130
+ background: ${token.colorBgTextHover};
131
+ }
132
+
133
+ &:hover {
134
+ background: ${token.colorBgTextHover};
135
+ }
136
+ }
137
+
138
+ [cmdk-group-heading] {
139
+ user-select: none;
140
+
141
+ padding-block: 8px;
142
+ padding-inline: 16px;
143
+
144
+ font-size: 12px;
145
+ font-weight: 500;
146
+ color: ${token.colorTextSecondary};
147
+ }
148
+
149
+ [cmdk-separator] {
150
+ height: 1px;
151
+ margin-block: 4px;
152
+ background: ${token.colorBorderSecondary};
153
+ }
154
+ `,
155
+ icon: css`
156
+ flex-shrink: 0;
157
+ width: 20px;
158
+ height: 20px;
159
+ color: ${token.colorTextSecondary};
160
+ `,
161
+ inputWrapper: css`
162
+ display: flex;
163
+ gap: 8px;
164
+ align-items: center;
165
+
166
+ padding: 16px;
167
+ border-block-end: 1px solid ${token.colorBorderSecondary};
168
+ `,
169
+ itemContent: css`
170
+ flex: 1;
171
+ min-width: 0;
172
+ `,
173
+ itemDescription: css`
174
+ margin-block-start: 2px;
175
+ font-size: 12px;
176
+ line-height: 1.4;
177
+ color: ${token.colorTextTertiary};
178
+ `,
179
+ itemLabel: css`
180
+ font-size: 14px;
181
+ font-weight: 500;
182
+ line-height: 1.4;
183
+ `,
184
+ kbd: css`
185
+ display: inline-flex;
186
+ gap: 4px;
187
+ align-items: center;
188
+
189
+ padding-block: 2px;
190
+ padding-inline: 6px;
191
+ border-radius: ${token.borderRadiusSM}px;
192
+
193
+ font-size: 11px;
194
+ font-weight: 500;
195
+ line-height: 1.2;
196
+ color: ${token.colorTextSecondary};
197
+
198
+ background: ${token.colorFillQuaternary};
199
+ `,
200
+ kbdIcon: css`
201
+ width: 12px;
202
+ height: 12px;
203
+ `,
204
+ overlay: css`
205
+ position: fixed;
206
+ z-index: 9999;
207
+ inset: 0;
208
+
209
+ display: flex;
210
+ justify-content: center;
211
+
212
+ padding-block-start: 15vh;
213
+
214
+ background: ${token.colorBgMask};
215
+
216
+ animation: fade-in 0.1s ease-in-out;
217
+
218
+ @keyframes fade-in {
219
+ from {
220
+ opacity: 0;
221
+ }
222
+
223
+ to {
224
+ opacity: 1;
225
+ }
226
+ }
227
+ `,
228
+ }));
229
+
230
+ const Cmdk = memo(() => {
231
+ const [open, setOpen] = useState(false);
232
+ const [mounted, setMounted] = useState(false);
233
+ const [search, setSearch] = useState('');
234
+ const [pages, setPages] = useState<string[]>([]);
235
+ const router = useRouter();
236
+ const pathname = usePathname();
237
+ const { t } = useTranslation('common');
238
+ const { styles } = useStyles();
239
+ const switchThemeMode = useGlobalStore((s) => s.switchThemeMode);
240
+ const createSession = useSessionStore((s) => s.createSession);
241
+ const { showCreateSession } = useServerConfigStore(featureFlagsSelectors);
242
+
243
+ const page = pages.at(-1);
244
+
245
+ // Ensure we're mounted on the client
246
+ useEffect(() => {
247
+ setMounted(true);
248
+ }, []);
249
+
250
+ // Register Cmd+K / Ctrl+K hotkey
251
+ useHotkeyById(HotkeyEnum.CommandPalette, () => {
252
+ setOpen((prev) => !prev);
253
+ });
254
+
255
+ // Close on Escape key and prevent body scroll
256
+ useEffect(() => {
257
+ if (open) {
258
+ const originalStyle = window.getComputedStyle(document.body).overflow;
259
+ document.body.style.overflow = 'hidden';
260
+
261
+ return () => {
262
+ document.body.style.overflow = originalStyle;
263
+ };
264
+ }
265
+ }, [open]);
266
+
267
+ // Reset pages and search when opening/closing
268
+ useEffect(() => {
269
+ if (open) {
270
+ setPages([]);
271
+ setSearch('');
272
+ }
273
+ }, [open]);
274
+
275
+ const handleNavigate = (path: string) => {
276
+ router.push(path);
277
+ setOpen(false);
278
+ };
279
+
280
+ const handleExternalLink = (url: string) => {
281
+ window.open(url, '_blank', 'noopener,noreferrer');
282
+ setOpen(false);
283
+ };
284
+
285
+ const handleThemeChange = (theme: 'light' | 'dark' | 'auto') => {
286
+ switchThemeMode(theme);
287
+ setOpen(false);
288
+ };
289
+
290
+ if (!mounted || !open) return null;
291
+
292
+ return createPortal(
293
+ <div className={styles.overlay} onClick={() => setOpen(false)}>
294
+ <div onClick={(e) => e.stopPropagation()}>
295
+ <Command
296
+ className={styles.commandRoot}
297
+ onKeyDown={(e) => {
298
+ // Escape goes to previous page or closes
299
+ if (e.key === 'Escape') {
300
+ e.preventDefault();
301
+ if (pages.length > 0) {
302
+ setPages((prev) => prev.slice(0, -1));
303
+ } else {
304
+ setOpen(false);
305
+ }
306
+ }
307
+ // Backspace goes to previous page when search is empty
308
+ if (e.key === 'Backspace' && !search && pages.length > 0) {
309
+ e.preventDefault();
310
+ setPages((prev) => prev.slice(0, -1));
311
+ }
312
+ }}
313
+ shouldFilter={true}
314
+ >
315
+ <div className={styles.inputWrapper}>
316
+ {pages.length > 0 && (
317
+ <Tag
318
+ className={styles.backTag}
319
+ icon={<ArrowLeft size={12} />}
320
+ onClick={() => setPages((prev) => prev.slice(0, -1))}
321
+ />
322
+ )}
323
+ <Command.Input
324
+ autoFocus
325
+ onValueChange={setSearch}
326
+ placeholder={t('cmdk.searchPlaceholder')}
327
+ value={search}
328
+ />
329
+ <Tag>ESC</Tag>
330
+ </div>
331
+ <Command.List>
332
+ <Command.Empty>{t('cmdk.noResults')}</Command.Empty>
333
+
334
+ {!page && (
335
+ <>
336
+ {showCreateSession && (
337
+ <Command.Item
338
+ onSelect={() => {
339
+ createSession();
340
+ setOpen(false);
341
+ }}
342
+ value="new-agent"
343
+ >
344
+ <Bot className={styles.icon} />
345
+ <div className={styles.itemContent}>
346
+ <div className={styles.itemLabel}>{t('cmdk.newAgent')}</div>
347
+ </div>
348
+ </Command.Item>
349
+ )}
350
+
351
+ {!pathname?.startsWith('/settings') && (
352
+ <Command.Item onSelect={() => handleNavigate('/settings')} value="settings">
353
+ <Settings className={styles.icon} />
354
+ <div className={styles.itemContent}>
355
+ <div className={styles.itemLabel}>{t('cmdk.settings')}</div>
356
+ </div>
357
+ </Command.Item>
358
+ )}
359
+
360
+ <Command.Item onSelect={() => setPages([...pages, 'theme'])} value="theme">
361
+ <Monitor className={styles.icon} />
362
+ <div className={styles.itemContent}>
363
+ <div className={styles.itemLabel}>{t('cmdk.theme')}</div>
364
+ </div>
365
+ </Command.Item>
366
+
367
+ <Command.Group heading={t('cmdk.navigate')}>
368
+ {!pathname?.startsWith('/discover') && (
369
+ <Command.Item onSelect={() => handleNavigate('/discover')} value="discover">
370
+ <Compass className={styles.icon} />
371
+ <div className={styles.itemContent}>
372
+ <div className={styles.itemLabel}>{t('cmdk.discover')}</div>
373
+ </div>
374
+ </Command.Item>
375
+ )}
376
+ {!pathname?.startsWith('/image') && (
377
+ <Command.Item onSelect={() => handleNavigate('/image')} value="painting">
378
+ <Palette className={styles.icon} />
379
+ <div className={styles.itemContent}>
380
+ <div className={styles.itemLabel}>{t('cmdk.painting')}</div>
381
+ </div>
382
+ </Command.Item>
383
+ )}
384
+ {!pathname?.startsWith('/knowledge') && (
385
+ <Command.Item onSelect={() => handleNavigate('/knowledge')} value="knowledge">
386
+ <BookOpen className={styles.icon} />
387
+ <div className={styles.itemContent}>
388
+ <div className={styles.itemLabel}>{t('cmdk.knowledgeBase')}</div>
389
+ </div>
390
+ </Command.Item>
391
+ )}
392
+ </Command.Group>
393
+
394
+ <Command.Group heading={t('cmdk.about')}>
395
+ <Command.Item
396
+ onSelect={() =>
397
+ handleExternalLink('https://github.com/lobehub/lobe-chat/issues/new/choose')
398
+ }
399
+ value="submit-issue"
400
+ >
401
+ <Github className={styles.icon} />
402
+ <div className={styles.itemContent}>
403
+ <div className={styles.itemLabel}>{t('cmdk.submitIssue')}</div>
404
+ </div>
405
+ </Command.Item>
406
+ <Command.Item
407
+ onSelect={() => handleExternalLink('https://github.com/lobehub/lobe-chat')}
408
+ value="star-github"
409
+ >
410
+ <Star className={styles.icon} />
411
+ <div className={styles.itemContent}>
412
+ <div className={styles.itemLabel}>{t('cmdk.starOnGitHub')}</div>
413
+ </div>
414
+ </Command.Item>
415
+ <Command.Item
416
+ onSelect={() => handleExternalLink('https://discord.gg/AYFPHvv2jT')}
417
+ value="discord"
418
+ >
419
+ <MessageCircle className={styles.icon} />
420
+ <div className={styles.itemContent}>
421
+ <div className={styles.itemLabel}>{t('cmdk.communitySupport')}</div>
422
+ </div>
423
+ </Command.Item>
424
+ </Command.Group>
425
+ </>
426
+ )}
427
+
428
+ {page === 'theme' && (
429
+ <>
430
+ <Command.Item onSelect={() => handleThemeChange('light')} value="theme-light">
431
+ <Sun className={styles.icon} />
432
+ <div className={styles.itemContent}>
433
+ <div className={styles.itemLabel}>{t('cmdk.themeLight')}</div>
434
+ </div>
435
+ </Command.Item>
436
+ <Command.Item onSelect={() => handleThemeChange('dark')} value="theme-dark">
437
+ <Moon className={styles.icon} />
438
+ <div className={styles.itemContent}>
439
+ <div className={styles.itemLabel}>{t('cmdk.themeDark')}</div>
440
+ </div>
441
+ </Command.Item>
442
+ <Command.Item onSelect={() => handleThemeChange('auto')} value="theme-auto">
443
+ <Monitor className={styles.icon} />
444
+ <div className={styles.itemContent}>
445
+ <div className={styles.itemLabel}>{t('cmdk.themeAuto')}</div>
446
+ </div>
447
+ </Command.Item>
448
+ </>
449
+ )}
450
+ </Command.List>
451
+ <div className={styles.commandFooter}>
452
+ <div className={styles.kbd}>
453
+ <CornerDownLeft className={styles.kbdIcon} />
454
+ <span>{t('cmdk.toOpen')}</span>
455
+ </div>
456
+ <div className={styles.kbd}>
457
+ <ArrowUpDown className={styles.kbdIcon} />
458
+ <span>{t('cmdk.toSelect')}</span>
459
+ </div>
460
+ </div>
461
+ </Command>
462
+ </div>
463
+ </div>,
464
+ document.body,
465
+ );
466
+ });
467
+
468
+ Cmdk.displayName = 'Cmdk';
469
+
470
+ export default Cmdk;
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+
3
+ import dynamic from 'next/dynamic';
4
+ import { memo } from 'react';
5
+
6
+ // Lazy load the CMDK component with Next.js dynamic import
7
+ // This splits the CMDK code into a separate chunk that only loads when needed
8
+ // ssr: false ensures it only loads on the client side
9
+ const CmdkComponent = dynamic(() => import('./Cmdk'), {
10
+ ssr: false,
11
+ });
12
+
13
+ const CmdkLazy = memo(() => <CmdkComponent />);
14
+
15
+ CmdkLazy.displayName = 'CmdkLazy';
16
+
17
+ export default CmdkLazy;
@@ -10,6 +10,7 @@ import { getAntdLocale } from '@/utils/locale';
10
10
 
11
11
  import AntdV5MonkeyPatch from './AntdV5MonkeyPatch';
12
12
  import AppTheme from './AppTheme';
13
+ import CmdkLazy from './CmdkLazy';
13
14
  import ImportSettings from './ImportSettings';
14
15
  import Locale from './Locale';
15
16
  import QueryProvider from './Query';
@@ -65,6 +66,7 @@ const GlobalLayout = async ({
65
66
  <ImportSettings />
66
67
  {process.env.NODE_ENV === 'development' && <DevPanel />}
67
68
  </Suspense>
69
+ <CmdkLazy />
68
70
  </ServerConfigStoreProvider>
69
71
  </AppTheme>
70
72
  </Locale>