@lobehub/lobehub 2.0.0-next.72 → 2.0.0-next.74

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 (358) hide show
  1. package/.github/workflows/desktop-pr-build.yml +7 -3
  2. package/CHANGELOG.md +50 -0
  3. package/apps/desktop/package.json +1 -0
  4. package/apps/desktop/src/main/controllers/LocalFileCtr.ts +55 -11
  5. package/apps/desktop/src/main/controllers/__tests__/LocalFileCtr.test.ts +153 -0
  6. package/changelog/v1.json +18 -0
  7. package/locales/en-US/tool.json +12 -1
  8. package/locales/zh-CN/tool.json +12 -1
  9. package/next.config.ts +5 -5
  10. package/package.json +2 -1
  11. package/packages/electron-client-ipc/src/types/localSystem.ts +4 -0
  12. package/scripts/prebuild.mts +16 -6
  13. package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +6 -6
  14. package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/UserBanner.test.tsx +7 -4
  15. package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/useCategory.test.tsx +4 -4
  16. package/src/app/[variants]/(main)/(mobile)/me/(home)/features/UserBanner.tsx +5 -6
  17. package/src/app/[variants]/(main)/(mobile)/me/(home)/features/useCategory.tsx +5 -8
  18. package/src/app/[variants]/(main)/(mobile)/me/(home)/index.tsx +25 -0
  19. package/src/app/[variants]/(main)/(mobile)/me/(home)/layout.tsx +13 -16
  20. package/src/app/[variants]/(main)/(mobile)/me/profile/features/Category.tsx +6 -6
  21. package/src/app/[variants]/(main)/(mobile)/me/profile/features/Header.tsx +3 -3
  22. package/src/app/[variants]/(main)/(mobile)/me/profile/index.tsx +16 -0
  23. package/src/app/[variants]/(main)/(mobile)/me/profile/layout.tsx +9 -11
  24. package/src/app/[variants]/(main)/(mobile)/me/settings/features/Header.tsx +3 -3
  25. package/src/app/[variants]/(main)/(mobile)/me/settings/features/useCategory.tsx +3 -4
  26. package/src/app/[variants]/(main)/(mobile)/me/settings/index.tsx +16 -0
  27. package/src/app/[variants]/(main)/(mobile)/me/settings/layout.tsx +15 -13
  28. package/src/app/[variants]/(main)/changelog/_layout/Desktop/index.tsx +6 -5
  29. package/src/app/[variants]/(main)/changelog/_layout/Mobile/Header.tsx +3 -3
  30. package/src/app/[variants]/(main)/changelog/_layout/Mobile/index.tsx +5 -5
  31. package/src/app/[variants]/(main)/changelog/features/Post.tsx +7 -4
  32. package/src/app/[variants]/(main)/changelog/index.tsx +55 -0
  33. package/src/app/[variants]/(main)/chat/_layout/Desktop/index.tsx +6 -7
  34. package/src/app/[variants]/(main)/chat/_layout/Mobile.tsx +3 -3
  35. package/src/app/[variants]/(main)/chat/components/WorkspaceLayout.tsx +1 -14
  36. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatHydration/index.tsx +2 -2
  37. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/MessageFromUrl.tsx +11 -13
  38. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/index.tsx +0 -1
  39. package/src/app/[variants]/(main)/chat/components/conversation/features/ThreadHydration.tsx +2 -2
  40. package/src/app/[variants]/(main)/chat/components/topic/features/Topic/TopicListContent/TopicItem/TopicContent.tsx +20 -11
  41. package/src/app/[variants]/(main)/chat/features/PageTitle/index.tsx +1 -2
  42. package/src/app/[variants]/(main)/chat/index.tsx +29 -0
  43. package/src/app/[variants]/(main)/chat/session/features/SessionHydration.tsx +8 -6
  44. package/src/app/[variants]/(main)/chat/session/features/SessionListContent/Inbox/index.tsx +2 -4
  45. package/src/app/[variants]/(main)/chat/session/features/SessionListContent/List/index.tsx +1 -1
  46. package/src/app/[variants]/(main)/chat/session/layout/Mobile/SessionHeader.tsx +3 -3
  47. package/src/app/[variants]/(main)/chat/settings/_layout/Desktop/Header.tsx +3 -3
  48. package/src/app/[variants]/(main)/chat/settings/_layout/Mobile/Header.tsx +3 -3
  49. package/src/app/[variants]/(main)/chat/settings/features/PublishResultModal/index.tsx +3 -3
  50. package/src/app/[variants]/(main)/chat/{components/SettingsPage.tsx → settings/index.tsx} +6 -35
  51. package/src/app/[variants]/(main)/components/Link.tsx +21 -0
  52. package/src/app/[variants]/(main)/discover/(detail)/_layout/{Desktop.tsx → Desktop/index.tsx} +15 -7
  53. package/src/app/[variants]/(main)/discover/(detail)/_layout/Mobile/index.tsx +3 -3
  54. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Block.tsx +1 -1
  55. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Overview/index.tsx +1 -1
  56. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
  57. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/SystemRole/index.tsx +3 -3
  58. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Versions/index.tsx +4 -4
  59. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/index.tsx +1 -1
  60. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Header.tsx +2 -2
  61. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/ActionButton/AddAgent.tsx +3 -3
  62. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
  63. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Related/index.tsx +1 -1
  64. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/TocList/index.tsx +2 -2
  65. package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/StatusPage/index.tsx +3 -3
  66. package/src/app/[variants]/(main)/discover/(detail)/assistant/{AssistantDetailPage.tsx → index.tsx} +18 -11
  67. package/src/app/[variants]/(main)/discover/(detail)/features/Breadcrumb.tsx +1 -1
  68. package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/Related/index.tsx +2 -2
  69. package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/Versions/index.tsx +5 -5
  70. package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/index.tsx +1 -1
  71. package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/Related/index.tsx +2 -2
  72. package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ServerConfig.tsx +4 -4
  73. package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/TocList/index.tsx +2 -2
  74. package/src/app/[variants]/(main)/discover/(detail)/mcp/{McpDetailPage.tsx → index.tsx} +15 -7
  75. package/src/app/[variants]/(main)/discover/(detail)/mcp/loading.tsx +1 -0
  76. package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Overview/index.tsx +1 -1
  77. package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Parameter/ParameterItem.tsx +1 -1
  78. package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
  79. package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/index.tsx +1 -1
  80. package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Header.tsx +1 -1
  81. package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/ActionButton/ChatWithModel.tsx +3 -3
  82. package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
  83. package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/Related/index.tsx +2 -2
  84. package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/RelatedProviders/index.tsx +1 -1
  85. package/src/app/[variants]/(main)/discover/(detail)/model/{ModelDetailPage.tsx → index.tsx} +17 -10
  86. package/src/app/[variants]/(main)/discover/(detail)/model/loading.tsx +1 -0
  87. package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
  88. package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/index.tsx +1 -1
  89. package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/ActionButton/ProviderConfig.tsx +5 -4
  90. package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
  91. package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/Related/index.tsx +2 -2
  92. package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/RelatedModels/index.tsx +1 -1
  93. package/src/app/[variants]/(main)/discover/(detail)/provider/{ProviderDetailPage.tsx → index.tsx} +17 -10
  94. package/src/app/[variants]/(main)/discover/(detail)/provider/loading.tsx +1 -0
  95. package/src/app/[variants]/(main)/discover/(list)/(home)/{HomePage.tsx → index.tsx} +14 -0
  96. package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/Nav.tsx +2 -3
  97. package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/index.tsx +4 -3
  98. package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/Nav.tsx +3 -4
  99. package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/index.tsx +4 -3
  100. package/src/app/[variants]/(main)/discover/(list)/assistant/_layout/Desktop.tsx +3 -4
  101. package/src/app/[variants]/(main)/discover/(list)/assistant/_layout/Mobile.tsx +3 -3
  102. package/src/app/[variants]/(main)/discover/(list)/assistant/features/List/Item.tsx +2 -2
  103. package/src/app/[variants]/(main)/discover/(list)/assistant/{AssistantPage.tsx → index.tsx} +18 -4
  104. package/src/app/[variants]/(main)/discover/(list)/features/SortButton/index.tsx +2 -2
  105. package/src/app/[variants]/(main)/discover/(list)/mcp/_layout/Desktop.tsx +3 -3
  106. package/src/app/[variants]/(main)/discover/(list)/mcp/_layout/Mobile.tsx +3 -3
  107. package/src/app/[variants]/(main)/discover/(list)/mcp/features/List/Item.tsx +1 -1
  108. package/src/app/[variants]/(main)/discover/(list)/mcp/{McpPage.tsx → index.tsx} +9 -2
  109. package/src/app/[variants]/(main)/discover/(list)/model/_layout/Desktop.tsx +3 -3
  110. package/src/app/[variants]/(main)/discover/(list)/model/_layout/Mobile.tsx +3 -3
  111. package/src/app/[variants]/(main)/discover/(list)/model/features/List/Item.tsx +1 -1
  112. package/src/app/[variants]/(main)/discover/(list)/model/{ModelPage.tsx → index.tsx} +9 -2
  113. package/src/app/[variants]/(main)/discover/(list)/provider/features/List/Item.tsx +1 -1
  114. package/src/app/[variants]/(main)/discover/(list)/provider/{Client.tsx → index.tsx} +9 -2
  115. package/src/app/[variants]/(main)/discover/_layout/Desktop/index.tsx +4 -4
  116. package/src/app/[variants]/(main)/discover/_layout/Mobile/index.tsx +3 -3
  117. package/src/app/[variants]/(main)/discover/components/Title.tsx +1 -1
  118. package/src/app/[variants]/(main)/discover/features/Search.tsx +2 -2
  119. package/src/app/[variants]/(main)/discover/features/useNav.tsx +11 -12
  120. package/src/app/[variants]/(main)/hooks/useActiveTabKey.ts +40 -0
  121. package/src/app/[variants]/(main)/hooks/usePathname.ts +10 -0
  122. package/src/app/[variants]/(main)/hooks/useQuery.ts +12 -0
  123. package/src/app/[variants]/(main)/hooks/useRouter.ts +22 -0
  124. package/src/app/[variants]/(main)/hooks/useSearchParams.ts +11 -0
  125. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ModelSelect/index.tsx +5 -5
  126. package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicUrlSync.tsx +1 -1
  127. package/src/app/[variants]/(main)/image/ComingSoon.tsx +15 -0
  128. package/src/app/[variants]/(main)/image/_layout/Desktop/index.tsx +5 -2
  129. package/src/app/[variants]/(main)/image/_layout/DesktopWrapper.tsx +15 -0
  130. package/src/app/[variants]/(main)/image/_layout/Mobile/index.tsx +3 -1
  131. package/src/app/[variants]/(main)/image/features/ImageWorkspace/index.tsx +1 -2
  132. package/src/app/[variants]/(main)/image/index.tsx +18 -0
  133. package/src/app/[variants]/(main)/knowledge/_layout/Desktop.tsx +17 -0
  134. package/src/app/[variants]/(main)/knowledge/_layout/Mobile.tsx +17 -0
  135. package/src/app/[variants]/(main)/knowledge/components/KnowledgeBaseItem/index.tsx +1 -1
  136. package/src/app/[variants]/(main)/knowledge/components/modal/ModalPageClient.tsx +4 -4
  137. package/src/app/[variants]/(main)/knowledge/routes/KnowledgeBaseDetail/index.tsx +5 -8
  138. package/src/app/[variants]/(main)/knowledge/routes/KnowledgeBaseDetail/menu/Head.tsx +1 -1
  139. package/src/app/[variants]/(main)/knowledge/routes/KnowledgeHome/menu/CategoryMenu.tsx +2 -2
  140. package/src/app/[variants]/(main)/knowledge/routes/KnowledgeHome/menu/KnowledgeBase.tsx +1 -1
  141. package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/DesktopLayoutContainer.tsx +3 -2
  142. package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/BottomActions.tsx +4 -4
  143. package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/TopActions.test.tsx +9 -9
  144. package/src/app/[variants]/(main)/layouts/desktop/SideBar/TopActions.tsx +117 -0
  145. package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/index.tsx +9 -4
  146. package/src/app/[variants]/(main)/layouts/index.tsx +11 -0
  147. package/src/app/[variants]/(main)/{_layout/Mobile → layouts/mobile}/NavBar.tsx +5 -5
  148. package/src/app/[variants]/(main)/{_layout/Mobile → layouts/mobile}/index.tsx +10 -7
  149. package/src/app/[variants]/(main)/profile/(home)/desktop.tsx +26 -0
  150. package/src/app/[variants]/(main)/profile/(home)/index.tsx +26 -0
  151. package/src/app/[variants]/(main)/profile/@category/features/CategoryContent.tsx +5 -7
  152. package/src/app/[variants]/(main)/profile/_layout/Desktop/index.tsx +3 -2
  153. package/src/app/[variants]/(main)/profile/_layout/DesktopWrapper.tsx +14 -0
  154. package/src/app/[variants]/(main)/profile/_layout/Mobile/Header.tsx +3 -3
  155. package/src/app/[variants]/(main)/profile/_layout/Mobile/index.tsx +4 -3
  156. package/src/app/[variants]/(main)/profile/apikey/index.tsx +18 -0
  157. package/src/app/[variants]/(main)/profile/hooks/useCategory.tsx +6 -6
  158. package/src/app/[variants]/(main)/profile/security/index.tsx +29 -0
  159. package/src/app/[variants]/(main)/profile/stats/features/AssistantsRank.tsx +4 -4
  160. package/src/app/[variants]/(main)/profile/stats/features/TopicsRank.tsx +4 -4
  161. package/src/app/[variants]/(main)/profile/stats/index.tsx +20 -0
  162. package/src/app/[variants]/(main)/profile/usage/features/UsageTable.tsx +7 -9
  163. package/src/app/[variants]/(main)/profile/usage/index.tsx +13 -0
  164. package/src/app/[variants]/(main)/settings/_layout/Desktop/Header.tsx +2 -2
  165. package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +2 -2
  166. package/src/app/[variants]/(main)/settings/_layout/DesktopWrapper.tsx +23 -0
  167. package/src/app/[variants]/(main)/settings/_layout/Mobile/Header.tsx +8 -7
  168. package/src/app/[variants]/(main)/settings/_layout/Mobile/index.tsx +2 -5
  169. package/src/app/[variants]/(main)/settings/_layout/MobileWrapper.tsx +23 -0
  170. package/src/app/[variants]/(main)/settings/agent/AgentMenu/Menu.tsx +2 -4
  171. package/src/app/[variants]/(main)/settings/agent/index.tsx +2 -4
  172. package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +2 -3
  173. package/src/app/[variants]/(main)/settings/provider/ProviderMenu/All.tsx +2 -2
  174. package/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx +38 -37
  175. package/src/app/[variants]/(main)/settings/provider/_layout/Mobile.tsx +2 -2
  176. package/src/app/[variants]/(main)/settings/provider/features/CreateNewProvider/index.tsx +3 -3
  177. package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx +3 -3
  178. package/src/app/[variants]/DesktopRouter.tsx +40 -0
  179. package/src/app/[variants]/MobileRouter.tsx +41 -0
  180. package/src/app/[variants]/desktopRouter.config.tsx +364 -0
  181. package/src/app/[variants]/layout.tsx +1 -3
  182. package/src/app/[variants]/loaders/routeParams.ts +45 -0
  183. package/src/app/[variants]/loading/Server/Redirect.tsx +1 -1
  184. package/src/app/[variants]/mobileRouter.config.tsx +396 -0
  185. package/src/app/[variants]/page.tsx +17 -6
  186. package/src/app/desktop/devtools/page.tsx +1 -1
  187. package/src/app/desktop/layout.tsx +1 -1
  188. package/src/components/BootErrorBoundary/index.tsx +129 -0
  189. package/src/components/mdx/constants.ts +1 -0
  190. package/src/features/ChangelogModal/index.tsx +3 -3
  191. package/src/features/Conversation/Messages/Group/Tool/Inspector/index.tsx +23 -4
  192. package/src/features/KnowledgeManager/FileExplorer/index.tsx +4 -4
  193. package/src/features/KnowledgeManager/Header/FilesSearchBar.tsx +1 -1
  194. package/src/features/User/UserPanel/PanelContent.tsx +4 -3
  195. package/src/features/User/UserPanel/useMenu.tsx +20 -14
  196. package/src/features/User/__tests__/PanelContent.test.tsx +13 -7
  197. package/src/hooks/useDiscoverTab.ts +2 -2
  198. package/src/hooks/useInterceptingRoutes.test.ts +23 -26
  199. package/src/hooks/useInterceptingRoutes.ts +5 -4
  200. package/src/hooks/usePinnedAgentState.ts +6 -6
  201. package/src/hooks/useQuery.ts +5 -0
  202. package/src/hooks/useQueryParam.ts +322 -0
  203. package/src/hooks/useQueryRoute.test.ts +2 -12
  204. package/src/hooks/useQueryRoute.ts +5 -5
  205. package/src/hooks/useShowMobileWorkspace.ts +1 -1
  206. package/src/hooks/useSwitchSession.ts +4 -3
  207. package/src/layout/GlobalProvider/ImportSettings.tsx +22 -9
  208. package/src/layout/GlobalProvider/StoreInitialization.tsx +9 -1
  209. package/src/locales/default/tool.ts +11 -0
  210. package/src/proxy.ts +13 -1
  211. package/src/services/message/index.ts +11 -2
  212. package/src/store/chat/agents/createAgentExecutors.ts +31 -16
  213. package/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts +218 -0
  214. package/src/store/chat/slices/aiChat/actions/conversationControl.ts +4 -0
  215. package/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +9 -3
  216. package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +142 -61
  217. package/src/store/chat/slices/builtinTool/actions/__tests__/localSystem.test.ts +5 -6
  218. package/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +204 -10
  219. package/src/store/chat/slices/builtinTool/actions/localSystem.ts +45 -182
  220. package/src/store/chat/slices/builtinTool/actions/search.ts +51 -26
  221. package/src/store/chat/slices/message/action.test.ts +182 -33
  222. package/src/store/chat/slices/message/actions/optimisticUpdate.ts +79 -36
  223. package/src/store/chat/slices/message/actions/query.ts +7 -5
  224. package/src/store/chat/slices/message/selectors/dbMessage.ts +11 -4
  225. package/src/store/chat/slices/plugin/action.test.ts +257 -54
  226. package/src/store/chat/slices/plugin/actions/optimisticUpdate.ts +63 -26
  227. package/src/store/chat/slices/plugin/actions/pluginTypes.ts +52 -19
  228. package/src/store/chat/slices/plugin/actions/publicApi.ts +6 -1
  229. package/src/store/chat/slices/plugin/actions/workflow.ts +17 -6
  230. package/src/store/chat/slices/thread/action.ts +2 -0
  231. package/src/store/global/action.test.ts +3 -3
  232. package/src/store/global/actions/workspacePane.ts +2 -1
  233. package/src/store/global/initialState.ts +10 -2
  234. package/src/store/user/slices/common/action.ts +4 -0
  235. package/src/tools/executionRuntimes.ts +3 -0
  236. package/src/tools/local-system/ExecutionRuntime/index.ts +407 -0
  237. package/src/tools/local-system/Intervention/EditLocalFile/index.tsx +89 -0
  238. package/src/tools/local-system/Intervention/WriteFile/index.tsx +72 -0
  239. package/src/tools/local-system/Intervention/index.ts +4 -0
  240. package/src/tools/local-system/Render/EditLocalFile/index.tsx +67 -0
  241. package/src/tools/local-system/Render/ReadLocalFile/ReadFileView.tsx +53 -78
  242. package/src/tools/local-system/Render/index.ts +2 -0
  243. package/src/tools/local-system/index.ts +1 -0
  244. package/src/tools/local-system/type.ts +4 -3
  245. package/src/app/[variants]/(main)/(mobile)/me/(home)/loading.tsx +0 -38
  246. package/src/app/[variants]/(main)/(mobile)/me/(home)/page.tsx +0 -40
  247. package/src/app/[variants]/(main)/(mobile)/me/profile/loading.tsx +0 -5
  248. package/src/app/[variants]/(main)/(mobile)/me/profile/page.tsx +0 -30
  249. package/src/app/[variants]/(main)/(mobile)/me/settings/loading.tsx +0 -5
  250. package/src/app/[variants]/(main)/(mobile)/me/settings/page.tsx +0 -30
  251. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx +0 -106
  252. package/src/app/[variants]/(main)/changelog/layout.tsx +0 -10
  253. package/src/app/[variants]/(main)/changelog/modal/page.tsx +0 -23
  254. package/src/app/[variants]/(main)/changelog/page.tsx +0 -78
  255. package/src/app/[variants]/(main)/chat/ChatRouter.tsx +0 -83
  256. package/src/app/[variants]/(main)/chat/_layout/ChatLayout.tsx +0 -22
  257. package/src/app/[variants]/(main)/chat/components/MainChatPage.tsx +0 -25
  258. package/src/app/[variants]/(main)/chat/error.tsx +0 -3
  259. package/src/app/[variants]/(main)/chat/layout.tsx +0 -10
  260. package/src/app/[variants]/(main)/chat/loading.tsx +0 -3
  261. package/src/app/[variants]/(main)/chat/not-found.tsx +0 -1
  262. package/src/app/[variants]/(main)/chat/page.tsx +0 -12
  263. package/src/app/[variants]/(main)/chat/settings/error.tsx +0 -3
  264. package/src/app/[variants]/(main)/chat/settings/loading.tsx +0 -3
  265. package/src/app/[variants]/(main)/chat/settings/not-found.tsx +0 -1
  266. package/src/app/[variants]/(main)/discover/(detail)/_layout/DetailLayout.tsx +0 -22
  267. package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/Client.tsx +0 -51
  268. package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/Client.tsx +0 -43
  269. package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/loading.tsx +0 -1
  270. package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/Client.tsx +0 -40
  271. package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/loading.tsx +0 -1
  272. package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/Client.tsx +0 -40
  273. package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/loading.tsx +0 -1
  274. package/src/app/[variants]/(main)/discover/(list)/_layout/ListLayout.tsx +0 -22
  275. package/src/app/[variants]/(main)/discover/(list)/assistant/AssistantLayout.tsx +0 -21
  276. package/src/app/[variants]/(main)/discover/(list)/mcp/Client.tsx +0 -44
  277. package/src/app/[variants]/(main)/discover/(list)/mcp/McpLayout.tsx +0 -21
  278. package/src/app/[variants]/(main)/discover/(list)/model/Client.tsx +0 -44
  279. package/src/app/[variants]/(main)/discover/(list)/model/ModelLayout.tsx +0 -21
  280. package/src/app/[variants]/(main)/discover/(list)/provider/ProviderPage.tsx +0 -43
  281. package/src/app/[variants]/(main)/discover/DiscoverRouter.tsx +0 -170
  282. package/src/app/[variants]/(main)/discover/[[...path]]/page.tsx +0 -12
  283. package/src/app/[variants]/(main)/discover/_layout/DiscoverLayout.tsx +0 -22
  284. package/src/app/[variants]/(main)/discover/error.tsx +0 -3
  285. package/src/app/[variants]/(main)/discover/not-found.tsx +0 -1
  286. package/src/app/[variants]/(main)/error.tsx +0 -3
  287. package/src/app/[variants]/(main)/image/layout.tsx +0 -15
  288. package/src/app/[variants]/(main)/image/page.tsx +0 -45
  289. package/src/app/[variants]/(main)/knowledge/KnowledgeRouter.tsx +0 -74
  290. package/src/app/[variants]/(main)/knowledge/[[...path]]/page.tsx +0 -12
  291. package/src/app/[variants]/(main)/knowledge/components/modal/page.tsx +0 -13
  292. package/src/app/[variants]/(main)/knowledge/layout.tsx +0 -12
  293. package/src/app/[variants]/(main)/layout.tsx +0 -10
  294. package/src/app/[variants]/(main)/not-found.tsx +0 -1
  295. package/src/app/[variants]/(main)/profile/apikey/page.tsx +0 -32
  296. package/src/app/[variants]/(main)/profile/error.tsx +0 -3
  297. package/src/app/[variants]/(main)/profile/layout.tsx +0 -11
  298. package/src/app/[variants]/(main)/profile/loading.tsx +0 -3
  299. package/src/app/[variants]/(main)/profile/not-found.tsx +0 -1
  300. package/src/app/[variants]/(main)/profile/security/page.tsx +0 -28
  301. package/src/app/[variants]/(main)/profile/stats/page.tsx +0 -23
  302. package/src/app/[variants]/(main)/profile/usage/page.tsx +0 -23
  303. package/src/app/[variants]/@modal/(.)changelog/modal/features/Cover.tsx +0 -48
  304. package/src/app/[variants]/@modal/(.)changelog/modal/features/Hero.tsx +0 -29
  305. package/src/app/[variants]/@modal/(.)changelog/modal/features/Post.tsx +0 -57
  306. package/src/app/[variants]/@modal/(.)changelog/modal/features/PublishedTime.tsx +0 -50
  307. package/src/app/[variants]/@modal/(.)changelog/modal/features/ReadDetail.tsx +0 -72
  308. package/src/app/[variants]/@modal/(.)changelog/modal/features/VersionTag.tsx +0 -26
  309. package/src/app/[variants]/@modal/(.)changelog/modal/layout.tsx +0 -41
  310. package/src/app/[variants]/@modal/(.)changelog/modal/loading.tsx +0 -10
  311. package/src/app/[variants]/@modal/(.)changelog/modal/page.tsx +0 -38
  312. package/src/app/[variants]/@modal/_layout/ModalLayout.tsx +0 -63
  313. package/src/app/[variants]/@modal/_layout/SettingModalLayout.tsx +0 -71
  314. package/src/app/[variants]/@modal/default.tsx +0 -3
  315. package/src/app/[variants]/@modal/error.tsx +0 -3
  316. package/src/app/[variants]/@modal/layout.tsx +0 -7
  317. package/src/app/[variants]/@modal/loading.tsx +0 -5
  318. /package/src/app/[variants]/{@modal/(.)changelog/modal → (main)/changelog}/features/Pagination.tsx +0 -0
  319. /package/src/app/[variants]/{@modal/(.)changelog/modal → (main)/changelog}/features/UpdateChangelogStatus.tsx +0 -0
  320. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
  321. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Knowledge.tsx +0 -0
  322. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/KnowledgeItem.tsx +0 -0
  323. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/PluginItem.tsx +0 -0
  324. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Plugins.tsx +0 -0
  325. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/index.tsx +0 -0
  326. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
  327. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Overview/TagList.tsx +0 -0
  328. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/SystemRole/TagList.tsx +0 -0
  329. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
  330. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Summary/index.tsx +0 -0
  331. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
  332. /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/loading.tsx → loading.tsx} +0 -0
  333. /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ActionButton/index.tsx +0 -0
  334. /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ConnectionTypeAlert.tsx +0 -0
  335. /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/Related/Item.tsx +0 -0
  336. /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/index.tsx +0 -0
  337. /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
  338. /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
  339. /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Overview/ProviderList/index.tsx +0 -0
  340. /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Parameter/index.tsx +0 -0
  341. /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
  342. /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/RelatedProviders/Item.tsx +0 -0
  343. /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
  344. /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
  345. /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Guide/index.tsx +0 -0
  346. /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
  347. /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Overview/ModelList/index.tsx +0 -0
  348. /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Overview/index.tsx +0 -0
  349. /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Header.tsx +0 -0
  350. /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
  351. /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/RelatedModels/Item.tsx +0 -0
  352. /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
  353. /package/src/app/[variants]/(main)/labs/{page.tsx → index.tsx} +0 -0
  354. /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/RegisterHotkeys.tsx +0 -0
  355. /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/Avatar.test.tsx +0 -0
  356. /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/Avatar.tsx +0 -0
  357. /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/PinList/index.tsx +0 -0
  358. /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/index.tsx +0 -0
