@lobehub/lobehub 2.0.0-next.71 → 2.0.0-next.73
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.
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +18 -0
- package/next.config.ts +5 -5
- package/package.json +1 -1
- package/packages/model-bank/src/aiModels/qiniu.ts +126 -0
- package/scripts/prebuild.mts +1 -1
- package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +6 -6
- package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/UserBanner.test.tsx +7 -4
- package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/useCategory.test.tsx +4 -4
- package/src/app/[variants]/(main)/(mobile)/me/(home)/features/UserBanner.tsx +5 -6
- package/src/app/[variants]/(main)/(mobile)/me/(home)/features/useCategory.tsx +5 -8
- package/src/app/[variants]/(main)/(mobile)/me/(home)/index.tsx +25 -0
- package/src/app/[variants]/(main)/(mobile)/me/(home)/layout.tsx +13 -16
- package/src/app/[variants]/(main)/(mobile)/me/profile/features/Category.tsx +6 -6
- package/src/app/[variants]/(main)/(mobile)/me/profile/features/Header.tsx +3 -3
- package/src/app/[variants]/(main)/(mobile)/me/profile/index.tsx +16 -0
- package/src/app/[variants]/(main)/(mobile)/me/profile/layout.tsx +9 -11
- package/src/app/[variants]/(main)/(mobile)/me/settings/features/Header.tsx +3 -3
- package/src/app/[variants]/(main)/(mobile)/me/settings/features/useCategory.tsx +3 -4
- package/src/app/[variants]/(main)/(mobile)/me/settings/index.tsx +16 -0
- package/src/app/[variants]/(main)/(mobile)/me/settings/layout.tsx +15 -13
- package/src/app/[variants]/(main)/changelog/_layout/Desktop/index.tsx +6 -5
- package/src/app/[variants]/(main)/changelog/_layout/Mobile/Header.tsx +3 -3
- package/src/app/[variants]/(main)/changelog/_layout/Mobile/index.tsx +5 -5
- package/src/app/[variants]/(main)/changelog/features/Post.tsx +7 -4
- package/src/app/[variants]/(main)/changelog/index.tsx +55 -0
- package/src/app/[variants]/(main)/chat/_layout/Desktop/index.tsx +6 -7
- package/src/app/[variants]/(main)/chat/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/chat/components/WorkspaceLayout.tsx +1 -14
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatHydration/index.tsx +2 -2
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/MessageFromUrl.tsx +11 -13
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/index.tsx +0 -1
- package/src/app/[variants]/(main)/chat/components/conversation/features/ThreadHydration.tsx +2 -2
- package/src/app/[variants]/(main)/chat/components/topic/features/Topic/TopicListContent/TopicItem/TopicContent.tsx +20 -11
- package/src/app/[variants]/(main)/chat/features/PageTitle/index.tsx +1 -2
- package/src/app/[variants]/(main)/chat/index.tsx +29 -0
- package/src/app/[variants]/(main)/chat/session/features/SessionHydration.tsx +8 -6
- package/src/app/[variants]/(main)/chat/session/features/SessionListContent/Inbox/index.tsx +2 -4
- package/src/app/[variants]/(main)/chat/session/features/SessionListContent/List/index.tsx +1 -1
- package/src/app/[variants]/(main)/chat/session/layout/Mobile/SessionHeader.tsx +3 -3
- package/src/app/[variants]/(main)/chat/settings/_layout/Desktop/Header.tsx +3 -3
- package/src/app/[variants]/(main)/chat/settings/_layout/Mobile/Header.tsx +3 -3
- package/src/app/[variants]/(main)/chat/settings/features/PublishResultModal/index.tsx +3 -3
- package/src/app/[variants]/(main)/chat/{components/SettingsPage.tsx → settings/index.tsx} +6 -35
- package/src/app/[variants]/(main)/components/Link.tsx +21 -0
- package/src/app/[variants]/(main)/discover/(detail)/_layout/{Desktop.tsx → Desktop/index.tsx} +15 -7
- package/src/app/[variants]/(main)/discover/(detail)/_layout/Mobile/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Block.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Overview/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/SystemRole/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Versions/index.tsx +4 -4
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Header.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/ActionButton/AddAgent.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Related/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/TocList/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/StatusPage/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{AssistantDetailPage.tsx → index.tsx} +18 -11
- package/src/app/[variants]/(main)/discover/(detail)/features/Breadcrumb.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/Versions/index.tsx +5 -5
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ServerConfig.tsx +4 -4
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/TocList/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{McpDetailPage.tsx → index.tsx} +15 -7
- package/src/app/[variants]/(main)/discover/(detail)/mcp/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Overview/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Parameter/ParameterItem.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Header.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/ActionButton/ChatWithModel.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/RelatedProviders/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{ModelDetailPage.tsx → index.tsx} +17 -10
- package/src/app/[variants]/(main)/discover/(detail)/model/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/ActionButton/ProviderConfig.tsx +5 -4
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/RelatedModels/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/{ProviderDetailPage.tsx → index.tsx} +17 -10
- package/src/app/[variants]/(main)/discover/(detail)/provider/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(list)/(home)/{HomePage.tsx → index.tsx} +14 -0
- package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/Nav.tsx +2 -3
- package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/index.tsx +4 -3
- package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/Nav.tsx +3 -4
- package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/index.tsx +4 -3
- package/src/app/[variants]/(main)/discover/(list)/assistant/_layout/Desktop.tsx +3 -4
- package/src/app/[variants]/(main)/discover/(list)/assistant/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/List/Item.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(list)/assistant/{AssistantPage.tsx → index.tsx} +18 -4
- package/src/app/[variants]/(main)/discover/(list)/features/SortButton/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(list)/mcp/_layout/Desktop.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/mcp/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/mcp/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/mcp/{McpPage.tsx → index.tsx} +9 -2
- package/src/app/[variants]/(main)/discover/(list)/model/_layout/Desktop.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/model/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/model/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/model/{ModelPage.tsx → index.tsx} +9 -2
- package/src/app/[variants]/(main)/discover/(list)/provider/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/provider/{Client.tsx → index.tsx} +9 -2
- package/src/app/[variants]/(main)/discover/_layout/Desktop/index.tsx +4 -4
- package/src/app/[variants]/(main)/discover/_layout/Mobile/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/components/Title.tsx +1 -1
- package/src/app/[variants]/(main)/discover/features/Search.tsx +2 -2
- package/src/app/[variants]/(main)/discover/features/useNav.tsx +11 -12
- package/src/app/[variants]/(main)/hooks/useActiveTabKey.ts +40 -0
- package/src/app/[variants]/(main)/hooks/usePathname.ts +10 -0
- package/src/app/[variants]/(main)/hooks/useQuery.ts +12 -0
- package/src/app/[variants]/(main)/hooks/useRouter.ts +22 -0
- package/src/app/[variants]/(main)/hooks/useSearchParams.ts +11 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ModelSelect/index.tsx +5 -5
- package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicUrlSync.tsx +1 -1
- package/src/app/[variants]/(main)/image/ComingSoon.tsx +15 -0
- package/src/app/[variants]/(main)/image/_layout/Desktop/index.tsx +5 -2
- package/src/app/[variants]/(main)/image/_layout/DesktopWrapper.tsx +15 -0
- package/src/app/[variants]/(main)/image/_layout/Mobile/index.tsx +3 -1
- package/src/app/[variants]/(main)/image/features/ImageWorkspace/index.tsx +1 -2
- package/src/app/[variants]/(main)/image/index.tsx +18 -0
- package/src/app/[variants]/(main)/knowledge/_layout/Desktop.tsx +17 -0
- package/src/app/[variants]/(main)/knowledge/_layout/Mobile.tsx +17 -0
- package/src/app/[variants]/(main)/knowledge/components/KnowledgeBaseItem/index.tsx +1 -1
- package/src/app/[variants]/(main)/knowledge/components/modal/ModalPageClient.tsx +4 -4
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeBaseDetail/index.tsx +5 -8
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeBaseDetail/menu/Head.tsx +1 -1
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeHome/menu/CategoryMenu.tsx +2 -2
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeHome/menu/KnowledgeBase.tsx +1 -1
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/DesktopLayoutContainer.tsx +3 -2
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/BottomActions.tsx +4 -4
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/TopActions.test.tsx +9 -9
- package/src/app/[variants]/(main)/layouts/desktop/SideBar/TopActions.tsx +117 -0
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/index.tsx +9 -4
- package/src/app/[variants]/(main)/layouts/index.tsx +11 -0
- package/src/app/[variants]/(main)/{_layout/Mobile → layouts/mobile}/NavBar.tsx +5 -5
- package/src/app/[variants]/(main)/{_layout/Mobile → layouts/mobile}/index.tsx +10 -7
- package/src/app/[variants]/(main)/profile/(home)/desktop.tsx +26 -0
- package/src/app/[variants]/(main)/profile/(home)/index.tsx +26 -0
- package/src/app/[variants]/(main)/profile/@category/features/CategoryContent.tsx +5 -7
- package/src/app/[variants]/(main)/profile/_layout/Desktop/index.tsx +3 -2
- package/src/app/[variants]/(main)/profile/_layout/DesktopWrapper.tsx +14 -0
- package/src/app/[variants]/(main)/profile/_layout/Mobile/Header.tsx +3 -3
- package/src/app/[variants]/(main)/profile/_layout/Mobile/index.tsx +4 -3
- package/src/app/[variants]/(main)/profile/apikey/index.tsx +18 -0
- package/src/app/[variants]/(main)/profile/hooks/useCategory.tsx +6 -6
- package/src/app/[variants]/(main)/profile/security/index.tsx +29 -0
- package/src/app/[variants]/(main)/profile/stats/features/AssistantsRank.tsx +4 -4
- package/src/app/[variants]/(main)/profile/stats/features/TopicsRank.tsx +4 -4
- package/src/app/[variants]/(main)/profile/stats/index.tsx +20 -0
- package/src/app/[variants]/(main)/profile/usage/features/UsageTable.tsx +7 -9
- package/src/app/[variants]/(main)/profile/usage/index.tsx +13 -0
- package/src/app/[variants]/(main)/settings/_layout/Desktop/Header.tsx +2 -2
- package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +2 -2
- package/src/app/[variants]/(main)/settings/_layout/DesktopWrapper.tsx +23 -0
- package/src/app/[variants]/(main)/settings/_layout/Mobile/Header.tsx +8 -7
- package/src/app/[variants]/(main)/settings/_layout/Mobile/index.tsx +2 -5
- package/src/app/[variants]/(main)/settings/_layout/MobileWrapper.tsx +23 -0
- package/src/app/[variants]/(main)/settings/agent/AgentMenu/Menu.tsx +2 -4
- package/src/app/[variants]/(main)/settings/agent/index.tsx +2 -4
- package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +2 -3
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/All.tsx +2 -2
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx +38 -37
- package/src/app/[variants]/(main)/settings/provider/_layout/Mobile.tsx +2 -2
- package/src/app/[variants]/(main)/settings/provider/features/CreateNewProvider/index.tsx +3 -3
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx +3 -3
- package/src/app/[variants]/DesktopRouter.tsx +40 -0
- package/src/app/[variants]/MobileRouter.tsx +41 -0
- package/src/app/[variants]/desktopRouter.config.tsx +381 -0
- package/src/app/[variants]/layout.tsx +1 -3
- package/src/app/[variants]/loaders/routeParams.ts +45 -0
- package/src/app/[variants]/loading/Server/Redirect.tsx +1 -1
- package/src/app/[variants]/mobileRouter.config.tsx +412 -0
- package/src/app/[variants]/page.tsx +16 -6
- package/src/app/desktop/devtools/page.tsx +1 -1
- package/src/app/desktop/layout.tsx +1 -1
- package/src/components/BootErrorBoundary/index.tsx +129 -0
- package/src/components/mdx/constants.ts +1 -0
- package/src/features/ChangelogModal/index.tsx +3 -3
- package/src/features/KnowledgeManager/FileExplorer/index.tsx +4 -4
- package/src/features/KnowledgeManager/Header/FilesSearchBar.tsx +1 -1
- package/src/features/User/UserPanel/PanelContent.tsx +4 -3
- package/src/features/User/UserPanel/useMenu.tsx +20 -14
- package/src/features/User/__tests__/PanelContent.test.tsx +13 -7
- package/src/hooks/useDiscoverTab.ts +2 -2
- package/src/hooks/useInterceptingRoutes.test.ts +23 -26
- package/src/hooks/useInterceptingRoutes.ts +5 -4
- package/src/hooks/usePinnedAgentState.ts +6 -6
- package/src/hooks/useQuery.ts +5 -0
- package/src/hooks/useQueryParam.ts +322 -0
- package/src/hooks/useQueryRoute.test.ts +2 -12
- package/src/hooks/useQueryRoute.ts +5 -5
- package/src/hooks/useShowMobileWorkspace.ts +1 -1
- package/src/hooks/useSwitchSession.ts +4 -3
- package/src/layout/GlobalProvider/ImportSettings.tsx +22 -9
- package/src/layout/GlobalProvider/StoreInitialization.tsx +9 -1
- package/src/proxy.ts +13 -1
- package/src/services/message/index.ts +11 -2
- package/src/store/chat/agents/createAgentExecutors.ts +31 -16
- package/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts +218 -0
- package/src/store/chat/slices/aiChat/actions/conversationControl.ts +4 -0
- package/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +9 -3
- package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +142 -61
- package/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +204 -10
- package/src/store/chat/slices/builtinTool/actions/search.ts +51 -26
- package/src/store/chat/slices/message/action.test.ts +182 -33
- package/src/store/chat/slices/message/actions/optimisticUpdate.ts +79 -36
- package/src/store/chat/slices/message/actions/query.ts +7 -5
- package/src/store/chat/slices/message/selectors/dbMessage.ts +11 -4
- package/src/store/chat/slices/plugin/action.test.ts +257 -54
- package/src/store/chat/slices/plugin/actions/optimisticUpdate.ts +63 -26
- package/src/store/chat/slices/plugin/actions/pluginTypes.ts +52 -19
- package/src/store/chat/slices/plugin/actions/publicApi.ts +6 -1
- package/src/store/chat/slices/plugin/actions/workflow.ts +17 -6
- package/src/store/chat/slices/thread/action.ts +2 -0
- package/src/store/global/action.test.ts +3 -3
- package/src/store/global/actions/workspacePane.ts +2 -1
- package/src/store/global/initialState.ts +10 -2
- package/src/store/user/slices/common/action.ts +4 -0
- package/src/app/[variants]/(main)/(mobile)/me/(home)/loading.tsx +0 -38
- package/src/app/[variants]/(main)/(mobile)/me/(home)/page.tsx +0 -40
- package/src/app/[variants]/(main)/(mobile)/me/profile/loading.tsx +0 -5
- package/src/app/[variants]/(main)/(mobile)/me/profile/page.tsx +0 -30
- package/src/app/[variants]/(main)/(mobile)/me/settings/loading.tsx +0 -5
- package/src/app/[variants]/(main)/(mobile)/me/settings/page.tsx +0 -30
- package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx +0 -106
- package/src/app/[variants]/(main)/changelog/layout.tsx +0 -10
- package/src/app/[variants]/(main)/changelog/modal/page.tsx +0 -23
- package/src/app/[variants]/(main)/changelog/page.tsx +0 -78
- package/src/app/[variants]/(main)/chat/ChatRouter.tsx +0 -83
- package/src/app/[variants]/(main)/chat/_layout/ChatLayout.tsx +0 -22
- package/src/app/[variants]/(main)/chat/components/MainChatPage.tsx +0 -25
- package/src/app/[variants]/(main)/chat/error.tsx +0 -3
- package/src/app/[variants]/(main)/chat/layout.tsx +0 -10
- package/src/app/[variants]/(main)/chat/loading.tsx +0 -3
- package/src/app/[variants]/(main)/chat/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/chat/page.tsx +0 -12
- package/src/app/[variants]/(main)/chat/settings/error.tsx +0 -3
- package/src/app/[variants]/(main)/chat/settings/loading.tsx +0 -3
- package/src/app/[variants]/(main)/chat/settings/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/_layout/DetailLayout.tsx +0 -22
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/Client.tsx +0 -51
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/Client.tsx +0 -43
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/Client.tsx +0 -40
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/Client.tsx +0 -40
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(list)/_layout/ListLayout.tsx +0 -22
- package/src/app/[variants]/(main)/discover/(list)/assistant/AssistantLayout.tsx +0 -21
- package/src/app/[variants]/(main)/discover/(list)/mcp/Client.tsx +0 -44
- package/src/app/[variants]/(main)/discover/(list)/mcp/McpLayout.tsx +0 -21
- package/src/app/[variants]/(main)/discover/(list)/model/Client.tsx +0 -44
- package/src/app/[variants]/(main)/discover/(list)/model/ModelLayout.tsx +0 -21
- package/src/app/[variants]/(main)/discover/(list)/provider/ProviderPage.tsx +0 -43
- package/src/app/[variants]/(main)/discover/DiscoverRouter.tsx +0 -170
- package/src/app/[variants]/(main)/discover/[[...path]]/page.tsx +0 -12
- package/src/app/[variants]/(main)/discover/_layout/DiscoverLayout.tsx +0 -22
- package/src/app/[variants]/(main)/discover/error.tsx +0 -3
- package/src/app/[variants]/(main)/discover/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/error.tsx +0 -3
- package/src/app/[variants]/(main)/image/layout.tsx +0 -15
- package/src/app/[variants]/(main)/image/page.tsx +0 -45
- package/src/app/[variants]/(main)/knowledge/KnowledgeRouter.tsx +0 -74
- package/src/app/[variants]/(main)/knowledge/[[...path]]/page.tsx +0 -12
- package/src/app/[variants]/(main)/knowledge/components/modal/page.tsx +0 -13
- package/src/app/[variants]/(main)/knowledge/layout.tsx +0 -12
- package/src/app/[variants]/(main)/layout.tsx +0 -10
- package/src/app/[variants]/(main)/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/profile/apikey/page.tsx +0 -32
- package/src/app/[variants]/(main)/profile/error.tsx +0 -3
- package/src/app/[variants]/(main)/profile/layout.tsx +0 -11
- package/src/app/[variants]/(main)/profile/loading.tsx +0 -3
- package/src/app/[variants]/(main)/profile/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/profile/security/page.tsx +0 -28
- package/src/app/[variants]/(main)/profile/stats/page.tsx +0 -23
- package/src/app/[variants]/(main)/profile/usage/page.tsx +0 -23
- package/src/app/[variants]/@modal/(.)changelog/modal/features/Cover.tsx +0 -48
- package/src/app/[variants]/@modal/(.)changelog/modal/features/Hero.tsx +0 -29
- package/src/app/[variants]/@modal/(.)changelog/modal/features/Post.tsx +0 -57
- package/src/app/[variants]/@modal/(.)changelog/modal/features/PublishedTime.tsx +0 -50
- package/src/app/[variants]/@modal/(.)changelog/modal/features/ReadDetail.tsx +0 -72
- package/src/app/[variants]/@modal/(.)changelog/modal/features/VersionTag.tsx +0 -26
- package/src/app/[variants]/@modal/(.)changelog/modal/layout.tsx +0 -41
- package/src/app/[variants]/@modal/(.)changelog/modal/loading.tsx +0 -10
- package/src/app/[variants]/@modal/(.)changelog/modal/page.tsx +0 -38
- package/src/app/[variants]/@modal/_layout/ModalLayout.tsx +0 -63
- package/src/app/[variants]/@modal/_layout/SettingModalLayout.tsx +0 -71
- package/src/app/[variants]/@modal/default.tsx +0 -3
- package/src/app/[variants]/@modal/error.tsx +0 -3
- package/src/app/[variants]/@modal/layout.tsx +0 -7
- package/src/app/[variants]/@modal/loading.tsx +0 -5
- /package/src/app/[variants]/{@modal/(.)changelog/modal → (main)/changelog}/features/Pagination.tsx +0 -0
- /package/src/app/[variants]/{@modal/(.)changelog/modal → (main)/changelog}/features/UpdateChangelogStatus.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Knowledge.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/KnowledgeItem.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/PluginItem.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Plugins.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Overview/TagList.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/SystemRole/TagList.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Summary/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/loading.tsx → loading.tsx} +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ActionButton/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ConnectionTypeAlert.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Overview/ProviderList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Parameter/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/RelatedProviders/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Guide/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Overview/ModelList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Overview/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Header.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/RelatedModels/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/labs/{page.tsx → index.tsx} +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/RegisterHotkeys.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/Avatar.test.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/Avatar.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/PinList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/index.tsx +0 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const Layout = (
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import MobileContentLayout from "@/components/server/MobileNavLayout";
|
|
2
|
+
import Loading from "@/components/Loading/BrandTextLoading";
|
|
3
|
+
import { Outlet } from "react-router-dom";
|
|
4
|
+
import Header from "./features/Header";
|
|
5
|
+
import { Suspense } from "react";
|
|
6
|
+
|
|
7
|
+
const Layout = () => {
|
|
8
|
+
return <MobileContentLayout header={<Header />} withNav>
|
|
9
|
+
<Suspense fallback={<Loading />}>
|
|
10
|
+
<Outlet />
|
|
11
|
+
</Suspense>
|
|
12
|
+
</MobileContentLayout>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default Layout;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Outlet } from 'react-router-dom';
|
|
2
|
+
|
|
3
|
+
import { Locales } from '@/locales/resources';
|
|
2
4
|
|
|
3
5
|
import Hero from '../../features/Hero';
|
|
4
6
|
import Container from './Container';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Layout = ({ children }: Props) => {
|
|
8
|
+
const Layout = (props: { locale: Locales }) => {
|
|
9
|
+
const { locale } = props;
|
|
9
10
|
return (
|
|
10
11
|
<Container>
|
|
11
12
|
<Hero />
|
|
12
|
-
{
|
|
13
|
+
<Outlet context={{ locale }} />
|
|
13
14
|
</Container>
|
|
14
15
|
);
|
|
15
16
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
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 { mobileHeaderSticky } from '@/styles/mobileHeader';
|
|
10
10
|
|
|
11
11
|
const Header = memo(() => {
|
|
12
12
|
const { t } = useTranslation('changelog');
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const navigate = useNavigate();
|
|
15
15
|
return (
|
|
16
16
|
<ChatHeader
|
|
17
17
|
center={
|
|
@@ -23,7 +23,7 @@ const Header = memo(() => {
|
|
|
23
23
|
}
|
|
24
24
|
/>
|
|
25
25
|
}
|
|
26
|
-
onBackClick={() =>
|
|
26
|
+
onBackClick={() => navigate(-1)}
|
|
27
27
|
showBackButton
|
|
28
28
|
style={mobileHeaderSticky}
|
|
29
29
|
/>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Outlet } from 'react-router-dom';
|
|
2
2
|
|
|
3
3
|
import MobileContentLayout from '@/components/server/MobileNavLayout';
|
|
4
|
+
import { Locales } from '@/locales/resources';
|
|
4
5
|
|
|
5
6
|
import Hero from '../../features/Hero';
|
|
6
7
|
import Header from './Header';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const Layout = ({ children }: Props) => {
|
|
9
|
+
const Layout = (props: { locale: Locales }) => {
|
|
10
|
+
const { locale } = props;
|
|
11
11
|
return (
|
|
12
12
|
<MobileContentLayout header={<Header />} padding={16}>
|
|
13
13
|
<Hero />
|
|
14
|
-
{
|
|
14
|
+
<Outlet context={{ locale }} />
|
|
15
15
|
</MobileContentLayout>
|
|
16
16
|
);
|
|
17
17
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Typography } from '@lobehub/ui';
|
|
2
|
+
import { Image } from '@lobehub/ui/mdx';
|
|
2
3
|
import { Divider } from 'antd';
|
|
3
4
|
import Link from 'next/link';
|
|
5
|
+
import useSWR from 'swr';
|
|
4
6
|
import urlJoin from 'url-join';
|
|
5
7
|
|
|
6
8
|
import { CustomMDX } from '@/components/mdx';
|
|
7
|
-
import Image from '@/components/mdx/Image';
|
|
8
9
|
import { OFFICIAL_SITE } from '@/const/url';
|
|
9
10
|
import { Locales } from '@/locales/resources';
|
|
10
11
|
import { ChangelogService } from '@/server/services/changelog';
|
|
@@ -14,14 +15,16 @@ import GridLayout from './GridLayout';
|
|
|
14
15
|
import PublishedTime from './PublishedTime';
|
|
15
16
|
import VersionTag from './VersionTag';
|
|
16
17
|
|
|
17
|
-
const Post =
|
|
18
|
+
const Post = ({
|
|
18
19
|
id,
|
|
19
20
|
mobile,
|
|
20
21
|
versionRange,
|
|
21
22
|
locale,
|
|
22
23
|
}: ChangelogIndexItem & { branch?: string; locale: Locales; mobile?: boolean }) => {
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const { data } = useSWR([`changelog-post-${id}`, locale], async () => {
|
|
25
|
+
const changelogService = new ChangelogService();
|
|
26
|
+
return await changelogService.getPostById(id, { locale });
|
|
27
|
+
});
|
|
25
28
|
|
|
26
29
|
if (!data || !data.title) return null;
|
|
27
30
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Flexbox } from 'react-layout-kit';
|
|
3
|
+
import { useOutletContext } from 'react-router-dom';
|
|
4
|
+
import useSWR from 'swr';
|
|
5
|
+
|
|
6
|
+
import NotFound from '@/components/404';
|
|
7
|
+
import { Locales } from '@/locales/resources';
|
|
8
|
+
import { ChangelogService } from '@/server/services/changelog';
|
|
9
|
+
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
10
|
+
|
|
11
|
+
import GridLayout from './features/GridLayout';
|
|
12
|
+
import Pagination from './features/Pagination';
|
|
13
|
+
import Post from './features/Post';
|
|
14
|
+
import UpdateChangelogStatus from './features/UpdateChangelogStatus';
|
|
15
|
+
|
|
16
|
+
const Page = (props: { isMobile: boolean }) => {
|
|
17
|
+
const { locale } = useOutletContext<{ locale: Locales }>();
|
|
18
|
+
const { isMobile } = props;
|
|
19
|
+
const { hideDocs } = useServerConfigStore(featureFlagsSelectors);
|
|
20
|
+
|
|
21
|
+
const { data } = useSWR('changelog-index', async () => {
|
|
22
|
+
const changelogService = new ChangelogService();
|
|
23
|
+
return await changelogService.getChangelogIndex();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
if (hideDocs) return <NotFound />;
|
|
27
|
+
|
|
28
|
+
if (!data) return <NotFound />;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<Flexbox gap={isMobile ? 16 : 48}>
|
|
33
|
+
{data?.map((item) => (
|
|
34
|
+
<Fragment key={item.id}>
|
|
35
|
+
<Post locale={locale} mobile={isMobile} {...item} />
|
|
36
|
+
</Fragment>
|
|
37
|
+
))}
|
|
38
|
+
</Flexbox>
|
|
39
|
+
<GridLayout>
|
|
40
|
+
<Pagination />
|
|
41
|
+
</GridLayout>
|
|
42
|
+
<UpdateChangelogStatus currentId={data[0]?.id} />
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const DesktopPage = () => {
|
|
48
|
+
return <Page isMobile={false} />;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const MobilePage = () => {
|
|
52
|
+
return <Page isMobile={true} />;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { DesktopPage, MobilePage };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { Suspense } from 'react';
|
|
2
1
|
import { Flexbox } from 'react-layout-kit';
|
|
2
|
+
import { Outlet } from 'react-router-dom';
|
|
3
3
|
|
|
4
4
|
import { isDesktop } from '@/const/version';
|
|
5
5
|
import ProtocolUrlHandler from '@/features/ProtocolUrlHandler';
|
|
6
6
|
|
|
7
|
-
import { LayoutProps } from '../type';
|
|
8
7
|
import RegisterHotkeys from './RegisterHotkeys';
|
|
9
8
|
import SessionPanel from './SessionPanel';
|
|
10
9
|
import Workspace from './Workspace';
|
|
11
10
|
|
|
12
|
-
const Layout = (
|
|
11
|
+
const Layout = () => {
|
|
13
12
|
return (
|
|
14
13
|
<>
|
|
15
14
|
<Flexbox
|
|
@@ -19,14 +18,14 @@ const Layout = ({ children }: LayoutProps) => {
|
|
|
19
18
|
width={'100%'}
|
|
20
19
|
>
|
|
21
20
|
<SessionPanel />
|
|
22
|
-
<Workspace>
|
|
21
|
+
<Workspace>
|
|
22
|
+
<Outlet />
|
|
23
|
+
</Workspace>
|
|
23
24
|
</Flexbox>
|
|
24
25
|
{/* ↓ cloud slot ↓ */}
|
|
25
26
|
|
|
26
27
|
{/* ↑ cloud slot ↑ */}
|
|
27
|
-
<
|
|
28
|
-
<RegisterHotkeys />
|
|
29
|
-
</Suspense>
|
|
28
|
+
<RegisterHotkeys />
|
|
30
29
|
{isDesktop && <ProtocolUrlHandler />}
|
|
31
30
|
</>
|
|
32
31
|
);
|
|
@@ -8,7 +8,7 @@ import { withSuspense } from '@/components/withSuspense';
|
|
|
8
8
|
import { useShowMobileWorkspace } from '@/hooks/useShowMobileWorkspace';
|
|
9
9
|
|
|
10
10
|
import SessionPanelContent from '../components/SessionPanel';
|
|
11
|
-
import {
|
|
11
|
+
import { Outlet } from 'react-router-dom';
|
|
12
12
|
|
|
13
13
|
const useStyles = createStyles(({ css, token }) => ({
|
|
14
14
|
main: css`
|
|
@@ -18,7 +18,7 @@ const useStyles = createStyles(({ css, token }) => ({
|
|
|
18
18
|
`,
|
|
19
19
|
}));
|
|
20
20
|
|
|
21
|
-
const Layout = memo
|
|
21
|
+
const Layout = memo(( ) => {
|
|
22
22
|
const showMobileWorkspace = useShowMobileWorkspace();
|
|
23
23
|
const { styles } = useStyles();
|
|
24
24
|
|
|
@@ -38,7 +38,7 @@ const Layout = memo<LayoutProps>(({ children }) => {
|
|
|
38
38
|
style={showMobileWorkspace ? undefined : { display: 'none' }}
|
|
39
39
|
width="100%"
|
|
40
40
|
>
|
|
41
|
-
|
|
41
|
+
<Outlet />
|
|
42
42
|
</Flexbox>
|
|
43
43
|
</>
|
|
44
44
|
);
|
|
@@ -14,9 +14,6 @@ import ConversationArea from './ConversationArea';
|
|
|
14
14
|
import PortalPanel from './PortalPanel';
|
|
15
15
|
import TopicSidebar from './TopicSidebar';
|
|
16
16
|
|
|
17
|
-
interface WorkspaceLayoutProps {
|
|
18
|
-
mobile?: boolean;
|
|
19
|
-
}
|
|
20
17
|
|
|
21
18
|
const DesktopWorkspace = memo(() => (
|
|
22
19
|
<>
|
|
@@ -60,14 +57,4 @@ const MobileWorkspace = memo(() => (
|
|
|
60
57
|
|
|
61
58
|
MobileWorkspace.displayName = 'MobileWorkspace';
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
if (mobile) {
|
|
65
|
-
return <MobileWorkspace />;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return <DesktopWorkspace />;
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
WorkspaceLayout.displayName = 'WorkspaceLayout';
|
|
72
|
-
|
|
73
|
-
export default WorkspaceLayout;
|
|
60
|
+
export { DesktopWorkspace, MobileWorkspace };
|
package/src/app/[variants]/(main)/chat/components/conversation/features/ChatHydration/index.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useQueryState } from 'nuqs';
|
|
4
3
|
import { memo, useLayoutEffect } from 'react';
|
|
5
4
|
import { createStoreUpdater } from 'zustand-utils';
|
|
6
5
|
|
|
6
|
+
import { useQueryState } from '@/hooks/useQueryParam';
|
|
7
7
|
import { useChatStore } from '@/store/chat';
|
|
8
8
|
|
|
9
9
|
// sync outside state to useChatStore
|
|
@@ -34,7 +34,7 @@ const ChatHydration = memo(() => {
|
|
|
34
34
|
unsubscribeTopic();
|
|
35
35
|
unsubscribeThread();
|
|
36
36
|
};
|
|
37
|
-
}, []);
|
|
37
|
+
}, [setTopic, setThread]); // ✅ 现在 setValue 是稳定的,可以安全地添加到依赖数组
|
|
38
38
|
|
|
39
39
|
return null;
|
|
40
40
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useSearchParams } from 'next/navigation';
|
|
4
3
|
import { useEffect } from 'react';
|
|
4
|
+
import { useSearchParams } from 'react-router-dom';
|
|
5
5
|
|
|
6
6
|
import { useChatStore } from '@/store/chat';
|
|
7
7
|
|
|
@@ -10,21 +10,19 @@ import { useSend } from '../useSend';
|
|
|
10
10
|
const MessageFromUrl = () => {
|
|
11
11
|
const updateMessageInput = useChatStore((s) => s.updateMessageInput);
|
|
12
12
|
const { send: sendMessage } = useSend();
|
|
13
|
-
const searchParams = useSearchParams();
|
|
13
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
14
14
|
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
const message = searchParams.get('message');
|
|
17
|
-
if (message)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
}, [searchParams, updateMessageInput, sendMessage]);
|
|
17
|
+
if (!message) return;
|
|
18
|
+
|
|
19
|
+
const params = new URLSearchParams(searchParams.toString());
|
|
20
|
+
params.delete('message');
|
|
21
|
+
setSearchParams(params, { replace: true });
|
|
22
|
+
|
|
23
|
+
updateMessageInput(message);
|
|
24
|
+
sendMessage();
|
|
25
|
+
}, [searchParams, setSearchParams, updateMessageInput, sendMessage]);
|
|
28
26
|
|
|
29
27
|
return null;
|
|
30
28
|
};
|
package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/index.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import GroupChatInput from './GroupChat';
|
|
|
10
10
|
|
|
11
11
|
const Desktop = memo((props: { targetMemberId?: string }) => {
|
|
12
12
|
const isGroupSession = useSessionStore(sessionSelectors.isCurrentSessionGroupSession);
|
|
13
|
-
|
|
14
13
|
return isGroupSession ? <GroupChatInput {...props} /> : <ClassicChatInput />;
|
|
15
14
|
});
|
|
16
15
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useQueryState } from 'nuqs';
|
|
4
3
|
import { memo, useEffect, useLayoutEffect } from 'react';
|
|
5
4
|
import { createStoreUpdater } from 'zustand-utils';
|
|
6
5
|
|
|
7
6
|
import { useFetchThreads } from '@/hooks/useFetchThreads';
|
|
7
|
+
import { useQueryState } from '@/hooks/useQueryParam';
|
|
8
8
|
import { useChatStore } from '@/store/chat';
|
|
9
9
|
|
|
10
10
|
// sync outside state to useChatStore
|
|
@@ -26,7 +26,7 @@ const ThreadHydration = memo(() => {
|
|
|
26
26
|
return () => {
|
|
27
27
|
unsubscribe();
|
|
28
28
|
};
|
|
29
|
-
}, []);
|
|
29
|
+
}, [setThread]); // ✅ 现在 setValue 是稳定的,可以安全地添加到依赖数组
|
|
30
30
|
|
|
31
31
|
// should open portal automatically when portalThread is set
|
|
32
32
|
useEffect(() => {
|
|
@@ -97,15 +97,15 @@ const TopicContent = memo<TopicContentProps>(({ id, title, fav, showMore }) => {
|
|
|
97
97
|
},
|
|
98
98
|
...(isDesktop
|
|
99
99
|
? [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
{
|
|
101
|
+
icon: <Icon icon={ExternalLink} />,
|
|
102
|
+
key: 'openInNewWindow',
|
|
103
|
+
label: t('actions.openInNewWindow'),
|
|
104
|
+
onClick: () => {
|
|
105
|
+
openTopicInNewWindow(activeId, id);
|
|
106
|
+
},
|
|
106
107
|
},
|
|
107
|
-
|
|
108
|
-
]
|
|
108
|
+
]
|
|
109
109
|
: []),
|
|
110
110
|
{
|
|
111
111
|
type: 'divider',
|
|
@@ -153,7 +153,16 @@ const TopicContent = memo<TopicContentProps>(({ id, title, fav, showMore }) => {
|
|
|
153
153
|
},
|
|
154
154
|
},
|
|
155
155
|
],
|
|
156
|
-
[
|
|
156
|
+
[
|
|
157
|
+
id,
|
|
158
|
+
activeId,
|
|
159
|
+
autoRenameTopicTitle,
|
|
160
|
+
duplicateTopic,
|
|
161
|
+
removeTopic,
|
|
162
|
+
t,
|
|
163
|
+
toggleEditing,
|
|
164
|
+
openTopicInNewWindow,
|
|
165
|
+
],
|
|
157
166
|
);
|
|
158
167
|
|
|
159
168
|
return (
|
|
@@ -180,7 +189,7 @@ const TopicContent = memo<TopicContentProps>(({ id, title, fav, showMore }) => {
|
|
|
180
189
|
spin={isLoading}
|
|
181
190
|
/>
|
|
182
191
|
{!editing ? (
|
|
183
|
-
title === LOADING_FLAT ? (
|
|
192
|
+
title === LOADING_FLAT || (isLoading && !title) ? (
|
|
184
193
|
<Flexbox flex={1} height={28} justify={'center'}>
|
|
185
194
|
<BubblesLoading />
|
|
186
195
|
</Flexbox>
|
|
@@ -190,7 +199,7 @@ const TopicContent = memo<TopicContentProps>(({ id, title, fav, showMore }) => {
|
|
|
190
199
|
ellipsis={{ rows: 1, tooltip: { placement: 'left', title } }}
|
|
191
200
|
onDoubleClick={() => {
|
|
192
201
|
if (isDesktop) {
|
|
193
|
-
openTopicInNewWindow(activeId, id)
|
|
202
|
+
openTopicInNewWindow(activeId, id);
|
|
194
203
|
}
|
|
195
204
|
}}
|
|
196
205
|
style={{ margin: 0 }}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
|
|
5
5
|
import PageTitle from '@/components/PageTitle';
|
|
6
|
-
import { withSuspense } from '@/components/withSuspense';
|
|
7
6
|
import { useChatStore } from '@/store/chat';
|
|
8
7
|
import { topicSelectors } from '@/store/chat/selectors';
|
|
9
8
|
import { useSessionStore } from '@/store/session';
|
|
@@ -16,4 +15,4 @@ const Title = memo(() => {
|
|
|
16
15
|
return <PageTitle title={[topicTitle, agentTitle].filter(Boolean).join(' · ')} />;
|
|
17
16
|
});
|
|
18
17
|
|
|
19
|
-
export default
|
|
18
|
+
export default Title;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
|
|
5
|
+
import { DesktopWorkspace, MobileWorkspace } from './components/WorkspaceLayout';
|
|
6
|
+
import TelemetryNotification from './components/features/TelemetryNotification';
|
|
7
|
+
import PageTitle from './features/PageTitle';
|
|
8
|
+
|
|
9
|
+
const MobileChatPage = memo(() => {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<PageTitle />
|
|
13
|
+
<MobileWorkspace />
|
|
14
|
+
<TelemetryNotification mobile={true} />
|
|
15
|
+
</>
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const DesktopChatPage = memo(() => {
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<PageTitle />
|
|
23
|
+
<DesktopWorkspace />
|
|
24
|
+
<TelemetryNotification mobile={false} />
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { DesktopChatPage, MobileChatPage };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useQueryState } from 'nuqs';
|
|
4
|
-
import { parseAsString } from 'nuqs/server';
|
|
5
3
|
import { memo, useEffect } from 'react';
|
|
6
4
|
import { createStoreUpdater } from 'zustand-utils';
|
|
7
5
|
|
|
6
|
+
import { parseAsString, useQueryParam } from '@/hooks/useQueryParam';
|
|
8
7
|
import { useAgentStore } from '@/store/agent';
|
|
9
8
|
import { useChatStore } from '@/store/chat';
|
|
10
9
|
import { useSessionStore } from '@/store/session';
|
|
11
10
|
|
|
11
|
+
const THROTTLE_DELAY = 50;
|
|
12
|
+
|
|
12
13
|
// sync outside state to useSessionStore
|
|
13
14
|
const SessionHydration = memo(() => {
|
|
14
15
|
const useStoreUpdater = createStoreUpdater(useSessionStore);
|
|
@@ -17,10 +18,11 @@ const SessionHydration = memo(() => {
|
|
|
17
18
|
const [switchTopic] = useChatStore((s) => [s.switchTopic]);
|
|
18
19
|
|
|
19
20
|
// two-way bindings the url and session store
|
|
20
|
-
const [session, setSession] =
|
|
21
|
-
'
|
|
22
|
-
|
|
23
|
-
);
|
|
21
|
+
const [session, setSession] = useQueryParam('session', parseAsString.withDefault('inbox'), {
|
|
22
|
+
history: 'replace',
|
|
23
|
+
throttleMs: THROTTLE_DELAY,
|
|
24
|
+
});
|
|
25
|
+
|
|
24
26
|
useStoreUpdater('activeId', session);
|
|
25
27
|
useAgentStoreUpdater('activeId', session);
|
|
26
28
|
useChatStoreUpdater('activeId', session);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Link from 'next/link';
|
|
2
1
|
import { memo } from 'react';
|
|
3
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
4
|
|
|
5
5
|
import { DEFAULT_INBOX_AVATAR } from '@/const/meta';
|
|
6
6
|
import { INBOX_SESSION_ID } from '@/const/session';
|
|
@@ -24,15 +24,12 @@ const Inbox = memo(() => {
|
|
|
24
24
|
return (
|
|
25
25
|
<Link
|
|
26
26
|
aria-label={t('inbox.title')}
|
|
27
|
-
href={SESSION_CHAT_URL(INBOX_SESSION_ID, mobile)}
|
|
28
27
|
onClick={async (e) => {
|
|
29
28
|
e.preventDefault();
|
|
30
|
-
|
|
31
29
|
if (activeId === INBOX_SESSION_ID && !mobile) {
|
|
32
30
|
// If user tap the inbox again, open a new topic.
|
|
33
31
|
// Only for desktop.
|
|
34
32
|
const inboxMessages = chatSelectors.inboxActiveTopicMessages(getChatStoreState());
|
|
35
|
-
|
|
36
33
|
if (inboxMessages.length > 0) {
|
|
37
34
|
await openNewTopicOrSaveTopic();
|
|
38
35
|
}
|
|
@@ -40,6 +37,7 @@ const Inbox = memo(() => {
|
|
|
40
37
|
switchSession(INBOX_SESSION_ID);
|
|
41
38
|
}
|
|
42
39
|
}}
|
|
40
|
+
to={SESSION_CHAT_URL(INBOX_SESSION_ID, mobile)}
|
|
43
41
|
>
|
|
44
42
|
<ListItem
|
|
45
43
|
active={activeId === INBOX_SESSION_ID}
|
|
@@ -9,8 +9,8 @@ import LazyLoad from 'react-lazy-load';
|
|
|
9
9
|
|
|
10
10
|
import { SESSION_CHAT_URL } from '@/const/url';
|
|
11
11
|
import { useSwitchSession } from '@/hooks/useSwitchSession';
|
|
12
|
+
import { useSessionStore, getSessionStoreState } from '@/store/session';
|
|
12
13
|
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
13
|
-
import { getSessionStoreState, useSessionStore } from '@/store/session';
|
|
14
14
|
import { sessionGroupSelectors, sessionSelectors } from '@/store/session/selectors';
|
|
15
15
|
import { getUserStoreState } from '@/store/user';
|
|
16
16
|
import { userProfileSelectors } from '@/store/user/selectors';
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { ActionIcon } from '@lobehub/ui';
|
|
4
4
|
import { ChatHeader } from '@lobehub/ui/mobile';
|
|
5
5
|
import { MessageSquarePlus } from 'lucide-react';
|
|
6
|
-
import { useRouter } from 'next/navigation';
|
|
7
6
|
import { memo } from 'react';
|
|
7
|
+
import { useNavigate } from 'react-router-dom';
|
|
8
8
|
import { Flexbox } from 'react-layout-kit';
|
|
9
9
|
|
|
10
10
|
import { ProductLogo } from '@/components/Branding';
|
|
@@ -16,14 +16,14 @@ import { mobileHeaderSticky } from '@/styles/mobileHeader';
|
|
|
16
16
|
|
|
17
17
|
const Header = memo(() => {
|
|
18
18
|
const [createSession] = useSessionStore((s) => [s.createSession]);
|
|
19
|
-
const
|
|
19
|
+
const navigate = useNavigate();
|
|
20
20
|
const { showCreateSession } = useServerConfigStore(featureFlagsSelectors);
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<ChatHeader
|
|
24
24
|
left={
|
|
25
25
|
<Flexbox align={'center'} gap={8} horizontal style={{ marginLeft: 8 }}>
|
|
26
|
-
<UserAvatar onClick={() =>
|
|
26
|
+
<UserAvatar onClick={() => navigate('/me')} size={32} />
|
|
27
27
|
<ProductLogo type={'text'} />
|
|
28
28
|
</Flexbox>
|
|
29
29
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { ChatHeader, ChatHeaderTitle } from '@lobehub/ui/chat';
|
|
4
|
-
import { useRouter } from 'next/navigation';
|
|
5
4
|
import { memo } from 'react';
|
|
6
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { useNavigate } from 'react-router-dom';
|
|
7
7
|
|
|
8
8
|
import { pathString } from '@/utils/url';
|
|
9
9
|
|
|
@@ -11,12 +11,12 @@ import HeaderContent from '../../features/HeaderContent';
|
|
|
11
11
|
|
|
12
12
|
const Header = memo(() => {
|
|
13
13
|
const { t } = useTranslation('setting');
|
|
14
|
-
const
|
|
14
|
+
const navigate = useNavigate();
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<ChatHeader
|
|
18
18
|
left={<ChatHeaderTitle title={t('header.session')} />}
|
|
19
|
-
onBackClick={() =>
|
|
19
|
+
onBackClick={() => navigate(pathString('/chat', { search: location.search }))}
|
|
20
20
|
right={<HeaderContent />}
|
|
21
21
|
showBackButton
|
|
22
22
|
/>
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
import { ChatHeader } from '@lobehub/ui/mobile';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { useNavigate } from 'react-router-dom';
|
|
6
7
|
|
|
7
|
-
import { useQueryRoute } from '@/hooks/useQueryRoute';
|
|
8
8
|
import { mobileHeaderSticky } from '@/styles/mobileHeader';
|
|
9
9
|
|
|
10
10
|
import HeaderContent from '../../features/HeaderContent';
|
|
11
11
|
|
|
12
12
|
const Header = memo(() => {
|
|
13
13
|
const { t } = useTranslation('setting');
|
|
14
|
-
const
|
|
14
|
+
const navigate = useNavigate();
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<ChatHeader
|
|
18
18
|
center={<ChatHeader.Title title={t('header.session')} />}
|
|
19
|
-
onBackClick={() =>
|
|
19
|
+
onBackClick={() => navigate(-1)}
|
|
20
20
|
right={<HeaderContent />}
|
|
21
21
|
showBackButton
|
|
22
22
|
style={mobileHeaderSticky}
|