@@ -1,20 +1,19 @@
1
1
  'use client';
2
2
 
3
- import { usePathname } from 'next/navigation';
4
3
  import { memo } from 'react';
4
+ import { useLocation, useNavigate } from 'react-router-dom';
5
5
  import urlJoin from 'url-join';
6
6
 
7
7
  import Menu from '@/components/Menu';
8
- import { useQueryRoute } from '@/hooks/useQueryRoute';
9
8
  import { ProfileTabs } from '@/store/global/initialState';
10
9
 
11
10
  import { useCategory } from '../../hooks/useCategory';
12
11
 
13
12
  const CategoryContent = memo(() => {
14
- const pathname = usePathname();
15
- const activeTab = pathname.split('/').at(-1);
13
+ const location = useLocation();
14
+ const navigate = useNavigate();
15
+ const activeTab = location.pathname.split('/').at(-1);
16
16
  const cateItems = useCategory();
17
- const router = useQueryRoute();
18
17
 
19
18
  return (
20
19
  <Menu
@@ -22,8 +21,7 @@ const CategoryContent = memo(() => {
22
21
  items={cateItems}
23
22
  onClick={({ key }) => {
24
23
  const activeKey = key === ProfileTabs.Profile ? '/' : key;
25
-
26
- router.push(urlJoin('/profile', activeKey));
24
+ navigate(urlJoin('/profile', activeKey));
27
25
  }}
28
26
  selectable
29
27
  selectedKeys={activeTab ? [activeTab] : []}
@@ -3,6 +3,7 @@
3
3
  import { useResponsive } from 'antd-style';
4
4
  import { memo, useRef } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
+ import { Outlet } from 'react-router-dom';
6
7
  import { Flexbox } from 'react-layout-kit';
7
8
 
8
9
  import Footer from '@/features/Setting/Footer';
@@ -13,7 +14,7 @@ import { LayoutProps } from '../type';
13
14
  import Header from './Header';
14
15
  import SideBar from './SideBar';
15
16
 
16
- const Layout = memo<LayoutProps>(({ children, category }) => {
17
+ const Layout = memo<Omit<LayoutProps, 'children'>>(({ category }) => {
17
18
  const ref = useRef<any>(null);
18
19
  const { md = true } = useResponsive();
19
20
  const { t } = useTranslation('auth');
@@ -41,7 +42,7 @@ const Layout = memo<LayoutProps>(({ children, category }) => {
41
42
  paddingInline: 32,
42
43
  }}
43
44
  >
44
- {children}
45
+ <Outlet />
45
46
  </SettingContainer>
46
47
  </Flexbox>
47
48
  );
@@ -0,0 +1,14 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+
5
+ import Category from '../@category/default';
6
+ import Desktop from './Desktop';
7
+
8
+ const DesktopProfileWrapper = memo(() => {
9
+ return <Desktop category={<Category />} />;
10
+ });
11
+
12
+ DesktopProfileWrapper.displayName = 'DesktopProfileWrapper';
13
+
14
+ export default DesktopProfileWrapper;
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
 
3
3
  import { ChatHeader } from '@lobehub/ui/mobile';
4
- import { useRouter } from 'next/navigation';
5
4
  import { memo } from 'react';
6
5
  import { useTranslation } from 'react-i18next';
7
6
  import { Flexbox } from 'react-layout-kit';
7
+ import { useNavigate } from 'react-router-dom';
8
8
 
9
9
  import { useActiveProfileKey } from '@/hooks/useActiveTabKey';
10
10
  import { mobileHeaderSticky } from '@/styles/mobileHeader';
@@ -14,12 +14,12 @@ import ShareButton from '../../stats/features/ShareButton';
14
14
  const Header = memo(() => {
15
15
  const { t } = useTranslation('auth');
16
16
 
17
- const router = useRouter();
17
+ const navigate = useNavigate();
18
18
  const activeSettingsKey = useActiveProfileKey();
19
19
  const isStats = activeSettingsKey === 'stats';
20
20
 
21
21
  const handleBackClick = () => {
22
- router.push('/me/profile');
22
+ navigate('/me/profile');
23
23
  };
24
24
 
25
25
  return (
@@ -1,13 +1,14 @@
1
+ import { Outlet } from 'react-router-dom';
2
+
1
3
  import MobileContentLayout from '@/components/server/MobileNavLayout';
2
4
  import Footer from '@/features/Setting/Footer';
3
5
 
4
- import { LayoutProps } from '../type';
5
6
  import Header from './Header';
6
7
 
7
- const Layout = ({ children }: LayoutProps) => {
8
+ const Layout = () => {
8
9
  return (
9
10
  <MobileContentLayout header={<Header />}>
10
- {children}
11
+ <Outlet />
11
12
  <div style={{ flex: 1 }} />
12
13
  <Footer />
13
14
  </MobileContentLayout>
@@ -0,0 +1,18 @@
1
+ import NotFound from '@/components/404';
2
+ import { serverFeatureFlags } from '@/config/featureFlags';
3
+
4
+ import Page from '../../settings/system-agent';
5
+ import Client from './Client';
6
+
7
+
8
+ const page = () => {
9
+ const { showApiKeyManage } = serverFeatureFlags();
10
+
11
+ if (!showApiKeyManage) return <NotFound />;
12
+
13
+ return <Client />;
14
+ };
15
+
16
+ Page.displayName = 'ApiKey';
17
+
18
+ export default page;
@@ -1,6 +1,6 @@
1
1
  import { Icon } from '@lobehub/ui';
2
2
  import { BadgeCentIcon, ChartColumnBigIcon, KeyIcon, ShieldCheck, UserCircle } from 'lucide-react';
3
- import Link from 'next/link';
3
+ import { Link } from 'react-router-dom';
4
4
  import { useTranslation } from 'react-i18next';
5
5
 
6
6
  import type { MenuProps } from '@/components/Menu';
@@ -19,7 +19,7 @@ export const useCategory = () => {
19
19
  icon: <Icon icon={UserCircle} />,
20
20
  key: ProfileTabs.Profile,
21
21
  label: (
22
- <Link href={'/profile'} onClick={(e) => e.preventDefault()}>
22
+ <Link onClick={(e) => e.preventDefault()} to={'/profile'}>
23
23
  {t('tab.profile')}
24
24
  </Link>
25
25
  ),
@@ -28,7 +28,7 @@ export const useCategory = () => {
28
28
  icon: <Icon icon={ShieldCheck} />,
29
29
  key: ProfileTabs.Security,
30
30
  label: (
31
- <Link href={'/profile/security'} onClick={(e) => e.preventDefault()}>
31
+ <Link onClick={(e) => e.preventDefault()} to={'/profile/security'}>
32
32
  {t('tab.security')}
33
33
  </Link>
34
34
  ),
@@ -37,7 +37,7 @@ export const useCategory = () => {
37
37
  icon: <Icon icon={ChartColumnBigIcon} />,
38
38
  key: ProfileTabs.Stats,
39
39
  label: (
40
- <Link href={'/profile/stats'} onClick={(e) => e.preventDefault()}>
40
+ <Link onClick={(e) => e.preventDefault()} to={'/profile/stats'}>
41
41
  {t('tab.stats')}
42
42
  </Link>
43
43
  ),
@@ -46,7 +46,7 @@ export const useCategory = () => {
46
46
  icon: <Icon icon={KeyIcon} />,
47
47
  key: ProfileTabs.APIKey,
48
48
  label: (
49
- <Link href={'/profile/apikey'} onClick={(e) => e.preventDefault()}>
49
+ <Link onClick={(e) => e.preventDefault()} to={'/profile/apikey'}>
50
50
  {t('tab.apikey')}
51
51
  </Link>
52
52
  ),
@@ -55,7 +55,7 @@ export const useCategory = () => {
55
55
  icon: <Icon icon={BadgeCentIcon} />,
56
56
  key: ProfileTabs.Usage,
57
57
  label: (
58
- <Link href={'/profile/usage'} onClick={(e) => e.preventDefault()}>
58
+ <Link onClick={(e) => e.preventDefault()} to={'/profile/usage'}>
59
59
  {t('tab.usage')}
60
60
  </Link>
61
61
  ),
@@ -0,0 +1,29 @@
1
+ 'use client';
2
+
3
+ import { Skeleton } from 'antd';
4
+ import dynamic from 'next/dynamic';
5
+ import { memo } from 'react';
6
+ import { Navigate } from 'react-router-dom';
7
+
8
+ import { enableClerk } from '@/const/auth';
9
+
10
+ const ClerkProfile = dynamic(() => import('../features/ClerkProfile'), {
11
+ loading: () => (
12
+ <div style={{ flex: 1 }}>
13
+ <Skeleton paragraph={{ rows: 8 }} title={false} />
14
+ </div>
15
+ ),
16
+ });
17
+
18
+ const MobileProfileSecurityPage = memo(() => {
19
+ const mobile = true;
20
+ return enableClerk ? <ClerkProfile mobile={mobile} /> : <Navigate replace to="/profile" />;
21
+ });
22
+
23
+
24
+ const DesktopProfileSecurityPage = memo(() => {
25
+ const mobile = false;
26
+ return enableClerk ? <ClerkProfile mobile={mobile} /> : <Navigate replace to="/profile" />;
27
+ });
28
+
29
+ export { DesktopProfileSecurityPage,MobileProfileSecurityPage };
@@ -2,11 +2,11 @@ import { BarList } from '@lobehub/charts';
2
2
  import { ActionIcon, Avatar, FormGroup, Modal } from '@lobehub/ui';
3
3
  import { MaximizeIcon } from 'lucide-react';
4
4
  import Link from 'next/link';
5
- import { useRouter } from 'next/navigation';
6
5
  import qs from 'query-string';
7
6
  import { memo, useState } from 'react';
8
7
  import { useTranslation } from 'react-i18next';
9
8
  import { Flexbox } from 'react-layout-kit';
9
+ import { useNavigate } from 'react-router-dom';
10
10
 
11
11
  import { FORM_STYLE } from '@/const/layoutTokens';
12
12
  import { DEFAULT_AVATAR } from '@/const/meta';
@@ -18,7 +18,7 @@ import { SessionRankItem } from '@/types/session';
18
18
  export const AssistantsRank = memo<{ mobile?: boolean }>(({ mobile }) => {
19
19
  const [open, setOpen] = useState(false);
20
20
  const { t } = useTranslation(['auth', 'chat']);
21
- const router = useRouter();
21
+ const navigate = useNavigate();
22
22
  const { data, isLoading } = useClientDataSWR('rank-sessions', async () =>
23
23
  sessionService.rankSessions(),
24
24
  );
@@ -86,7 +86,7 @@ export const AssistantsRank = memo<{ mobile?: boolean }>(({ mobile }) => {
86
86
  desc: t('stats.empty.desc'),
87
87
  title: t('stats.empty.title'),
88
88
  }}
89
- onValueChange={(item) => router.push(item.link)}
89
+ onValueChange={(item) => navigate(item.link)}
90
90
  rightLabel={t('stats.assistantsRank.right')}
91
91
  />
92
92
  </Flexbox>
@@ -104,7 +104,7 @@ export const AssistantsRank = memo<{ mobile?: boolean }>(({ mobile }) => {
104
104
  height={340}
105
105
  leftLabel={t('stats.assistantsRank.left')}
106
106
  loading={isLoading || !data}
107
- onValueChange={(item) => router.push(item.link)}
107
+ onValueChange={(item) => navigate(item.link)}
108
108
  rightLabel={t('stats.assistantsRank.right')}
109
109
  />
110
110
  </Modal>
@@ -3,11 +3,11 @@ import { ActionIcon, FormGroup, Icon, Modal } from '@lobehub/ui';
3
3
  import { useTheme } from 'antd-style';
4
4
  import { MaximizeIcon, MessageSquareIcon } from 'lucide-react';
5
5
  import Link from 'next/link';
6
- import { useRouter } from 'next/navigation';
7
6
  import qs from 'query-string';
8
7
  import { memo, useState } from 'react';
9
8
  import { useTranslation } from 'react-i18next';
10
9
  import { Flexbox } from 'react-layout-kit';
10
+ import { useNavigate } from 'react-router-dom';
11
11
 
12
12
  import { FORM_STYLE } from '@/const/layoutTokens';
13
13
  import { INBOX_SESSION_ID } from '@/const/session';
@@ -19,7 +19,7 @@ export const TopicsRank = memo<{ mobile?: boolean }>(({ mobile }) => {
19
19
  const [open, setOpen] = useState(false);
20
20
  const { t } = useTranslation('auth');
21
21
  const theme = useTheme();
22
- const router = useRouter();
22
+ const navigate = useNavigate();
23
23
  const { data, isLoading } = useClientDataSWR('rank-topics', async () =>
24
24
  topicService.rankTopics(),
25
25
  );
@@ -73,7 +73,7 @@ export const TopicsRank = memo<{ mobile?: boolean }>(({ mobile }) => {
73
73
  desc: t('stats.empty.desc'),
74
74
  title: t('stats.empty.title'),
75
75
  }}
76
- onValueChange={(item) => router.push(item.link)}
76
+ onValueChange={(item) => navigate(item.link)}
77
77
  rightLabel={t('stats.topicsRank.right')}
78
78
  />
79
79
  </Flexbox>
@@ -91,7 +91,7 @@ export const TopicsRank = memo<{ mobile?: boolean }>(({ mobile }) => {
91
91
  height={340}
92
92
  leftLabel={t('stats.topicsRank.left')}
93
93
  loading={isLoading || !data}
94
- onValueChange={(item) => router.push(item.link)}
94
+ onValueChange={(item) => navigate(item.link)}
95
95
  rightLabel={t('stats.topicsRank.right')}
96
96
  />
97
97
  </Modal>
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+
5
+ import StatsClient from './Client';
6
+
7
+ const MobileProfileStatsPage = memo(() => {
8
+ const mobile = true;
9
+ return <StatsClient mobile={mobile} />;
10
+ });
11
+
12
+ MobileProfileStatsPage.displayName = 'MobileProfileStatsPage';
13
+
14
+
15
+ const DesktopProfileStatsPage = memo(() => {
16
+ const mobile = false;
17
+ return <StatsClient mobile={mobile} />;
18
+ });
19
+
20
+ export { DesktopProfileStatsPage,MobileProfileStatsPage };
@@ -2,11 +2,11 @@ import { ProviderIcon } from '@lobehub/icons';
2
2
  import { Tag } from '@lobehub/ui';
3
3
  import { Table, TableColumnType, Typography } from 'antd';
4
4
  import { useTheme } from 'antd-style';
5
- import { parseAsInteger, useQueryState } from 'nuqs';
6
5
  import { memo, useEffect } from 'react';
7
6
  import { useTranslation } from 'react-i18next';
8
7
  import { Flexbox } from 'react-layout-kit';
9
8
 
9
+ import { parseAsInteger, useQueryParam } from '@/hooks/useQueryParam';
10
10
  import { useClientDataSWR } from '@/libs/swr';
11
11
  import { usageService } from '@/services/usage';
12
12
  import { formatDate, formatNumber } from '@/utils/format';
@@ -21,14 +21,12 @@ const UsageTable = memo<UsageChartProps>(({ dateStrings }) => {
21
21
  usageService.findByMonth(dateStrings),
22
22
  );
23
23
 
24
- const [currentPage, setCurrentPage] = useQueryState(
25
- 'current',
26
- parseAsInteger.withDefault(1).withOptions({ clearOnDefault: true }),
27
- );
28
- const [pageSize, setPageSize] = useQueryState(
29
- 'pageSize',
30
- parseAsInteger.withDefault(5).withOptions({ clearOnDefault: true }),
31
- );
24
+ const [currentPage, setCurrentPage] = useQueryParam('current', parseAsInteger.withDefault(1), {
25
+ clearOnDefault: true,
26
+ });
27
+ const [pageSize, setPageSize] = useQueryParam('pageSize', parseAsInteger.withDefault(5), {
28
+ clearOnDefault: true,
29
+ });
32
30
 
33
31
  useEffect(() => {
34
32
  if (dateStrings) {
@@ -0,0 +1,13 @@
1
+
2
+ import Client from './Client';
3
+
4
+
5
+ const MobileProfileUsagePage = async () => {
6
+ return <Client mobile={true} />;
7
+ };
8
+
9
+ const DesktopProfileUsagePage = async () => {
10
+ return <Client mobile={false} />;
11
+ };
12
+
13
+ export { DesktopProfileUsagePage,MobileProfileUsagePage };
@@ -5,10 +5,10 @@ import { ChatHeader } from '@lobehub/ui/chat';
5
5
  import { Drawer, type DrawerProps } from 'antd';
6
6
  import { createStyles } from 'antd-style';
7
7
  import { Menu } from 'lucide-react';
8
- import { useSearchParams } from 'next/navigation';
9
8
  import { ReactNode, memo, useState } from 'react';
10
9
  import { useTranslation } from 'react-i18next';
11
10
  import { Flexbox } from 'react-layout-kit';
11
+ import { useSearchParams } from 'react-router-dom';
12
12
 
13
13
  import BrandWatermark from '@/components/BrandWatermark';
14
14
  import { useActiveSettingsKey } from '@/hooks/useActiveTabKey';
@@ -40,7 +40,7 @@ const Header = memo<HeaderProps>(({ children, getContainer, title }) => {
40
40
  const activeKey = useActiveSettingsKey();
41
41
  const providerName = useProviderName(activeKey);
42
42
 
43
- const search = useSearchParams();
43
+ const [search] = useSearchParams();
44
44
  const active = search.get('active');
45
45
  const { t } = useTranslation('setting');
46
46
 
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
 
3
3
  import { useResponsive, useTheme } from 'antd-style';
4
- import { parseAsStringEnum, useQueryState } from 'nuqs';
5
4
  import { memo, useRef } from 'react';
6
5
  import { Flexbox } from 'react-layout-kit';
7
6
 
8
7
  import SettingContainer from '@/features/Setting/SettingContainer';
8
+ import { parseAsStringEnum, useQueryParam } from '@/hooks/useQueryParam';
9
9
  import { SettingsTabs } from '@/store/global/initialState';
10
10
 
11
11
  import CategoryContent from '../CategoryContent';
@@ -19,7 +19,7 @@ const Layout = memo<LayoutProps>(() => {
19
19
  const { md = true } = useResponsive();
20
20
  const theme = useTheme();
21
21
 
22
- const [activeTab, setActiveTab] = useQueryState(
22
+ const [activeTab, setActiveTab] = useQueryParam(
23
23
  'active',
24
24
  parseAsStringEnum(Object.values(SettingsTabs)).withDefault(SettingsTabs.Common),
25
25
  );
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+ import { Outlet } from 'react-router-dom';
5
+
6
+ import SettingsContextProvider from './ContextProvider';
7
+
8
+ const DesktopSettingsWrapper = memo(() => {
9
+ return (
10
+ <SettingsContextProvider
11
+ value={{
12
+ showOpenAIApiKey: true,
13
+ showOpenAIProxyUrl: true,
14
+ }}
15
+ >
16
+ <Outlet />
17
+ </SettingsContextProvider>
18
+ );
19
+ });
20
+
21
+ DesktopSettingsWrapper.displayName = 'DesktopSettingsWrapper';
22
+
23
+ export default DesktopSettingsWrapper;
@@ -1,23 +1,22 @@
1
1
  'use client';
2
2
 
3
3
  import { ChatHeader } from '@lobehub/ui/mobile';
4
- import { useQueryState } from 'nuqs';
5
4
  import { memo } from 'react';
6
5
  import { useTranslation } from 'react-i18next';
7
6
  import { Flexbox } from 'react-layout-kit';
8
7
 
9
8
  import { enableAuth } from '@/const/auth';
10
- import { useQueryRoute } from '@/hooks/useQueryRoute';
9
+ import { useQueryState } from '@/hooks/useQueryParam';
11
10
  import { useShowMobileWorkspace } from '@/hooks/useShowMobileWorkspace';
12
11
  import { SettingsTabs } from '@/store/global/initialState';
13
12
  import { useSessionStore } from '@/store/session';
14
13
  import { mobileHeaderSticky } from '@/styles/mobileHeader';
14
+ import { useNavigate } from 'react-router-dom';
15
15
 
16
16
  const Header = memo(() => {
17
17
  const { t } = useTranslation('setting');
18
- const router = useQueryRoute();
19
18
  const showMobileWorkspace = useShowMobileWorkspace();
20
-
19
+ const navigate = useNavigate();
21
20
  const [activeSettingsKey, setActiveSettingsKey] = useQueryState('active');
22
21
  const [providerName, setProviderName] = useQueryState('provider');
23
22
 
@@ -25,13 +24,15 @@ const Header = memo(() => {
25
24
  const isProvider = providerName ? true : false;
26
25
 
27
26
  const handleBackClick = () => {
27
+ console.log('gobackclick', isSessionActive, showMobileWorkspace, activeSettingsKey, providerName);
28
28
  if (isSessionActive && showMobileWorkspace) {
29
- router.push('/chat');
30
- } else if (activeSettingsKey === 'provider' && providerName !== null) {
29
+ navigate('/chat');
30
+ } else if (activeSettingsKey === 'provider' && providerName) {
31
31
  setProviderName(null);
32
32
  setActiveSettingsKey('provider');
33
+ navigate(-1);
33
34
  } else {
34
- router.push(enableAuth ? '/me/settings' : '/me');
35
+ navigate(enableAuth ? '/me/settings' : '/me');
35
36
  }
36
37
  };
37
38
 
@@ -1,18 +1,15 @@
1
1
  'use client';
2
2
 
3
- import { useQueryState } from 'nuqs';
4
-
5
3
  import MobileContentLayout from '@/components/server/MobileNavLayout';
6
4
  import Footer from '@/features/Setting/Footer';
5
+ import { parseAsString, useQueryState } from '@/hooks/useQueryParam';
7
6
  import { SettingsTabs } from '@/store/global/initialState';
8
7
 
9
8
  import SettingsContent from '../SettingsContent';
10
9
  import Header from './Header';
11
10
 
12
11
  const Layout = () => {
13
- const [activeTab] = useQueryState('active', {
14
- defaultValue: SettingsTabs.Common,
15
- });
12
+ const [activeTab] = useQueryState('active', parseAsString.withDefault(SettingsTabs.Common));
16
13
 
17
14
  return (
18
15
  <MobileContentLayout header={<Header />}>
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+ import { Outlet } from 'react-router-dom';
5
+
6
+ import SettingsContextProvider from './ContextProvider';
7
+
8
+ const MobileSettingsWrapper = memo(() => {
9
+ return (
10
+ <SettingsContextProvider
11
+ value={{
12
+ showOpenAIApiKey: true,
13
+ showOpenAIProxyUrl: true,
14
+ }}
15
+ >
16
+ <Outlet />
17
+ </SettingsContextProvider>
18
+ );
19
+ });
20
+
21
+ MobileSettingsWrapper.displayName = 'MobileSettingsWrapper';
22
+
23
+ export default MobileSettingsWrapper;
@@ -1,15 +1,13 @@
1
1
  'use client';
2
2
 
3
- import { useQueryState } from 'nuqs';
4
3
  import { memo } from 'react';
5
4
 
6
5
  import { AgentCategory } from '@/features/AgentSetting';
6
+ import { parseAsString, useQueryState } from '@/hooks/useQueryParam';
7
7
  import { ChatSettingsTabs } from '@/store/global/initialState';
8
8
 
9
9
  const Menu = memo(() => {
10
- const [tab, setTab] = useQueryState('tab', {
11
- defaultValue: ChatSettingsTabs.Prompt,
12
- });
10
+ const [tab, setTab] = useQueryState('tab', parseAsString.withDefault(ChatSettingsTabs.Prompt));
13
11
 
14
12
  return <AgentCategory setTab={setTab} tab={tab} />;
15
13
  });
@@ -4,12 +4,12 @@ import { Tabs } from '@lobehub/ui';
4
4
  import { Skeleton } from 'antd';
5
5
  import { useTheme } from 'antd-style';
6
6
  import isEqual from 'fast-deep-equal';
7
- import { useQueryState } from 'nuqs';
8
7
  import { memo } from 'react';
9
8
 
10
9
  import { INBOX_SESSION_ID } from '@/const/session';
11
10
  import { AgentSettings } from '@/features/AgentSetting';
12
11
  import { useCategory } from '@/features/AgentSetting/AgentCategory/useCategory';
12
+ import { parseAsString, useQueryState } from '@/hooks/useQueryParam';
13
13
  import { ChatSettingsTabs } from '@/store/global/initialState';
14
14
  import { useUserStore } from '@/store/user';
15
15
  import { settingsSelectors } from '@/store/user/selectors';
@@ -24,9 +24,7 @@ type AgentPageType = {
24
24
  const Page = memo((props: AgentPageType) => {
25
25
  const { mobile } = props;
26
26
  const cateItems = useCategory();
27
- const [tab, setTab] = useQueryState('tab', {
28
- defaultValue: ChatSettingsTabs.Prompt,
29
- });
27
+ const [tab, setTab] = useQueryState('tab', parseAsString.withDefault(ChatSettingsTabs.Prompt));
30
28
  const config = useUserStore(settingsSelectors.defaultAgentConfig, isEqual);
31
29
  const meta = useUserStore(settingsSelectors.defaultAgentMeta, isEqual);
32
30
  const [updateAgent, isUserStateInit] = useUserStore((s) => [
@@ -1,8 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { parseAsString, useQueryState } from 'nuqs';
4
-
5
3
  import { isCustomBranding } from '@/const/version';
4
+ import { parseAsString, useQueryParam } from '@/hooks/useQueryParam';
6
5
 
7
6
  import DesktopLayout from '../_layout/Desktop';
8
7
  import MobileLayout from '../_layout/Mobile';
@@ -10,7 +9,7 @@ import ProviderDetailPage from '../detail';
10
9
  import Footer from './Footer';
11
10
 
12
11
  const Page = (props: { mobile?: boolean }) => {
13
- const [Provider, setProvider] = useQueryState('provider', parseAsString.withDefault('all'));
12
+ const [Provider, setProvider] = useQueryParam('provider', parseAsString.withDefault('all'));
14
13
  const { mobile } = props;
15
14
  const ProviderLayout = mobile ? MobileLayout : DesktopLayout;
16
15
  return (
@@ -1,9 +1,9 @@
1
1
  import { Icon } from '@lobehub/ui';
2
2
  import { WalletCards } from 'lucide-react';
3
- import { useSearchParams } from 'next/navigation';
4
3
  import { memo } from 'react';
5
4
  import { useTranslation } from 'react-i18next';
6
5
  import { Center, Flexbox } from 'react-layout-kit';
6
+ import { useSearchParams } from 'react-router-dom';
7
7
 
8
8
  import { useStyles } from './Item';
9
9
 
@@ -13,7 +13,7 @@ const All = memo((props: { onClick: (activeTab: string) => void }) => {
13
13
  const { onClick } = props;
14
14
  const { t } = useTranslation('modelProvider');
15
15
  const { styles, cx } = useStyles();
16
- const searchParams = useSearchParams();
16
+ const [searchParams] = useSearchParams();
17
17
  const activeKey = searchParams.get('provider');
18
18
 
19
19
  return (