🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
♻️ refactor(routes): move six route domains into src/features (#17964)
Innei8de42d5c37af
diff --git a/eslint.config.mjs b/eslint.config.mjsindex 9b6de3b3d94..ff088adfdbe 100644--- a/eslint.config.mjs+++ b/eslint.config.mjs@@ -228,11 +228,39 @@ export default eslint(},},{- files: ['src/features/Home/**/*.{ts,tsx}', 'src/routes/(main)/home/**/*.{ts,tsx}'],- ignores: [- 'src/routes/(main)/home/_layout/hooks/useCreateModal.tsx',- 'src/features/Home/InputArea/EditorInput.tsx',+ files: [+ 'src/features/Home/**/*.{ts,tsx}',+ 'src/features/HomeLayout/**/*.{ts,tsx}',+ 'src/routes/(main)/home/**/*.{ts,tsx}',],+ ignores: ['src/features/Home/InputArea/EditorInput.tsx'],+ rules: {+ 'no-restricted-imports': createRestrictedImportRule({+ paths: [+ {+ message:+ 'Home cold-path modules must use stable Conversation subpaths instead of the root barrel that exports ChatInput.',+ name: '@/features/Conversation',+ },+ ],+ patterns: [+ {+ message:+ 'Home cold-path modules must not statically import ChatInput. Load an isolated editor entry with import().',+ regex:+ '^@/features/ChatInput(?:$|/(?!(?:store/initialState|utils/contextSelections)$).+)',+ },+ ],+ }),+ },+ },+ {+ // The home sidebar tree carries both sets of constraints: it is a shell tree+ // rendered outside TabHost, and it is also a home cold path. Flat config+ // replaces `no-restricted-imports` rather than merging it, so the shell paths+ // have to be repeated here instead of relying on the shell block above.+ files: ['src/features/HomeSidebar/**/*.{ts,tsx}'],+ ignores: ['src/features/HomeSidebar/hooks/useCreateModal.tsx'],rules: {'no-restricted-imports': createRestrictedImportRule({paths: [@@ -241,6 +269,7 @@ export default eslint('Home cold-path modules must use stable Conversation subpaths instead of the root barrel that exports ChatInput.',name: '@/features/Conversation',},+ ...shellRouterRestrictedPaths,],patterns: [{diff --git a/src/features/AgentSidebar/Header/Agent/SwitchPanel.tsx b/src/features/AgentSidebar/Header/Agent/SwitchPanel.tsxindex b74719f9bff..d52e0bb5e7b 100644--- a/src/features/AgentSidebar/Header/Agent/SwitchPanel.tsx+++ b/src/features/AgentSidebar/Header/Agent/SwitchPanel.tsx@@ -5,12 +5,12 @@ import { memo, Suspense, useCallback, useMemo } from 'react';import { useTranslation } from 'react-i18next';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';+import AgentListContent from '@/features/HomeSidebar/Body/Agent/List/AgentListContent';+import { AgentModalProvider } from '@/features/HomeSidebar/Body/Agent/ModalProvider';+import PrivateList from '@/features/HomeSidebar/Body/Private/List';import SkeletonList from '@/features/NavPanel/components/SkeletonList';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { useFetchAgentList } from '@/hooks/useFetchAgentList';-import AgentListContent from '@/routes/(main)/home/_layout/Body/Agent/List/AgentListContent';-import { AgentModalProvider } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';-import PrivateList from '@/routes/(main)/home/_layout/Body/Private/List';import { useHomeStore } from '@/store/home';import { homeAgentListSelectors } from '@/store/home/selectors';diff --git a/src/features/AgentTaskManager/AgentSelectorAction.test.tsx b/src/features/AgentTaskManager/AgentSelectorAction.test.tsxindex d88b9bbcfab..ed1490e6686 100644--- a/src/features/AgentTaskManager/AgentSelectorAction.test.tsx+++ b/src/features/AgentTaskManager/AgentSelectorAction.test.tsx@@ -113,11 +113,11 @@ vi.mock('@/hooks/useFetchAgentList', () => ({useFetchAgentList: () => mocks.fetchAgentList(),}));-vi.mock('@/routes/(main)/home/_layout/Body/Agent/List/AgentItem/Avatar', () => ({+vi.mock('@/features/HomeSidebar/Body/Agent/List/AgentItem/Avatar', () => ({default: ({ avatar }: { avatar?: string }) => <span data-avatar={avatar} data-testid="avatar" />,}));-vi.mock('@/routes/(main)/home/_layout/Body/Agent/ModalProvider', () => ({+vi.mock('@/features/HomeSidebar/Body/Agent/ModalProvider', () => ({AgentModalProvider: ({ children }: { children: ReactNode }) => <>{children}</>,}));diff --git a/src/features/AgentTaskManager/AgentSelectorAction.tsx b/src/features/AgentTaskManager/AgentSelectorAction.tsxindex 8103833fc90..eb534172573 100644--- a/src/features/AgentTaskManager/AgentSelectorAction.tsx+++ b/src/features/AgentTaskManager/AgentSelectorAction.tsx@@ -8,11 +8,11 @@ import { useTranslation } from 'react-i18next';import { type SidebarAgentItem } from '@/database/repositories/home';import { conversationSelectors, useConversationStore } from '@/features/Conversation';+import AgentAvatar from '@/features/HomeSidebar/Body/Agent/List/AgentItem/Avatar';+import { AgentModalProvider } from '@/features/HomeSidebar/Body/Agent/ModalProvider';import SkeletonList from '@/features/NavPanel/components/SkeletonList';import AgentItem from '@/features/PageEditor/Copilot/AgentSelector/AgentItem';import { useFetchAgentList } from '@/hooks/useFetchAgentList';-import AgentAvatar from '@/routes/(main)/home/_layout/Body/Agent/List/AgentItem/Avatar';-import { AgentModalProvider } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';import { useAgentStore } from '@/store/agent';import { builtinAgentSelectors } from '@/store/agent/selectors';import { useHomeStore } from '@/store/home';diff --git a/src/features/AgentViewAll/AgentViewAllPage.tsx b/src/features/AgentViewAll/AgentViewAllPage.tsxindex 8a3afa97e96..d2abb14a5c1 100644--- a/src/features/AgentViewAll/AgentViewAllPage.tsx+++ b/src/features/AgentViewAll/AgentViewAllPage.tsx@@ -14,16 +14,16 @@ import { useSearchParams } from 'react-router';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import { useWorkspaceMembers } from '@/business/client/hooks/useWorkspaceMembers';+import { useKeepSidebarGroupsListed } from '@/features/HomeSidebar/Body/Agent/List/useAgentList';+import { AgentModalProvider } from '@/features/HomeSidebar/Body/Agent/ModalProvider';+import { useSidebarItemVisibility } from '@/features/HomeSidebar/Body/Agent/useSidebarItemVisibility';+import { useCreateMenuItems } from '@/features/HomeSidebar/hooks';import NavHeader from '@/features/NavHeader';import SkeletonList from '@/features/NavPanel/components/SkeletonList';import WideScreenContainer from '@/features/WideScreenContainer';import { useFetchAgentLabels } from '@/hooks/useFetchAgentLabels';import { useFetchAgentList } from '@/hooks/useFetchAgentList';import { usePermission } from '@/hooks/usePermission';-import { useKeepSidebarGroupsListed } from '@/routes/(main)/home/_layout/Body/Agent/List/useAgentList';-import { AgentModalProvider } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';-import { useSidebarItemVisibility } from '@/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility';-import { useCreateMenuItems } from '@/routes/(main)/home/_layout/hooks';import { useGlobalStore } from '@/store/global';import { systemStatusSelectors } from '@/store/global/selectors';import { useHomeStore } from '@/store/home';diff --git a/src/features/AgentViewAll/ItemActions.tsx b/src/features/AgentViewAll/ItemActions.tsxindex 9a646997d49..ded12e5a5b2 100644--- a/src/features/AgentViewAll/ItemActions.tsx+++ b/src/features/AgentViewAll/ItemActions.tsx@@ -8,9 +8,9 @@ import { EllipsisIcon, EyeIcon, EyeOffIcon } from 'lucide-react';import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';-import { useGroupDropdownMenu } from '@/routes/(main)/home/_layout/Body/Agent/List/AgentGroupItem/useDropdownMenu';-import { useAgentDropdownMenu } from '@/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu';-import { useAgentModal } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';+import { useGroupDropdownMenu } from '@/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu';+import { useAgentDropdownMenu } from '@/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu';+import { useAgentModal } from '@/features/HomeSidebar/Body/Agent/ModalProvider';type MenuItems = NonNullable<MenuProps['items']>;diff --git a/src/features/CommandMenu/useCommandMenu.ts b/src/features/CommandMenu/useCommandMenu.tsindex 5cf1ca34c5d..0d696e7e2e9 100644--- a/src/features/CommandMenu/useCommandMenu.ts+++ b/src/features/CommandMenu/useCommandMenu.ts@@ -5,12 +5,12 @@ import useSWR from 'swr';import { isDesktop } from '@/const/version';import { type SearchResult } from '@/database/repositories/search';+import { useCreateMenuItems } from '@/features/HomeSidebar/hooks';import { useCreateNewModal } from '@/features/LibraryModal';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { usePermission } from '@/hooks/usePermission';import { useGroupWizard } from '@/layout/GlobalProvider/GroupWizardProvider';import { lambdaClient } from '@/libs/trpc/client';-import { useCreateMenuItems } from '@/routes/(main)/home/_layout/hooks';import { electronSystemService } from '@/services/electron/system';import { useAgentStore } from '@/store/agent';import { builtinAgentSelectors } from '@/store/agent/selectors/builtinAgentSelectors';diff --git a/src/features/Conversation/MessageForward/ForwardModal.tsx b/src/features/Conversation/MessageForward/ForwardModal.tsxindex 7bc8cbe2950..c00f9e7e69e 100644--- a/src/features/Conversation/MessageForward/ForwardModal.tsx+++ b/src/features/Conversation/MessageForward/ForwardModal.tsx@@ -9,8 +9,8 @@ import { t as translate } from 'i18next';import { memo, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';+import AgentAvatar from '@/features/HomeSidebar/Body/Agent/List/AgentItem/Avatar';import { useFetchAgentList } from '@/hooks/useFetchAgentList';-import AgentAvatar from '@/routes/(main)/home/_layout/Body/Agent/List/AgentItem/Avatar';import { useHomeStore } from '@/store/home';import { homeAgentListSelectors } from '@/store/home/selectors';diff --git a/src/features/Conversation/MessageForward/TopicForwardModal/Content.tsx b/src/features/Conversation/MessageForward/TopicForwardModal/Content.tsxindex 48461c97242..87d50f82cce 100644--- a/src/features/Conversation/MessageForward/TopicForwardModal/Content.tsx+++ b/src/features/Conversation/MessageForward/TopicForwardModal/Content.tsx@@ -6,8 +6,8 @@ import { createStaticStyles, cssVar, cx } from 'antd-style';import { useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';+import AgentAvatar from '@/features/HomeSidebar/Body/Agent/List/AgentItem/Avatar';import { useFetchAgentList } from '@/hooks/useFetchAgentList';-import AgentAvatar from '@/routes/(main)/home/_layout/Body/Agent/List/AgentItem/Avatar';import { useHomeStore } from '@/store/home';import { homeAgentListSelectors } from '@/store/home/selectors';diff --git a/src/features/DesktopFileMenuBridge/index.tsx b/src/features/DesktopFileMenuBridge/index.tsxindex 5e6569dc042..02459eab511 100644--- a/src/features/DesktopFileMenuBridge/index.tsx+++ b/src/features/DesktopFileMenuBridge/index.tsx@@ -4,8 +4,8 @@ import { AGENT_CHAT_URL } from '@lobechat/const';import { useWatchBroadcast } from '@lobechat/electron-client-ipc';import { useCallback } from 'react';+import { useCreateMenuItems } from '@/features/HomeSidebar/hooks/useCreateMenuItems';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import { useCreateMenuItems } from '@/routes/(main)/home/_layout/hooks/useCreateMenuItems';import { useAgentStore } from '@/store/agent';import { builtinAgentSelectors } from '@/store/agent/selectors';import { useChatStore } from '@/store/chat';diff --git a/src/routes/(desktop)/desktop-onboarding/_layout/index.tsx b/src/features/DesktopOnboarding/Layout/index.tsxsimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/_layout/index.tsxrename to src/features/DesktopOnboarding/Layout/index.tsxdiff --git a/src/routes/(desktop)/desktop-onboarding/_layout/style.ts b/src/features/DesktopOnboarding/Layout/style.tssimilarity index 68%rename from src/routes/(desktop)/desktop-onboarding/_layout/style.tsrename to src/features/DesktopOnboarding/Layout/style.tsindex ca867a507cc..f7375f39a63 100644--- a/src/routes/(desktop)/desktop-onboarding/_layout/style.ts+++ b/src/features/DesktopOnboarding/Layout/style.ts@@ -15,9 +15,11 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({overflow: hidden;border: 1px solid ${cssVar.colorBorderSecondary};- border-radius: ${!isMacOSWithLargeWindowBorders()- ? cssVar.borderRadius- : `${cssVar.borderRadius} 12px ${cssVar.borderRadius} 12px`};+ border-radius: ${+ !isMacOSWithLargeWindowBorders()+ ? cssVar.borderRadius+ : `${cssVar.borderRadius} 12px ${cssVar.borderRadius} 12px`+ };background: ${cssVar.colorBgContainer};`,@@ -29,9 +31,11 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({overflow: hidden;border: 1px solid ${cssVar.colorBorder};- border-radius: ${!isMacOSWithLargeWindowBorders()- ? cssVar.borderRadius- : `${cssVar.borderRadius} 12px ${cssVar.borderRadius} 12px`};+ border-radius: ${+ !isMacOSWithLargeWindowBorders()+ ? cssVar.borderRadius+ : `${cssVar.borderRadius} 12px ${cssVar.borderRadius} 12px`+ };background: ${cssVar.colorBgContainer};`,diff --git a/src/routes/(desktop)/desktop-onboarding/components/LobeMessage.tsx b/src/features/DesktopOnboarding/components/LobeMessage.tsxsimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/components/LobeMessage.tsxrename to src/features/DesktopOnboarding/components/LobeMessage.tsxdiff --git a/src/routes/(desktop)/desktop-onboarding/components/OnboardingFooterActions.tsx b/src/features/DesktopOnboarding/components/OnboardingFooterActions.tsxsimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/components/OnboardingFooterActions.tsxrename to src/features/DesktopOnboarding/components/OnboardingFooterActions.tsxdiff --git a/src/routes/(desktop)/desktop-onboarding/flow.test.ts b/src/features/DesktopOnboarding/flow.test.tssimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/flow.test.tsrename to src/features/DesktopOnboarding/flow.test.tsdiff --git a/src/routes/(desktop)/desktop-onboarding/flow.ts b/src/features/DesktopOnboarding/flow.tssimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/flow.tsrename to src/features/DesktopOnboarding/flow.tsdiff --git a/src/features/DesktopOnboarding/index.tsx b/src/features/DesktopOnboarding/index.tsxnew file mode 100644index 00000000000..89622f6e433--- /dev/null+++ b/src/features/DesktopOnboarding/index.tsx@@ -0,0 +1,245 @@+'use client';++import { APP_WINDOW_MIN_SIZE } from '@lobechat/desktop-bridge';+import { Flexbox, Skeleton } from '@lobehub/ui';+import { memo, Suspense, useCallback, useEffect, useState } from 'react';+import { useSearchParams } from 'react-router';++import Loading from '@/components/Loading/BrandTextLoading';+import { remoteServerService } from '@/services/electron/remoteServer';+import { electronSystemService } from '@/services/electron/system';++import { resolveNextScreen, resolvePreviousScreen } from './flow';+import OnboardingContainer from './Layout';+import { resolveInitialScreen } from './resolveInitialScreen';+import DataModeStep from './steps/DataModeStep';+import LoginStep from './steps/LoginStep';+import PermissionsStep from './steps/PermissionsStep';+import WelcomeStep from './steps/WelcomeStep';+import {+ clearDesktopOnboardingScreen,+ getDesktopOnboardingEverCompleted,+ getDesktopOnboardingScreen,+ setDesktopOnboardingCompleted,+ setDesktopOnboardingEverCompleted,+ setDesktopOnboardingScreen,+} from './storage';+import { DesktopOnboardingScreen, isDesktopOnboardingScreen } from './types';++const DesktopOnboardingPage = memo(() => {+ const [searchParams, setSearchParams] = useSearchParams();+ const [isMac, setIsMac] = useState(true);+ const [isLoading, setIsLoading] = useState(true);+ const [everCompleted] = useState(getDesktopOnboardingEverCompleted);++ const resolveScreenForPlatform = useCallback(+ (screen: DesktopOnboardingScreen) =>+ resolveInitialScreen({+ everCompleted,+ isMac,+ requested: screen,+ saved: null,+ }),+ [everCompleted, isMac],+ );++ const getRequestedScreenFromUrl = useCallback((): DesktopOnboardingScreen | null => {+ const screenParam = searchParams.get('screen');+ if (isDesktopOnboardingScreen(screenParam)) return screenParam;++ return null;+ }, [searchParams]);++ const [currentScreen, setCurrentScreen] = useState<DesktopOnboardingScreen>(+ DesktopOnboardingScreen.Welcome,+ );++ useEffect(() => {+ electronSystemService.setDesktopOnboardingCompleted(false).catch((error) => {+ console.error('[DesktopOnboarding] Failed to mark onboarding as in progress:', error);+ });+ }, []);++ useEffect(() => {+ if (isLoading) return;++ const initial = resolveInitialScreen({+ everCompleted,+ isMac,+ requested: getRequestedScreenFromUrl(),+ saved: getDesktopOnboardingScreen(),+ });++ setCurrentScreen(initial);++ // Canonicalize URL to `?screen=...`+ const currentUrlScreen = searchParams.get('screen');+ if (currentUrlScreen !== initial) {+ setSearchParams({ screen: initial });+ }+ }, [everCompleted, getRequestedScreenFromUrl, isLoading, isMac, searchParams, setSearchParams]);++ // Persist current screen to localStorage.+ useEffect(() => {+ if (isLoading) return;+ setDesktopOnboardingScreen(currentScreen);+ }, [currentScreen, isLoading]);++ // Set window size and resizability+ useEffect(() => {+ const minimumSize = { height: 900, width: 1200 };++ const applyWindowSettings = async () => {+ try {+ await electronSystemService.setWindowMinimumSize(minimumSize);+ } catch (error) {+ console.error('[DesktopOnboarding] Failed to apply window settings:', error);+ }+ };++ applyWindowSettings();++ return () => {+ // Restore to app-level default minimum size preset+ electronSystemService.setWindowMinimumSize(APP_WINDOW_MIN_SIZE).catch((error) => {+ console.error('[DesktopOnboarding] Failed to restore window settings:', error);+ });+ };+ }, []);++ // Detect platform: skip permissions page on non-macOS+ useEffect(() => {+ let mounted = true;+ const detectPlatform = async () => {+ try {+ const state = await electronSystemService.getAppState();+ if (!mounted) return;+ setIsMac(state.platform === 'darwin');+ } catch {+ // Fallback: keep default (true)+ } finally {+ setIsLoading(false);+ }+ };+ void detectPlatform();+ return () => {+ mounted = false;+ };+ }, []);++ // Listen URL changes: allow deep-linking between screens.+ useEffect(() => {+ if (isLoading) return;+ const requested = getRequestedScreenFromUrl();+ if (!requested) return;+ const resolved = resolveScreenForPlatform(requested);+ if (resolved !== currentScreen) setCurrentScreen(resolved);+ }, [currentScreen, getRequestedScreenFromUrl, isLoading, resolveScreenForPlatform]);++ const completeOnboarding = useCallback(async () => {+ setDesktopOnboardingCompleted();+ setDesktopOnboardingEverCompleted();+ clearDesktopOnboardingScreen();++ try {+ await Promise.all([+ electronSystemService.setDesktopOnboardingCompleted(true),+ electronSystemService.setWindowMinimumSize(APP_WINDOW_MIN_SIZE),+ ]);+ } catch (error) {+ console.error('[DesktopOnboarding] Failed to finalize onboarding:', error);+ }++ // Use hard reload instead of SPA navigation to ensure the app boots with the new desktop state.+ window.location.replace('/');+ }, []);++ const goToNextStep = useCallback(async () => {+ let isAuthenticated = false;+ try {+ isAuthenticated = await remoteServerService.isRemoteServerConfigured();+ } catch (error) {+ console.error('[DesktopOnboarding] Failed to verify authentication:', error);+ }++ const next = resolveNextScreen({+ current: currentScreen,+ everCompleted,+ isAuthenticated,+ isMac,+ });++ if (!next) {+ await completeOnboarding();+ return;+ }++ setSearchParams({ screen: next });+ setCurrentScreen(next);+ }, [completeOnboarding, currentScreen, everCompleted, isMac, setSearchParams]);++ const goToPreviousStep = useCallback(() => {+ setCurrentScreen((prev) => {+ const prevScreen = resolvePreviousScreen({ current: prev, isMac });+ setSearchParams({ screen: prevScreen });+ return prevScreen;+ });+ }, [isMac, setSearchParams]);++ if (isLoading) {+ return <Loading debugId="DesktopOnboarding" />;+ }++ const renderStep = () => {+ switch (currentScreen) {+ case DesktopOnboardingScreen.Welcome: {+ return <WelcomeStep onNext={goToNextStep} />;+ }+ case DesktopOnboardingScreen.Permissions: {+ // macOS-only screen; fallback to DataMode if platform doesn't support.+ if (!isMac) {+ setCurrentScreen(DesktopOnboardingScreen.DataMode);+ return null;+ }+ return <PermissionsStep onBack={goToPreviousStep} onNext={goToNextStep} />;+ }+ case DesktopOnboardingScreen.DataMode: {+ return <DataModeStep onBack={goToPreviousStep} onNext={goToNextStep} />;+ }+ case DesktopOnboardingScreen.Login: {+ return <LoginStep onBack={goToPreviousStep} onNext={goToNextStep} />;+ }+ default: {+ return null;+ }+ }+ };++ return (+ <OnboardingContainer>+ <Flexbox gap={24} style={{ maxWidth: 560, minHeight: '100%', width: '100%' }}>+ <Suspense+ fallback={+ <Flexbox gap={8}>+ <Skeleton.Avatar size={48} />+ <Skeleton+ paragraph={{+ rows: 8,+ }}+ title={{+ fontSize: 24,+ }}+ />+ </Flexbox>+ }+ >+ {renderStep()}+ </Suspense>+ </Flexbox>+ </OnboardingContainer>+ );+});++DesktopOnboardingPage.displayName = 'DesktopOnboardingPage';++export default DesktopOnboardingPage;diff --git a/src/routes/(desktop)/desktop-onboarding/navigation.ts b/src/features/DesktopOnboarding/navigation.tssimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/navigation.tsrename to src/features/DesktopOnboarding/navigation.tsdiff --git a/src/routes/(desktop)/desktop-onboarding/resolveInitialScreen.test.ts b/src/features/DesktopOnboarding/resolveInitialScreen.test.tssimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/resolveInitialScreen.test.tsrename to src/features/DesktopOnboarding/resolveInitialScreen.test.tsdiff --git a/src/routes/(desktop)/desktop-onboarding/resolveInitialScreen.ts b/src/features/DesktopOnboarding/resolveInitialScreen.tssimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/resolveInitialScreen.tsrename to src/features/DesktopOnboarding/resolveInitialScreen.tsdiff --git a/src/routes/(desktop)/desktop-onboarding/features/DataModeStep.tsx b/src/features/DesktopOnboarding/steps/DataModeStep.tsxsimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/features/DataModeStep.tsxrename to src/features/DesktopOnboarding/steps/DataModeStep.tsxdiff --git a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsx b/src/features/DesktopOnboarding/steps/LoginStep.test.tsxsimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsxrename to src/features/DesktopOnboarding/steps/LoginStep.test.tsxdiff --git a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx b/src/features/DesktopOnboarding/steps/LoginStep.tsxsimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsxrename to src/features/DesktopOnboarding/steps/LoginStep.tsxdiff --git a/src/routes/(desktop)/desktop-onboarding/features/PermissionsStep.tsx b/src/features/DesktopOnboarding/steps/PermissionsStep.tsxsimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/features/PermissionsStep.tsxrename to src/features/DesktopOnboarding/steps/PermissionsStep.tsxdiff --git a/src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx b/src/features/DesktopOnboarding/steps/WelcomeStep.tsxsimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsxrename to src/features/DesktopOnboarding/steps/WelcomeStep.tsxdiff --git a/src/routes/(desktop)/desktop-onboarding/storage.test.ts b/src/features/DesktopOnboarding/storage.test.tssimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/storage.test.tsrename to src/features/DesktopOnboarding/storage.test.tsdiff --git a/src/routes/(desktop)/desktop-onboarding/storage.ts b/src/features/DesktopOnboarding/storage.tssimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/storage.tsrename to src/features/DesktopOnboarding/storage.tsdiff --git a/src/routes/(desktop)/desktop-onboarding/types.ts b/src/features/DesktopOnboarding/types.tssimilarity index 100%rename from src/routes/(desktop)/desktop-onboarding/types.tsrename to src/features/DesktopOnboarding/types.tsdiff --git a/src/features/Electron/connection/Connection.tsx b/src/features/Electron/connection/Connection.tsxindex 016ae0b9aa8..47bced2358f 100644--- a/src/features/Electron/connection/Connection.tsx+++ b/src/features/Electron/connection/Connection.tsx@@ -4,7 +4,7 @@ import { cssVar } from 'antd-style';import { Suspense, useCallback } from 'react';import { BrandTextLoading } from '@/components/Loading';-import LoginStep from '@/routes/(desktop)/desktop-onboarding/features/LoginStep';+import LoginStep from '@/features/DesktopOnboarding/steps/LoginStep';import { useElectronStore } from '@/store/electron';import { isMacOS } from '@/utils/platform';diff --git a/src/features/Home/AgentSelect/useHomeAgentRows.ts b/src/features/Home/AgentSelect/useHomeAgentRows.tsindex 492a2af0691..34155082551 100644--- a/src/features/Home/AgentSelect/useHomeAgentRows.ts+++ b/src/features/Home/AgentSelect/useHomeAgentRows.ts@@ -10,7 +10,7 @@ import { DEFAULT_INBOX_AVATAR } from '@/const/meta';import {useKeepSidebarGroupsListed,useKeepSidebarListed,-} from '@/routes/(main)/home/_layout/Body/Agent/List/useAgentList';+} from '@/features/HomeSidebar/Body/Agent/List/useAgentList';import { useAgentStore } from '@/store/agent';import { agentSelectors, builtinAgentSelectors } from '@/store/agent/selectors';import { useHomeStore } from '@/store/home';diff --git a/src/features/Home/Recents/index.tsx b/src/features/Home/Recents/index.tsxindex 0b14f074aad..3646401b48f 100644--- a/src/features/Home/Recents/index.tsx+++ b/src/features/Home/Recents/index.tsx@@ -22,9 +22,9 @@ import { useTranslation } from 'react-i18next';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';+import { openCustomizeSidebarModal } from '@/features/HomeSidebar/Body/CustomizeSidebarModal';import SkeletonList from '@/features/NavPanel/components/SkeletonList';import { useInitRecents } from '@/hooks/useInitRecents';-import { openCustomizeSidebarModal } from '@/routes/(main)/home/_layout/Body/CustomizeSidebarModal';import { useGlobalStore } from '@/store/global';import { systemStatusSelectors } from '@/store/global/selectors';import { reorderSidebarItems } from '@/store/global/selectors/systemStatus';diff --git a/src/routes/(main)/home/_layout/HomeAgentIdSync.tsx b/src/features/HomeLayout/HomeAgentIdSync.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/HomeAgentIdSync.tsxrename to src/features/HomeLayout/HomeAgentIdSync.tsxdiff --git a/src/routes/(main)/home/_layout/RecentHydration.tsx b/src/features/HomeLayout/RecentHydration.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/RecentHydration.tsxrename to src/features/HomeLayout/RecentHydration.tsxdiff --git a/src/features/HomeLayout/index.tsx b/src/features/HomeLayout/index.tsxnew file mode 100644index 00000000000..019e896c649--- /dev/null+++ b/src/features/HomeLayout/index.tsx@@ -0,0 +1,71 @@+import { Flexbox } from '@lobehub/ui';+import { useTheme } from 'antd-style';+import { Activity, type FC, type ReactNode, useEffect, useMemo, useState } from 'react';+import { Outlet, useLocation } from 'react-router';++import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';+import { useIsDark } from '@/hooks/useIsDark';++import HomeAgentIdSync from './HomeAgentIdSync';+import RecentHydration from './RecentHydration';+import { styles } from './style';++interface LayoutProps {+ children?: ReactNode;+}++const Layout: FC<LayoutProps> = ({ children }) => {+ const isDarkMode = useIsDark();+ const theme = useTheme(); // Keep for colorBgContainerSecondary (not in cssVar)+ const { pathname } = useLocation();+ const activeSlug = useActiveWorkspaceSlug();+ const isHomeRoute =+ pathname === '/' ||+ (!!activeSlug && (pathname === `/${activeSlug}` || pathname === `/${activeSlug}/`));+ const [hasActivated, setHasActivated] = useState(isHomeRoute);+ const content = children ?? <Outlet />;++ useEffect(() => {+ if (isHomeRoute) setHasActivated(true);+ }, [isHomeRoute]);++ // CSS variable for dynamic background color (colorBgContainerSecondary is not in cssVar)+ const cssVariables = useMemo<Record<string, string>>(+ () => ({+ '--content-bg-secondary': theme.colorBgContainerSecondary,+ }),+ [theme.colorBgContainerSecondary],+ );++ if (!hasActivated) return null;++ // Keep the Home layout alive and render it offscreen when inactive. The nav+ // panel entry is owned by `NavPanelShell`, not by this layout — see the note+ // there for why it cannot be registered from inside the route tree.+ return (+ <Activity mode={isHomeRoute ? 'visible' : 'hidden'} name="DesktopHomeLayout">+ {/* `position: absolute; inset: 0` keeps overlaying the outlet when Activity is hidden,+ because Activity preserves state but doesn't visually hide the DOM. Force-hide here. */}+ <Flexbox+ className={styles.absoluteContainer}+ height={'100%'}+ style={isHomeRoute ? undefined : { display: 'none' }}+ width={'100%'}+ >+ <Flexbox+ className={isDarkMode ? styles.contentDark : styles.contentLight}+ flex={1}+ height={'100%'}+ style={cssVariables}+ >+ {content}+ </Flexbox>++ <HomeAgentIdSync />+ <RecentHydration />+ </Flexbox>+ </Activity>+ );+};++export default Layout;diff --git a/src/routes/(main)/home/_layout/style.ts b/src/features/HomeLayout/style.tssimilarity index 100%rename from src/routes/(main)/home/_layout/style.tsrename to src/features/HomeLayout/style.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/Actions.tsx b/src/features/HomeSidebar/Body/Agent/Actions.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/Actions.tsxrename to src/features/HomeSidebar/Body/Agent/Actions.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/AllAgentsDrawer/Content.tsx b/src/features/HomeSidebar/Body/Agent/AllAgentsDrawer/Content.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/AllAgentsDrawer/Content.tsxrename to src/features/HomeSidebar/Body/Agent/AllAgentsDrawer/Content.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/AllAgentsDrawer/index.tsx b/src/features/HomeSidebar/Body/Agent/AllAgentsDrawer/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/AllAgentsDrawer/index.tsxrename to src/features/HomeSidebar/Body/Agent/AllAgentsDrawer/index.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/CreateAgentButton.tsx b/src/features/HomeSidebar/Body/Agent/CreateAgentButton.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/CreateAgentButton.tsxrename to src/features/HomeSidebar/Body/Agent/CreateAgentButton.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentGroupItem/index.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/AgentGroupItem/index.tsxrename to src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/index.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsxrename to src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/Avatar.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentItem/Avatar.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/Avatar.tsxrename to src/features/HomeSidebar/Body/Agent/List/AgentItem/Avatar.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.test.ts b/src/features/HomeSidebar/Body/Agent/List/AgentItem/agentMenuVisibility.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.test.tsrename to src/features/HomeSidebar/Body/Agent/List/AgentItem/agentMenuVisibility.test.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.ts b/src/features/HomeSidebar/Body/Agent/List/AgentItem/agentMenuVisibility.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/agentMenuVisibility.tsrename to src/features/HomeSidebar/Body/Agent/List/AgentItem/agentMenuVisibility.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/index.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentItem/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/index.tsxrename to src/features/HomeSidebar/Body/Agent/List/AgentItem/index.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.test.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.test.tsxsimilarity index 99%rename from src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.test.tsxrename to src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.test.tsxindex 8bb2b96e906..ae5f1414319 100644--- a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.test.tsx+++ b/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.test.tsx@@ -85,7 +85,7 @@ vi.mock('@/hooks/useResourceManageable', () => ({vi.mock('@/services/agent', () => ({ agentService: {} }));-vi.mock('@/routes/(main)/home/_layout/Body/Agent/ModalProvider', () => ({+vi.mock('@/features/HomeSidebar/Body/Agent/ModalProvider', () => ({useOptionalAgentModal: () => null,}));diff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.tsxsimilarity index 99%rename from src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsxrename to src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.tsxindex 52308b2f868..f1edee6d4db 100644--- a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx+++ b/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.tsx@@ -30,12 +30,12 @@ import { useTranslation } from 'react-i18next';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import { useAgentTransferMenuItem } from '@/business/client/hooks/useAgentTransferMenuItem';import { openEditingPopover } from '@/features/EditingPopover/store';+import { useOptionalAgentModal } from '@/features/HomeSidebar/Body/Agent/ModalProvider';import { useResourceAccess } from '@/features/ResourcePermission/useResourceAccess';import VisibilityConfirmContent from '@/features/VisibilityConfirmContent';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { usePermission } from '@/hooks/usePermission';import { useResourceManageable } from '@/hooks/useResourceManageable';-import { useOptionalAgentModal } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';import { agentService } from '@/services/agent';import { useGlobalStore } from '@/store/global';import { useHomeStore } from '@/store/home';diff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentListContent.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentListContent.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/AgentListContent.tsxrename to src/features/HomeSidebar/Body/Agent/List/AgentListContent.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/Group/Actions.tsx b/src/features/HomeSidebar/Body/Agent/List/Group/Actions.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/Group/Actions.tsxrename to src/features/HomeSidebar/Body/Agent/List/Group/Actions.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/Group/Item.tsx b/src/features/HomeSidebar/Body/Agent/List/Group/Item.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/Group/Item.tsxrename to src/features/HomeSidebar/Body/Agent/List/Group/Item.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/Group/index.tsx b/src/features/HomeSidebar/Body/Agent/List/Group/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/Group/index.tsxrename to src/features/HomeSidebar/Body/Agent/List/Group/index.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.test.ts b/src/features/HomeSidebar/Body/Agent/List/Group/useDropdownMenu.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.test.tsrename to src/features/HomeSidebar/Body/Agent/List/Group/useDropdownMenu.test.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsx b/src/features/HomeSidebar/Body/Agent/List/Group/useDropdownMenu.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsxrename to src/features/HomeSidebar/Body/Agent/List/Group/useDropdownMenu.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/InboxItem.tsx b/src/features/HomeSidebar/Body/Agent/List/InboxItem.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/InboxItem.tsxrename to src/features/HomeSidebar/Body/Agent/List/InboxItem.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/Item/Actions.tsx b/src/features/HomeSidebar/Body/Agent/List/Item/Actions.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/Item/Actions.tsxrename to src/features/HomeSidebar/Body/Agent/List/Item/Actions.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/List.tsx b/src/features/HomeSidebar/Body/Agent/List/List.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/List.tsxrename to src/features/HomeSidebar/Body/Agent/List/List.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/agentListContentState.test.ts b/src/features/HomeSidebar/Body/Agent/List/agentListContentState.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/agentListContentState.test.tsrename to src/features/HomeSidebar/Body/Agent/List/agentListContentState.test.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/agentListContentState.ts b/src/features/HomeSidebar/Body/Agent/List/agentListContentState.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/agentListContentState.tsrename to src/features/HomeSidebar/Body/Agent/List/agentListContentState.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/index.tsx b/src/features/HomeSidebar/Body/Agent/List/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/index.tsxrename to src/features/HomeSidebar/Body/Agent/List/index.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/useAgentList.tsx b/src/features/HomeSidebar/Body/Agent/List/useAgentList.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/useAgentList.tsxrename to src/features/HomeSidebar/Body/Agent/List/useAgentList.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/List/usePreservedAgentUrl.ts b/src/features/HomeSidebar/Body/Agent/List/usePreservedAgentUrl.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/List/usePreservedAgentUrl.tsrename to src/features/HomeSidebar/Body/Agent/List/usePreservedAgentUrl.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.test.tsx b/src/features/HomeSidebar/Body/Agent/ModalProvider.test.tsxsimilarity index 98%rename from src/routes/(main)/home/_layout/Body/Agent/ModalProvider.test.tsxrename to src/features/HomeSidebar/Body/Agent/ModalProvider.test.tsxindex 7c85d6d406f..61aaf9207f6 100644--- a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.test.tsx+++ b/src/features/HomeSidebar/Body/Agent/ModalProvider.test.tsx@@ -45,7 +45,7 @@ vi.mock('@/features/EditingPopover', () => ({default: () => null,}));-vi.mock('@/routes/(main)/home/_layout/hooks/useCreateModal', () => ({+vi.mock('@/features/HomeSidebar/hooks/useCreateModal', () => ({openCreateAgentModal: (props: {onCreateBlank: () => Promise<void> | void;onOpenSkills?: (identifier: string) => void;diff --git a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsx b/src/features/HomeSidebar/Body/Agent/ModalProvider.tsxsimilarity index 98%rename from src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsxrename to src/features/HomeSidebar/Body/Agent/ModalProvider.tsxindex 12f31734441..6fef152d3d0 100644--- a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsx+++ b/src/features/HomeSidebar/Body/Agent/ModalProvider.tsx@@ -17,9 +17,9 @@ import {} from 'react';import EditingPopover from '@/features/EditingPopover';+import type { OpenCreateAgentModalOptions } from '@/features/HomeSidebar/hooks/useCreateModal';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { openLabelFormModal } from '@/features/WorkspaceSetting/Labels/LabelFormModal';-import type { OpenCreateAgentModalOptions } from '@/routes/(main)/home/_layout/hooks/useCreateModal';import { useAgentStore } from '@/store/agent';import { builtinAgentSelectors } from '@/store/agent/selectors';import { useGlobalStore } from '@/store/global';@@ -168,7 +168,7 @@ const CreateModalRenderer = memo<CreateModalRendererProps>(let cancelled = false;let instance: ModalInstance | undefined;- void import('@/routes/(main)/home/_layout/hooks/useCreateModal').then(+ void import('@/features/HomeSidebar/hooks/useCreateModal').then(({ openCreateAgentModal }) => {if (cancelled) return;instance = openCreateAgentModal(openArgsRef.current!);diff --git a/src/routes/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsx b/src/features/HomeSidebar/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsxrename to src/features/HomeSidebar/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/index.tsx b/src/features/HomeSidebar/Body/Agent/Modals/ConfigGroupModal/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/index.tsxrename to src/features/HomeSidebar/Body/Agent/Modals/ConfigGroupModal/index.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/Modals/CreateGroupModal.tsx b/src/features/HomeSidebar/Body/Agent/Modals/CreateGroupModal.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/Modals/CreateGroupModal.tsxrename to src/features/HomeSidebar/Body/Agent/Modals/CreateGroupModal.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/index.tsx b/src/features/HomeSidebar/Body/Agent/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/index.tsxrename to src/features/HomeSidebar/Body/Agent/index.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.test.tsx b/src/features/HomeSidebar/Body/Agent/useDropdownMenu.test.tsxsimilarity index 95%rename from src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.test.tsxrename to src/features/HomeSidebar/Body/Agent/useDropdownMenu.test.tsxindex 2ada94afba8..7b498921a8e 100644--- a/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.test.tsx+++ b/src/features/HomeSidebar/Body/Agent/useDropdownMenu.test.tsx@@ -18,7 +18,7 @@ vi.mock('react-i18next', () => ({}),}));-vi.mock('@/routes/(main)/home/_layout/Body/CustomizeSidebarModal', () => ({+vi.mock('@/features/HomeSidebar/Body/CustomizeSidebarModal', () => ({openCustomizeSidebarModal: vi.fn(),}));diff --git a/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx b/src/features/HomeSidebar/Body/Agent/useDropdownMenu.tsxsimilarity index 95%rename from src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.tsxrename to src/features/HomeSidebar/Body/Agent/useDropdownMenu.tsxindex 5688889e870..3ee0eadd822 100644--- a/src/routes/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx+++ b/src/features/HomeSidebar/Body/Agent/useDropdownMenu.tsx@@ -4,7 +4,7 @@ import { Hash, LucideCheck, SlidersHorizontalIcon } from 'lucide-react';import { useMemo } from 'react';import { useTranslation } from 'react-i18next';-import { openCustomizeSidebarModal } from '@/routes/(main)/home/_layout/Body/CustomizeSidebarModal';+import { openCustomizeSidebarModal } from '@/features/HomeSidebar/Body/CustomizeSidebarModal';import { useGlobalStore } from '@/store/global';import { systemStatusSelectors } from '@/store/global/selectors';diff --git a/src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.test.ts b/src/features/HomeSidebar/Body/Agent/useSidebarGroupVisibility.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.test.tsrename to src/features/HomeSidebar/Body/Agent/useSidebarGroupVisibility.test.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.ts b/src/features/HomeSidebar/Body/Agent/useSidebarGroupVisibility.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.tsrename to src/features/HomeSidebar/Body/Agent/useSidebarGroupVisibility.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.test.ts b/src/features/HomeSidebar/Body/Agent/useSidebarItemVisibility.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.test.tsrename to src/features/HomeSidebar/Body/Agent/useSidebarItemVisibility.test.tsdiff --git a/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.ts b/src/features/HomeSidebar/Body/Agent/useSidebarItemVisibility.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.tsrename to src/features/HomeSidebar/Body/Agent/useSidebarItemVisibility.tsdiff --git a/src/routes/(main)/home/_layout/Body/CustomizeSidebarModal.test.ts b/src/features/HomeSidebar/Body/CustomizeSidebarModal.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/CustomizeSidebarModal.test.tsrename to src/features/HomeSidebar/Body/CustomizeSidebarModal.test.tsdiff --git a/src/routes/(main)/home/_layout/Body/CustomizeSidebarModal.tsx b/src/features/HomeSidebar/Body/CustomizeSidebarModal.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/CustomizeSidebarModal.tsxrename to src/features/HomeSidebar/Body/CustomizeSidebarModal.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Private/List.tsx b/src/features/HomeSidebar/Body/Private/List.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Private/List.tsxrename to src/features/HomeSidebar/Body/Private/List.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Private/index.tsx b/src/features/HomeSidebar/Body/Private/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/Private/index.tsxrename to src/features/HomeSidebar/Body/Private/index.tsxdiff --git a/src/routes/(main)/home/_layout/Body/Private/useDropdownMenu.tsx b/src/features/HomeSidebar/Body/Private/useDropdownMenu.tsxsimilarity index 97%rename from src/routes/(main)/home/_layout/Body/Private/useDropdownMenu.tsxrename to src/features/HomeSidebar/Body/Private/useDropdownMenu.tsxindex 3775da6db2f..0e8b107bf3b 100644--- a/src/routes/(main)/home/_layout/Body/Private/useDropdownMenu.tsx+++ b/src/features/HomeSidebar/Body/Private/useDropdownMenu.tsx@@ -5,7 +5,7 @@ import { useCallback, useMemo } from 'react';import { useTranslation } from 'react-i18next';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';-import { openCustomizeSidebarModal } from '@/routes/(main)/home/_layout/Body/CustomizeSidebarModal';+import { openCustomizeSidebarModal } from '@/features/HomeSidebar/Body/CustomizeSidebarModal';import { useGlobalStore } from '@/store/global';import { systemStatusSelectors } from '@/store/global/selectors';import { reorderSidebarItems } from '@/store/global/selectors/systemStatus';diff --git a/src/routes/(main)/home/_layout/Body/index.test.tsx b/src/features/HomeSidebar/Body/index.test.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/index.test.tsxrename to src/features/HomeSidebar/Body/index.test.tsxdiff --git a/src/routes/(main)/home/_layout/Body/index.tsx b/src/features/HomeSidebar/Body/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/index.tsxrename to src/features/HomeSidebar/Body/index.tsxdiff --git a/src/routes/(main)/home/_layout/Body/useSyncWorkspaceSidebarPreference.test.tsx b/src/features/HomeSidebar/Body/useSyncWorkspaceSidebarPreference.test.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Body/useSyncWorkspaceSidebarPreference.test.tsxrename to src/features/HomeSidebar/Body/useSyncWorkspaceSidebarPreference.test.tsxdiff --git a/src/routes/(main)/home/_layout/Body/useSyncWorkspaceSidebarPreference.ts b/src/features/HomeSidebar/Body/useSyncWorkspaceSidebarPreference.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Body/useSyncWorkspaceSidebarPreference.tsrename to src/features/HomeSidebar/Body/useSyncWorkspaceSidebarPreference.tsdiff --git a/src/features/HomeSidebar/Content.tsx b/src/features/HomeSidebar/Content.tsxindex 3630619c1fd..ea1f7b6b338 100644--- a/src/features/HomeSidebar/Content.tsx+++ b/src/features/HomeSidebar/Content.tsx@@ -1,9 +1,10 @@import { memo } from 'react';import SideBarLayout from '@/features/NavPanel/SideBarLayout';-import Body from '@/routes/(main)/home/_layout/Body';-import { AgentModalProvider } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';-import Header from '@/routes/(main)/home/_layout/Header';++import Body from './Body';+import { AgentModalProvider } from './Body/Agent/ModalProvider';+import Header from './Header';const HomeSidebarContent = memo(() => {return (diff --git a/src/routes/(main)/home/_layout/Footer/index.test.tsx b/src/features/HomeSidebar/Footer/index.test.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Footer/index.test.tsxrename to src/features/HomeSidebar/Footer/index.test.tsxdiff --git a/src/routes/(main)/home/_layout/Footer/index.tsx b/src/features/HomeSidebar/Footer/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Footer/index.tsxrename to src/features/HomeSidebar/Footer/index.tsxdiff --git a/src/routes/(main)/home/_layout/Footer/promotionPipeline.test.ts b/src/features/HomeSidebar/Footer/promotionPipeline.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Footer/promotionPipeline.test.tsrename to src/features/HomeSidebar/Footer/promotionPipeline.test.tsdiff --git a/src/routes/(main)/home/_layout/Footer/promotionPipeline.ts b/src/features/HomeSidebar/Footer/promotionPipeline.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Footer/promotionPipeline.tsrename to src/features/HomeSidebar/Footer/promotionPipeline.tsdiff --git a/src/routes/(main)/home/_layout/Header/components/InboxButton.tsx b/src/features/HomeSidebar/Header/components/InboxButton.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/InboxButton.tsxrename to src/features/HomeSidebar/Header/components/InboxButton.tsxdiff --git a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/Content.tsx b/src/features/HomeSidebar/Header/components/InboxDrawer/Content.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/InboxDrawer/Content.tsxrename to src/features/HomeSidebar/Header/components/InboxDrawer/Content.tsxdiff --git a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/NotificationDetailModal.tsx b/src/features/HomeSidebar/Header/components/InboxDrawer/NotificationDetailModal.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/InboxDrawer/NotificationDetailModal.tsxrename to src/features/HomeSidebar/Header/components/InboxDrawer/NotificationDetailModal.tsxdiff --git a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/NotificationItem.tsx b/src/features/HomeSidebar/Header/components/InboxDrawer/NotificationItem.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/InboxDrawer/NotificationItem.tsxrename to src/features/HomeSidebar/Header/components/InboxDrawer/NotificationItem.tsxdiff --git a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.test.ts b/src/features/HomeSidebar/Header/components/InboxDrawer/formatNotificationRelativeTime.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.test.tsrename to src/features/HomeSidebar/Header/components/InboxDrawer/formatNotificationRelativeTime.test.tsdiff --git a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.ts b/src/features/HomeSidebar/Header/components/InboxDrawer/formatNotificationRelativeTime.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/InboxDrawer/formatNotificationRelativeTime.tsrename to src/features/HomeSidebar/Header/components/InboxDrawer/formatNotificationRelativeTime.tsdiff --git a/src/routes/(main)/home/_layout/Header/components/InboxDrawer/index.tsx b/src/features/HomeSidebar/Header/components/InboxDrawer/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/InboxDrawer/index.tsxrename to src/features/HomeSidebar/Header/components/InboxDrawer/index.tsxdiff --git a/src/routes/(main)/home/_layout/Header/components/Nav.tsx b/src/features/HomeSidebar/Header/components/Nav.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/Nav.tsxrename to src/features/HomeSidebar/Header/components/Nav.tsxdiff --git a/src/routes/(main)/home/_layout/Header/components/User.tsx b/src/features/HomeSidebar/Header/components/User.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/User.tsxrename to src/features/HomeSidebar/Header/components/User.tsxdiff --git a/src/routes/(main)/home/_layout/Header/components/useInboxUnreadCount.test.ts b/src/features/HomeSidebar/Header/components/useInboxUnreadCount.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/useInboxUnreadCount.test.tsrename to src/features/HomeSidebar/Header/components/useInboxUnreadCount.test.tsdiff --git a/src/routes/(main)/home/_layout/Header/components/useInboxUnreadCount.ts b/src/features/HomeSidebar/Header/components/useInboxUnreadCount.tssimilarity index 100%rename from src/routes/(main)/home/_layout/Header/components/useInboxUnreadCount.tsrename to src/features/HomeSidebar/Header/components/useInboxUnreadCount.tsdiff --git a/src/routes/(main)/home/_layout/Header/index.tsx b/src/features/HomeSidebar/Header/index.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/Header/index.tsxrename to src/features/HomeSidebar/Header/index.tsxdiff --git a/src/routes/(main)/home/_layout/hooks/agentSkillSuggestion.test.ts b/src/features/HomeSidebar/hooks/agentSkillSuggestion.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/agentSkillSuggestion.test.tsrename to src/features/HomeSidebar/hooks/agentSkillSuggestion.test.tsdiff --git a/src/routes/(main)/home/_layout/hooks/agentSkillSuggestion.ts b/src/features/HomeSidebar/hooks/agentSkillSuggestion.tssimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/agentSkillSuggestion.tsrename to src/features/HomeSidebar/hooks/agentSkillSuggestion.tsdiff --git a/src/routes/(main)/home/_layout/hooks/createAgentModalAnalytics.test.ts b/src/features/HomeSidebar/hooks/createAgentModalAnalytics.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/createAgentModalAnalytics.test.tsrename to src/features/HomeSidebar/hooks/createAgentModalAnalytics.test.tsdiff --git a/src/routes/(main)/home/_layout/hooks/createAgentModalAnalytics.ts b/src/features/HomeSidebar/hooks/createAgentModalAnalytics.tssimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/createAgentModalAnalytics.tsrename to src/features/HomeSidebar/hooks/createAgentModalAnalytics.tsdiff --git a/src/routes/(main)/home/_layout/hooks/index.ts b/src/features/HomeSidebar/hooks/index.tssimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/index.tsrename to src/features/HomeSidebar/hooks/index.tsdiff --git a/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.test.tsx b/src/features/HomeSidebar/hooks/useCreateMenuItems.test.tsxsimilarity index 99%rename from src/routes/(main)/home/_layout/hooks/useCreateMenuItems.test.tsxrename to src/features/HomeSidebar/hooks/useCreateMenuItems.test.tsxindex 18aef887506..79220ce585e 100644--- a/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.test.tsx+++ b/src/features/HomeSidebar/hooks/useCreateMenuItems.test.tsx@@ -69,7 +69,7 @@ vi.mock('@/features/ConnectAgent', () => ({openConnectAgentModal: openConnectAgentModalMock,}));-vi.mock('@/routes/(main)/home/_layout/Body/Agent/ModalProvider', () => ({+vi.mock('@/features/HomeSidebar/Body/Agent/ModalProvider', () => ({useOptionalAgentModal: () => agentModalMock.current,}));diff --git a/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.tsx b/src/features/HomeSidebar/hooks/useCreateMenuItems.tsxsimilarity index 99%rename from src/routes/(main)/home/_layout/hooks/useCreateMenuItems.tsxrename to src/features/HomeSidebar/hooks/useCreateMenuItems.tsxindex 8e61631c6d9..280c59e60ec 100644--- a/src/routes/(main)/home/_layout/hooks/useCreateMenuItems.tsx+++ b/src/features/HomeSidebar/hooks/useCreateMenuItems.tsx@@ -20,9 +20,9 @@ import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceimport { useGroupTemplates } from '@/components/ChatGroupWizard/templates';import { DEFAULT_CHAT_GROUP_CHAT_CONFIG } from '@/const/settings';import { openConnectAgentModal } from '@/features/ConnectAgent';+import { useOptionalAgentModal } from '@/features/HomeSidebar/Body/Agent/ModalProvider';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { usePermission } from '@/hooks/usePermission';-import { useOptionalAgentModal } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';import type { CreateAgentParams } from '@/services/agent';import type { GroupMemberConfig } from '@/services/chatGroup';import { chatGroupService } from '@/services/chatGroup';diff --git a/src/routes/(main)/home/_layout/hooks/useCreateModal.test.tsx b/src/features/HomeSidebar/hooks/useCreateModal.test.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/useCreateModal.test.tsxrename to src/features/HomeSidebar/hooks/useCreateModal.test.tsxdiff --git a/src/routes/(main)/home/_layout/hooks/useCreateModal.tsx b/src/features/HomeSidebar/hooks/useCreateModal.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/useCreateModal.tsxrename to src/features/HomeSidebar/hooks/useCreateModal.tsxdiff --git a/src/routes/(main)/home/_layout/hooks/useProjectMenuItems.tsx b/src/features/HomeSidebar/hooks/useProjectMenuItems.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/useProjectMenuItems.tsxrename to src/features/HomeSidebar/hooks/useProjectMenuItems.tsxdiff --git a/src/routes/(main)/home/_layout/hooks/useRevealSidebarSection.test.ts b/src/features/HomeSidebar/hooks/useRevealSidebarSection.test.tssimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/useRevealSidebarSection.test.tsrename to src/features/HomeSidebar/hooks/useRevealSidebarSection.test.tsdiff --git a/src/routes/(main)/home/_layout/hooks/useRevealSidebarSection.ts b/src/features/HomeSidebar/hooks/useRevealSidebarSection.tssimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/useRevealSidebarSection.tsrename to src/features/HomeSidebar/hooks/useRevealSidebarSection.tsdiff --git a/src/routes/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsx b/src/features/HomeSidebar/hooks/useSessionGroupMenuItems.tsxsimilarity index 100%rename from src/routes/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsxrename to src/features/HomeSidebar/hooks/useSessionGroupMenuItems.tsxdiff --git a/src/features/LibraryModal/CreateNew/CreateForm.tsx b/src/features/LibraryModal/CreateNew/CreateForm.tsxindex 254cd96291e..c2dc211a998 100644--- a/src/features/LibraryModal/CreateNew/CreateForm.tsx+++ b/src/features/LibraryModal/CreateNew/CreateForm.tsx@@ -3,7 +3,7 @@ import { Button } from '@lobehub/ui/base-ui';import { memo, useState } from 'react';import { useTranslation } from 'react-i18next';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { useKnowledgeBaseStore } from '@/store/library';interface CreateFormProps {diff --git a/src/routes/(mobile)/(home)/_layout/MobileLayout.tsx b/src/features/MobileHome/Layout/MobileLayout.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/_layout/MobileLayout.tsxrename to src/features/MobileHome/Layout/MobileLayout.tsxdiff --git a/src/routes/(mobile)/(home)/_layout/MobileLayout/style.ts b/src/features/MobileHome/Layout/MobileLayout/style.tssimilarity index 100%rename from src/routes/(mobile)/(home)/_layout/MobileLayout/style.tsrename to src/features/MobileHome/Layout/MobileLayout/style.tsdiff --git a/src/routes/(mobile)/(home)/_layout/SessionHeader.tsx b/src/features/MobileHome/Layout/SessionHeader.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/_layout/SessionHeader.tsxrename to src/features/MobileHome/Layout/SessionHeader.tsxdiff --git a/src/routes/(mobile)/(home)/_layout/SessionHeader/style.ts b/src/features/MobileHome/Layout/SessionHeader/style.tssimilarity index 100%rename from src/routes/(mobile)/(home)/_layout/SessionHeader/style.tsrename to src/features/MobileHome/Layout/SessionHeader/style.tsdiff --git a/src/routes/(mobile)/(home)/_layout/SessionHydration.tsx b/src/features/MobileHome/Layout/SessionHydration.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/_layout/SessionHydration.tsxrename to src/features/MobileHome/Layout/SessionHydration.tsxdiff --git a/src/routes/(mobile)/(home)/_layout/SessionSearchBar.tsx b/src/features/MobileHome/Layout/SessionSearchBar.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/_layout/SessionSearchBar.tsxrename to src/features/MobileHome/Layout/SessionSearchBar.tsxdiff --git a/src/features/MobileHome/Layout/index.tsx b/src/features/MobileHome/Layout/index.tsxnew file mode 100644index 00000000000..05f81a780c1--- /dev/null+++ b/src/features/MobileHome/Layout/index.tsx@@ -0,0 +1,18 @@+import { type FC } from 'react';+import { Outlet } from 'react-router';++import MobileLayout from '@/features/MobileHome/Layout/MobileLayout';+import SessionHydration from '@/features/MobileHome/Layout/SessionHydration';++const Layout: FC = () => {+ return (+ <>+ <MobileLayout>+ <Outlet />+ </MobileLayout>+ <SessionHydration />+ </>+ );+};++export default Layout;diff --git a/src/routes/(mobile)/(home)/features/SessionListContent/CollapseGroup/Actions.tsx b/src/features/MobileHome/SessionListContent/CollapseGroup/Actions.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/CollapseGroup/Actions.tsxrename to src/features/MobileHome/SessionListContent/CollapseGroup/Actions.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/CollapseGroup/index.tsx b/src/features/MobileHome/SessionListContent/CollapseGroup/index.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/CollapseGroup/index.tsxrename to src/features/MobileHome/SessionListContent/CollapseGroup/index.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/DefaultMode.tsx b/src/features/MobileHome/SessionListContent/DefaultMode.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/DefaultMode.tsxrename to src/features/MobileHome/SessionListContent/DefaultMode.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/Inbox/index.tsx b/src/features/MobileHome/SessionListContent/Inbox/index.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/Inbox/index.tsxrename to src/features/MobileHome/SessionListContent/Inbox/index.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/List/AddButton.tsx b/src/features/MobileHome/SessionListContent/List/AddButton.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/List/AddButton.tsxrename to src/features/MobileHome/SessionListContent/List/AddButton.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/List/Item/Actions.tsx b/src/features/MobileHome/SessionListContent/List/Item/Actions.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/List/Item/Actions.tsxrename to src/features/MobileHome/SessionListContent/List/Item/Actions.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/List/Item/index.tsx b/src/features/MobileHome/SessionListContent/List/Item/index.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/List/Item/index.tsxrename to src/features/MobileHome/SessionListContent/List/Item/index.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/List/index.tsx b/src/features/MobileHome/SessionListContent/List/index.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/List/index.tsxrename to src/features/MobileHome/SessionListContent/List/index.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/ListItem/index.tsx b/src/features/MobileHome/SessionListContent/ListItem/index.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/ListItem/index.tsxrename to src/features/MobileHome/SessionListContent/ListItem/index.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx b/src/features/MobileHome/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsxrename to src/features/MobileHome/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/index.tsx b/src/features/MobileHome/SessionListContent/Modals/ConfigGroupModal/index.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/index.tsxrename to src/features/MobileHome/SessionListContent/Modals/ConfigGroupModal/index.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/Modals/CreateGroupModal.tsx b/src/features/MobileHome/SessionListContent/Modals/CreateGroupModal.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/Modals/CreateGroupModal.tsxrename to src/features/MobileHome/SessionListContent/Modals/CreateGroupModal.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/Modals/RenameGroupModal.tsx b/src/features/MobileHome/SessionListContent/Modals/RenameGroupModal.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/Modals/RenameGroupModal.tsxrename to src/features/MobileHome/SessionListContent/Modals/RenameGroupModal.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/SearchMode.tsx b/src/features/MobileHome/SessionListContent/SearchMode.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/SearchMode.tsxrename to src/features/MobileHome/SessionListContent/SearchMode.tsxdiff --git a/src/routes/(mobile)/(home)/features/SessionListContent/index.tsx b/src/features/MobileHome/SessionListContent/index.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SessionListContent/index.tsxrename to src/features/MobileHome/SessionListContent/index.tsxdiff --git a/src/routes/(mobile)/(home)/features/SkeletonList.tsx b/src/features/MobileHome/SkeletonList.tsxsimilarity index 100%rename from src/routes/(mobile)/(home)/features/SkeletonList.tsxrename to src/features/MobileHome/SkeletonList.tsxdiff --git a/src/features/MobileHome/index.tsx b/src/features/MobileHome/index.tsxnew file mode 100644index 00000000000..799f00b0884--- /dev/null+++ b/src/features/MobileHome/index.tsx@@ -0,0 +1,16 @@+import { memo, Suspense } from 'react';++import SessionListContent from './SessionListContent';+import SkeletonList from './SkeletonList';++const Home = memo(() => {+ return (+ <Suspense fallback={<SkeletonList />}>+ <SessionListContent />+ </Suspense>+ );+});++Home.displayName = 'MobileHome';++export default Home;diff --git a/src/features/NavPanel/components/NavPanelDraggable.tsx b/src/features/NavPanel/components/NavPanelDraggable.tsxindex 428adc1fa06..e314ae8fe8d 100644--- a/src/features/NavPanel/components/NavPanelDraggable.tsx+++ b/src/features/NavPanel/components/NavPanelDraggable.tsx@@ -7,9 +7,9 @@ import { memo, Suspense, useMemo, useRef } from 'react';import NavPanelUpgradeEntry from '@/business/client/features/NavPanelUpgradeEntry';import { isDesktop } from '@/const/version';+import Footer from '@/features/HomeSidebar/Footer';import { USER_DROPDOWN_ICON_ID } from '@/features/NavPanel/constants';import { TOGGLE_BUTTON_ID } from '@/features/NavPanel/ToggleLeftPanelButton';-import Footer from '@/routes/(main)/home/_layout/Footer';import { useGlobalStore } from '@/store/global';import {NAV_PANEL_MAX_WIDTH,diff --git a/src/features/Onboarding/Classic/index.test.tsx b/src/features/Onboarding/Classic/index.test.tsxindex 74dcc2f48c8..8765adfacfd 100644--- a/src/features/Onboarding/Classic/index.test.tsx+++ b/src/features/Onboarding/Classic/index.test.tsx@@ -34,11 +34,11 @@ vi.mock('@/hooks/useOnboardingAgentTemplates', () => ({useOnboardingAgentTemplates: vi.fn(),}));-vi.mock('@/routes/onboarding/_layout', () => ({+vi.mock('@/features/Onboarding/Layout', () => ({default: ({ children }: { children: ReactNode }) => <div>{children}</div>,}));-vi.mock('@/routes/onboarding/features/AgentPickerStep', () => ({+vi.mock('@/features/Onboarding/steps/AgentPickerStep', () => ({default: ({ onBack }: { onBack: () => void }) => (<div>AgentPickerStep@@ -49,7 +49,7 @@ vi.mock('@/routes/onboarding/features/AgentPickerStep', () => ({),}));-vi.mock('@/routes/onboarding/features/FullNameStep', () => ({+vi.mock('@/features/Onboarding/steps/FullNameStep', () => ({default: ({ onBack, onNext }: { onBack: () => void; onNext: () => void }) => (<div>FullNameStep@@ -63,7 +63,7 @@ vi.mock('@/routes/onboarding/features/FullNameStep', () => ({),}));-vi.mock('@/routes/onboarding/features/InterestsStep', () => ({+vi.mock('@/features/Onboarding/steps/InterestsStep', () => ({default: ({ onBack, onNext }: { onBack: () => void; onNext: () => void }) => (<div>InterestsStep@@ -77,7 +77,7 @@ vi.mock('@/routes/onboarding/features/InterestsStep', () => ({),}));-vi.mock('@/routes/onboarding/features/ProSettingsStep', () => ({+vi.mock('@/features/Onboarding/steps/ProSettingsStep', () => ({default: ({ onBack, onNext }: { onBack: () => void; onNext: () => void }) => (<div>ProSettingsStepdiff --git a/src/features/Onboarding/Classic/index.tsx b/src/features/Onboarding/Classic/index.tsxindex 204643d6839..f33229d0fa8 100644--- a/src/features/Onboarding/Classic/index.tsx+++ b/src/features/Onboarding/Classic/index.tsx@@ -6,13 +6,13 @@ import { memo, useCallback, useEffect, useRef } from 'react';import { Navigate, useNavigate } from 'react-router';import Loading from '@/components/Loading/BrandTextLoading';+import OnboardingContainer from '@/features/Onboarding/Layout';+import AgentPickerStep from '@/features/Onboarding/steps/AgentPickerStep';+import FullNameStep from '@/features/Onboarding/steps/FullNameStep';+import InterestsStep from '@/features/Onboarding/steps/InterestsStep';+import ProSettingsStep from '@/features/Onboarding/steps/ProSettingsStep';import { useIsMobile } from '@/hooks/useIsMobile';import { useOnboardingAgentTemplates } from '@/hooks/useOnboardingAgentTemplates';-import OnboardingContainer from '@/routes/onboarding/_layout';-import AgentPickerStep from '@/routes/onboarding/features/AgentPickerStep';-import FullNameStep from '@/routes/onboarding/features/FullNameStep';-import InterestsStep from '@/routes/onboarding/features/InterestsStep';-import ProSettingsStep from '@/routes/onboarding/features/ProSettingsStep';import {trackOnboardingStepCompleted,trackOnboardingStepViewed,diff --git a/src/routes/onboarding/_layout/index.tsx b/src/features/Onboarding/Layout/index.tsxsimilarity index 100%rename from src/routes/onboarding/_layout/index.tsxrename to src/features/Onboarding/Layout/index.tsxdiff --git a/src/routes/onboarding/_layout/style.ts b/src/features/Onboarding/Layout/style.tssimilarity index 100%rename from src/routes/onboarding/_layout/style.tsrename to src/features/Onboarding/Layout/style.tsdiff --git a/src/routes/onboarding/components/ComposioServerList/components/ComposioServerItem.tsx b/src/features/Onboarding/components/ComposioServerList/components/ComposioServerItem.tsxsimilarity index 100%rename from src/routes/onboarding/components/ComposioServerList/components/ComposioServerItem.tsxrename to src/features/Onboarding/components/ComposioServerList/components/ComposioServerItem.tsxdiff --git a/src/routes/onboarding/components/ComposioServerList/components/ServerIcon.tsx b/src/features/Onboarding/components/ComposioServerList/components/ServerIcon.tsxsimilarity index 100%rename from src/routes/onboarding/components/ComposioServerList/components/ServerIcon.tsxrename to src/features/Onboarding/components/ComposioServerList/components/ServerIcon.tsxdiff --git a/src/routes/onboarding/components/ComposioServerList/components/ServerStatusControl.tsx b/src/features/Onboarding/components/ComposioServerList/components/ServerStatusControl.tsxsimilarity index 100%rename from src/routes/onboarding/components/ComposioServerList/components/ServerStatusControl.tsxrename to src/features/Onboarding/components/ComposioServerList/components/ServerStatusControl.tsxdiff --git a/src/routes/onboarding/components/ComposioServerList/hooks/useComposioOAuth.ts b/src/features/Onboarding/components/ComposioServerList/hooks/useComposioOAuth.tssimilarity index 100%rename from src/routes/onboarding/components/ComposioServerList/hooks/useComposioOAuth.tsrename to src/features/Onboarding/components/ComposioServerList/hooks/useComposioOAuth.tsdiff --git a/src/routes/onboarding/components/ComposioServerList/hooks/useComposioServerActions.ts b/src/features/Onboarding/components/ComposioServerList/hooks/useComposioServerActions.tssimilarity index 100%rename from src/routes/onboarding/components/ComposioServerList/hooks/useComposioServerActions.tsrename to src/features/Onboarding/components/ComposioServerList/hooks/useComposioServerActions.tsdiff --git a/src/routes/onboarding/components/ComposioServerList/index.tsx b/src/features/Onboarding/components/ComposioServerList/index.tsxsimilarity index 100%rename from src/routes/onboarding/components/ComposioServerList/index.tsxrename to src/features/Onboarding/components/ComposioServerList/index.tsxdiff --git a/src/routes/onboarding/components/LobeMessage.tsx b/src/features/Onboarding/components/LobeMessage.tsxsimilarity index 100%rename from src/routes/onboarding/components/LobeMessage.tsxrename to src/features/Onboarding/components/LobeMessage.tsxdiff --git a/src/routes/onboarding/config.ts b/src/features/Onboarding/config.tssimilarity index 100%rename from src/routes/onboarding/config.tsrename to src/features/Onboarding/config.tsdiff --git a/src/features/Onboarding/index.tsx b/src/features/Onboarding/index.tsxnew file mode 100644index 00000000000..9738bfd4a4d--- /dev/null+++ b/src/features/Onboarding/index.tsx@@ -0,0 +1,96 @@+'use client';++import { Flexbox } from '@lobehub/ui';+import { memo, useCallback, useEffect, useRef } from 'react';+import { useSearchParams } from 'react-router';++import Loading from '@/components/Loading/BrandTextLoading';+import ClassicOnboardingPage from '@/features/Onboarding/Classic';+import OnboardingContainer from '@/features/Onboarding/Layout';+import ResponseLanguageStep from '@/features/Onboarding/steps/ResponseLanguageStep';+import TelemetryStep from '@/features/Onboarding/steps/TelemetryStep';+import { useOnboardingAgentTemplates } from '@/hooks/useOnboardingAgentTemplates';+import {+ trackOnboardingStepCompleted,+ trackOnboardingStepViewed,+} from '@/services/onboardingMetrics';+import { useUserStore } from '@/store/user';+import { onboardingSelectors } from '@/store/user/selectors';+import { clearStaleOnboardingCallbackUrl } from '@/utils/onboardingRedirect';++const COMMON_STEP_TRACKING = {+ 1: { flow: 'common', step: 'telemetry', stepIndex: 1 },+ 2: { flow: 'common', step: 'response_language', stepIndex: 2 },+} as const;++const OnboardingPage = memo(() => {+ const isUserStateInit = useUserStore((s) => s.isUserStateInit);+ const commonStepsCompleted = useUserStore(onboardingSelectors.commonStepsCompleted);++ const [searchParams, setSearchParams] = useSearchParams();+ const step: 1 | 2 = searchParams.get('step') === '2' ? 2 : 1;+ const hasStepParam = searchParams.has('step');+ const viewedStepKeysRef = useRef<Set<string>>(new Set());++ useOnboardingAgentTemplates(isUserStateInit && (!commonStepsCompleted || hasStepParam));++ // This component only mounts on top-level entries to `/onboarding` (fresh+ // signup landings and `?step` re-entries from the classic back button), so+ // mount is the one safe point to drop a stale callback stashed by a+ // previously abandoned attempt — later search changes are internal step+ // navigations that must keep the stash.+ useEffect(() => {+ clearStaleOnboardingCallbackUrl(window.location.pathname, window.location.search);+ }, []);++ useEffect(() => {+ if (!isUserStateInit || (commonStepsCompleted && !hasStepParam)) return;++ const payload = COMMON_STEP_TRACKING[step];+ if (viewedStepKeysRef.current.has(payload.step)) return;++ viewedStepKeysRef.current.add(payload.step);+ trackOnboardingStepViewed(payload);+ }, [commonStepsCompleted, hasStepParam, isUserStateInit, step]);++ const goNextFromTelemetry = useCallback(() => {+ trackOnboardingStepCompleted(COMMON_STEP_TRACKING[1]);+ setSearchParams({ step: '2' }, { replace: true });+ }, [setSearchParams]);++ const goBackFromLanguage = useCallback(() => {+ setSearchParams({ step: '1' }, { replace: true });+ }, [setSearchParams]);++ const finishCommon = useCallback(() => {+ trackOnboardingStepCompleted(COMMON_STEP_TRACKING[2]);+ setSearchParams({}, { replace: true });+ }, [setSearchParams]);++ if (!isUserStateInit) {+ return <Loading debugId="Onboarding/userState" />;+ }++ // With the shared prefix complete, `/onboarding` renders the classic branch+ // inline — but an explicit `?step` (classic FullName back button) re-enters+ // the prefix.+ if (commonStepsCompleted && !hasStepParam) {+ return <ClassicOnboardingPage />;+ }++ return (+ <OnboardingContainer>+ <Flexbox gap={24} style={{ maxWidth: 600, width: '100%' }}>+ {step === 1 ? (+ <TelemetryStep onNext={goNextFromTelemetry} />+ ) : (+ <ResponseLanguageStep onBack={goBackFromLanguage} onNext={finishCommon} />+ )}+ </Flexbox>+ </OnboardingContainer>+ );+});++OnboardingPage.displayName = 'OnboardingPage';++export default OnboardingPage;diff --git a/src/routes/onboarding/interestCategoryMap.test.ts b/src/features/Onboarding/interestCategoryMap.test.tssimilarity index 100%rename from src/routes/onboarding/interestCategoryMap.test.tsrename to src/features/Onboarding/interestCategoryMap.test.tsdiff --git a/src/routes/onboarding/interestCategoryMap.ts b/src/features/Onboarding/interestCategoryMap.tssimilarity index 100%rename from src/routes/onboarding/interestCategoryMap.tsrename to src/features/Onboarding/interestCategoryMap.tsdiff --git a/src/routes/onboarding/features/AgentPickerStep/AgentCard.tsx b/src/features/Onboarding/steps/AgentPickerStep/AgentCard.tsxsimilarity index 100%rename from src/routes/onboarding/features/AgentPickerStep/AgentCard.tsxrename to src/features/Onboarding/steps/AgentPickerStep/AgentCard.tsxdiff --git a/src/routes/onboarding/features/AgentPickerStep/CategoryFilter.tsx b/src/features/Onboarding/steps/AgentPickerStep/CategoryFilter.tsxsimilarity index 100%rename from src/routes/onboarding/features/AgentPickerStep/CategoryFilter.tsxrename to src/features/Onboarding/steps/AgentPickerStep/CategoryFilter.tsxdiff --git a/src/routes/onboarding/features/AgentPickerStep/Skeleton.tsx b/src/features/Onboarding/steps/AgentPickerStep/Skeleton.tsxsimilarity index 100%rename from src/routes/onboarding/features/AgentPickerStep/Skeleton.tsxrename to src/features/Onboarding/steps/AgentPickerStep/Skeleton.tsxdiff --git a/src/routes/onboarding/features/AgentPickerStep/categoryLabels.ts b/src/features/Onboarding/steps/AgentPickerStep/categoryLabels.tssimilarity index 100%rename from src/routes/onboarding/features/AgentPickerStep/categoryLabels.tsrename to src/features/Onboarding/steps/AgentPickerStep/categoryLabels.tsdiff --git a/src/routes/onboarding/features/AgentPickerStep/index.test.tsx b/src/features/Onboarding/steps/AgentPickerStep/index.test.tsxsimilarity index 100%rename from src/routes/onboarding/features/AgentPickerStep/index.test.tsxrename to src/features/Onboarding/steps/AgentPickerStep/index.test.tsxdiff --git a/src/routes/onboarding/features/AgentPickerStep/index.tsx b/src/features/Onboarding/steps/AgentPickerStep/index.tsxsimilarity index 100%rename from src/routes/onboarding/features/AgentPickerStep/index.tsxrename to src/features/Onboarding/steps/AgentPickerStep/index.tsxdiff --git a/src/routes/onboarding/features/AgentPickerStep/style.ts b/src/features/Onboarding/steps/AgentPickerStep/style.tssimilarity index 100%rename from src/routes/onboarding/features/AgentPickerStep/style.tsrename to src/features/Onboarding/steps/AgentPickerStep/style.tsdiff --git a/src/routes/onboarding/features/FullNameStep.tsx b/src/features/Onboarding/steps/FullNameStep.tsxsimilarity index 100%rename from src/routes/onboarding/features/FullNameStep.tsxrename to src/features/Onboarding/steps/FullNameStep.tsxdiff --git a/src/routes/onboarding/features/InterestsStep.test.tsx b/src/features/Onboarding/steps/InterestsStep.test.tsxsimilarity index 100%rename from src/routes/onboarding/features/InterestsStep.test.tsxrename to src/features/Onboarding/steps/InterestsStep.test.tsxdiff --git a/src/routes/onboarding/features/InterestsStep.tsx b/src/features/Onboarding/steps/InterestsStep.tsxsimilarity index 100%rename from src/routes/onboarding/features/InterestsStep.tsxrename to src/features/Onboarding/steps/InterestsStep.tsxdiff --git a/src/routes/onboarding/features/ProSettingsStep.test.tsx b/src/features/Onboarding/steps/ProSettingsStep.test.tsxsimilarity index 97%rename from src/routes/onboarding/features/ProSettingsStep.test.tsxrename to src/features/Onboarding/steps/ProSettingsStep.test.tsxindex 2cd476b76ae..da793af386e 100644--- a/src/routes/onboarding/features/ProSettingsStep.test.tsx+++ b/src/features/Onboarding/steps/ProSettingsStep.test.tsx@@ -44,7 +44,7 @@ vi.mock('react-i18next', () => ({}),}));-vi.mock('@/routes/onboarding/components/LobeMessage', () => ({+vi.mock('@/features/Onboarding/components/LobeMessage', () => ({default: ({ sentences }: { sentences: string[] }) => <div>{sentences.join(' / ')}</div>,}));diff --git a/src/routes/onboarding/features/ProSettingsStep.tsx b/src/features/Onboarding/steps/ProSettingsStep.tsxsimilarity index 96%rename from src/routes/onboarding/features/ProSettingsStep.tsxrename to src/features/Onboarding/steps/ProSettingsStep.tsxindex 64af6900c13..75911408072 100644--- a/src/routes/onboarding/features/ProSettingsStep.tsx+++ b/src/features/Onboarding/steps/ProSettingsStep.tsx@@ -7,7 +7,7 @@ import { Undo2Icon } from 'lucide-react';import { memo, useCallback, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';-import LobeMessage from '@/routes/onboarding/components/LobeMessage';+import LobeMessage from '@/features/Onboarding/components/LobeMessage';import ComposioServerList from '../components/ComposioServerList';diff --git a/src/routes/onboarding/features/ResponseLanguageStep.tsx b/src/features/Onboarding/steps/ResponseLanguageStep.tsxsimilarity index 100%rename from src/routes/onboarding/features/ResponseLanguageStep.tsxrename to src/features/Onboarding/steps/ResponseLanguageStep.tsxdiff --git a/src/routes/onboarding/features/TelemetryStep.tsx b/src/features/Onboarding/steps/TelemetryStep.tsxsimilarity index 100%rename from src/routes/onboarding/features/TelemetryStep.tsxrename to src/features/Onboarding/steps/TelemetryStep.tsxdiff --git a/src/features/PageEditor/Copilot/AgentSelector/AgentItem.tsx b/src/features/PageEditor/Copilot/AgentSelector/AgentItem.tsxindex 2ca8ad2687e..539e325079f 100644--- a/src/features/PageEditor/Copilot/AgentSelector/AgentItem.tsx+++ b/src/features/PageEditor/Copilot/AgentSelector/AgentItem.tsx@@ -4,8 +4,8 @@ import { memo } from 'react';import { useTranslation } from 'react-i18next';import HeterogeneousTag from '@/features/HeterogeneousTag';+import AgentAvatar from '@/features/HomeSidebar/Body/Agent/List/AgentItem/Avatar';import NavItem from '@/features/NavPanel/components/NavItem';-import AgentAvatar from '@/routes/(main)/home/_layout/Body/Agent/List/AgentItem/Avatar';interface AgentItemProps {active: boolean;diff --git a/src/features/PageEditor/Copilot/AgentSelector/AgentSelectorAction.tsx b/src/features/PageEditor/Copilot/AgentSelector/AgentSelectorAction.tsxindex 515ebafb978..238aa9c4029 100644--- a/src/features/PageEditor/Copilot/AgentSelector/AgentSelectorAction.tsx+++ b/src/features/PageEditor/Copilot/AgentSelector/AgentSelectorAction.tsx@@ -6,10 +6,10 @@ import { memo, Suspense, useCallback, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';import { conversationSelectors, useConversationStore } from '@/features/Conversation';+import AgentAvatar from '@/features/HomeSidebar/Body/Agent/List/AgentItem/Avatar';+import { AgentModalProvider } from '@/features/HomeSidebar/Body/Agent/ModalProvider';import SkeletonList from '@/features/NavPanel/components/SkeletonList';import { useFetchAgentList } from '@/hooks/useFetchAgentList';-import AgentAvatar from '@/routes/(main)/home/_layout/Body/Agent/List/AgentItem/Avatar';-import { AgentModalProvider } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';import { useAgentStore } from '@/store/agent';import { useHomeStore } from '@/store/home';import { homeAgentListSelectors } from '@/store/home/selectors';diff --git a/src/features/RecommendTaskTemplates/TemplateBriefIcon.tsx b/src/features/RecommendTaskTemplates/TemplateBriefIcon.tsxindex bd1d64796a2..5ebcba32b13 100644--- a/src/features/RecommendTaskTemplates/TemplateBriefIcon.tsx+++ b/src/features/RecommendTaskTemplates/TemplateBriefIcon.tsx@@ -3,7 +3,7 @@ import { cssVar } from 'antd-style';import type { LucideIcon } from 'lucide-react';import { memo } from 'react';-import { INTEREST_AREAS } from '@/routes/onboarding/config';+import { INTEREST_AREAS } from '@/features/Onboarding/config';import type { TemplateIconSpec } from './resolveTemplateIcon';diff --git a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/Actions.tsx b/src/features/ResourceHome/Layout/Body/LibraryList/Item/Actions.tsxsimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/Actions.tsxrename to src/features/ResourceHome/Layout/Body/LibraryList/Item/Actions.tsxdiff --git a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/Editing.test.tsx b/src/features/ResourceHome/Layout/Body/LibraryList/Item/Editing.test.tsxsimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/Editing.test.tsxrename to src/features/ResourceHome/Layout/Body/LibraryList/Item/Editing.test.tsxdiff --git a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/Editing.tsx b/src/features/ResourceHome/Layout/Body/LibraryList/Item/Editing.tsxsimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/Editing.tsxrename to src/features/ResourceHome/Layout/Body/LibraryList/Item/Editing.tsxdiff --git a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.test.tsx b/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.test.tsxsimilarity index 97%rename from src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.test.tsxrename to src/features/ResourceHome/Layout/Body/LibraryList/Item/index.test.tsxindex 68a96e7ab21..4efd690fa1f 100644--- a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.test.tsx+++ b/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.test.tsx@@ -38,7 +38,7 @@ vi.mock('@/hooks/usePermission', () => ({usePermission: () => ({ allowed: true }),}));-vi.mock('@/routes/(main)/resource/features/store', () => ({+vi.mock('@/features/ResourceManager/store', () => ({useResourceManagerStore: (selector: (state: { setLibraryId: () => void }) => unknown) =>selector({ setLibraryId: vi.fn() }),}));diff --git a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.tsx b/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsxsimilarity index 97%rename from src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.tsxrename to src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsxindex 2d267e7f19c..98be4fade07 100644--- a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.tsx+++ b/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsx@@ -6,9 +6,9 @@ import React, { memo, useCallback, useMemo } from 'react';import RepoIcon from '@/components/LibIcon';import NavItem from '@/features/NavPanel/components/NavItem';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { usePermission } from '@/hooks/usePermission';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';import { useKnowledgeBaseStore } from '@/store/library';import Actions from './Actions';diff --git a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/useDropdownMenu.tsx b/src/features/ResourceHome/Layout/Body/LibraryList/Item/useDropdownMenu.tsxsimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/Body/LibraryList/Item/useDropdownMenu.tsxrename to src/features/ResourceHome/Layout/Body/LibraryList/Item/useDropdownMenu.tsxdiff --git a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/index.tsx b/src/features/ResourceHome/Layout/Body/LibraryList/index.tsxsimilarity index 97%rename from src/routes/(main)/resource/(home)/_layout/Body/LibraryList/index.tsxrename to src/features/ResourceHome/Layout/Body/LibraryList/index.tsxindex 9b3af4a9f08..10961ac30e7 100644--- a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/index.tsx+++ b/src/features/ResourceHome/Layout/Body/LibraryList/index.tsx@@ -8,9 +8,9 @@ import AsyncBoundary from '@/components/AsyncBoundary';import { useCreateNewModal } from '@/features/LibraryModal';import EmptyNavItem from '@/features/NavPanel/components/EmptyNavItem';import SkeletonList from '@/features/NavPanel/components/SkeletonList';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { usePermission } from '@/hooks/usePermission';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';import { useKnowledgeBaseStore } from '@/store/library';import Item from './Item';diff --git a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/state.test.ts b/src/features/ResourceHome/Layout/Body/LibraryList/state.test.tssimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/Body/LibraryList/state.test.tsrename to src/features/ResourceHome/Layout/Body/LibraryList/state.test.tsdiff --git a/src/routes/(main)/resource/(home)/_layout/Body/LibraryList/state.ts b/src/features/ResourceHome/Layout/Body/LibraryList/state.tssimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/Body/LibraryList/state.tsrename to src/features/ResourceHome/Layout/Body/LibraryList/state.tsdiff --git a/src/routes/(main)/resource/(home)/_layout/Body/index.tsx b/src/features/ResourceHome/Layout/Body/index.tsxsimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/Body/index.tsxrename to src/features/ResourceHome/Layout/Body/index.tsxdiff --git a/src/routes/(main)/resource/(home)/_layout/Header/CategoryMenu.tsx b/src/features/ResourceHome/Layout/Header/CategoryMenu.tsxsimilarity index 97%rename from src/routes/(main)/resource/(home)/_layout/Header/CategoryMenu.tsxrename to src/features/ResourceHome/Layout/Header/CategoryMenu.tsxindex 33dd3c961ee..97e894c6ecf 100644--- a/src/routes/(main)/resource/(home)/_layout/Header/CategoryMenu.tsx+++ b/src/features/ResourceHome/Layout/Header/CategoryMenu.tsx@@ -15,12 +15,11 @@ import { Link } from 'react-router';import { useBusinessResourceCategories } from '@/business/client/features/ResourceCategories';import NavItem from '@/features/NavPanel/components/NavItem';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { useActiveLocation } from '@/hooks/useActiveLocation';import { FilesTabs } from '@/types/files';-import { useResourceManagerStore } from '../../../features/store';-const CategoryMenu = memo(() => {const { t } = useTranslation('file');const [activeKey, setMode] = useResourceManagerStore((s) => [s.category, s.setMode]);diff --git a/src/routes/(main)/resource/(home)/_layout/Header/index.tsx b/src/features/ResourceHome/Layout/Header/index.tsxsimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/Header/index.tsxrename to src/features/ResourceHome/Layout/Header/index.tsxdiff --git a/src/routes/(main)/resource/(home)/_layout/Sidebar.tsx b/src/features/ResourceHome/Layout/Sidebar.tsxsimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/Sidebar.tsxrename to src/features/ResourceHome/Layout/Sidebar.tsxdiff --git a/src/routes/(main)/resource/(home)/_layout/SidebarContent.tsx b/src/features/ResourceHome/Layout/SidebarContent.tsxsimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/SidebarContent.tsxrename to src/features/ResourceHome/Layout/SidebarContent.tsxdiff --git a/src/features/ResourceHome/Layout/index.tsx b/src/features/ResourceHome/Layout/index.tsxnew file mode 100644index 00000000000..a45b05f274c--- /dev/null+++ b/src/features/ResourceHome/Layout/index.tsx@@ -0,0 +1,21 @@+'use client';++import { Flexbox } from '@lobehub/ui';+import { type FC } from 'react';+import { Outlet } from 'react-router';++import Sidebar from './Sidebar';+import { styles } from './style';++const HomeLayout: FC = () => {+ return (+ <>+ <Sidebar />+ <Flexbox className={styles.mainContainer} flex={1} height={'100%'}>+ <Outlet />+ </Flexbox>+ </>+ );+};++export default HomeLayout;diff --git a/src/routes/(main)/resource/(home)/_layout/style.ts b/src/features/ResourceHome/Layout/style.tssimilarity index 100%rename from src/routes/(main)/resource/(home)/_layout/style.tsrename to src/features/ResourceHome/Layout/style.tsdiff --git a/src/features/ResourceHome/index.tsx b/src/features/ResourceHome/index.tsxnew file mode 100644index 00000000000..6b2f9e65ceb--- /dev/null+++ b/src/features/ResourceHome/index.tsx@@ -0,0 +1,60 @@+'use client';++import { memo, useLayoutEffect } from 'react';+import { useLocation, useSearchParams } from 'react-router';++import ResourceManager from '@/features/ResourceManager';+import { useInitFileCheck } from '@/features/ResourceManager/hooks/useInitFileCheck';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import WorkGallery from '@/features/WorkGallery';+import { parseWorkGalleryKey } from '@/features/WorkGallery/const';+import { FilesTabs } from '@/types/files';++const ResourceHomePage = memo(() => {+ const [searchParams] = useSearchParams();+ const location = useLocation();+ const [setCategory, setLibraryId] = useResourceManagerStore((s) => [+ s.setCategory,+ s.setLibraryId,+ ]);++ const categoryParam = (searchParams.get('category') as FilesTabs) || FilesTabs.All;+ // `?works=<type>` switches the content area to the cross-topic Work gallery,+ // independent of the file explorer (which stays keyed on `?category=`).+ const worksKey = parseWorkGalleryKey(searchParams.get('works'));++ // Clear libraryId when on home route using useLayoutEffect+ // useLayoutEffect runs synchronously before browser paint, ensuring state is cleared+ // before child components' useEffects run, while avoiding React's setState-in-render error+ // IMPORTANT: Only depend on location.pathname, NOT currentLibraryId to avoid feedback loop+ // When location changes to /resource, clear libraryId+ // Don't clear when location is /library/* (even if this component is still mounted)+ useLayoutEffect(() => {+ const isOnHomeRoute =+ location.pathname === '/resource' || !location.pathname.includes('/library/');+ if (isOnHomeRoute) {+ setLibraryId(undefined);+ }+ }, [setLibraryId, location.pathname]);++ // Sync category from URL using useLayoutEffect+ // IMPORTANT: Only sync if we're actually on the home route (not transitioning to library)+ useLayoutEffect(() => {+ const isOnHomeRoute =+ location.pathname === '/resource' || !location.pathname.includes('/library/');+ if (isOnHomeRoute) {+ setCategory(categoryParam);+ }+ }, [categoryParam, setCategory, location.pathname]);++ // Sync file view mode from URL+ useInitFileCheck();++ if (worksKey) return <WorkGallery galleryKey={worksKey} />;++ return <ResourceManager />;+});++ResourceHomePage.displayName = 'ResourceHomePage';++export default ResourceHomePage;diff --git a/src/routes/(main)/resource/library/features/Container.tsx b/src/features/ResourceLibrary/Container.tsxsimilarity index 100%rename from src/routes/(main)/resource/library/features/Container.tsxrename to src/features/ResourceLibrary/Container.tsxdiff --git a/src/routes/(main)/resource/library/_layout/Header/LibraryHead.tsx b/src/features/ResourceLibrary/Layout/Header/LibraryHead.tsxsimilarity index 96%rename from src/routes/(main)/resource/library/_layout/Header/LibraryHead.tsxrename to src/features/ResourceLibrary/Layout/Header/LibraryHead.tsxindex 168d53d43e8..77cb9e8be9e 100644--- a/src/routes/(main)/resource/library/_layout/Header/LibraryHead.tsx+++ b/src/features/ResourceLibrary/Layout/Header/LibraryHead.tsx@@ -17,9 +17,9 @@ import { memo, useCallback, useMemo, useState } from 'react';import BusinessKnowledgeBaseImportAction from '@/business/client/BusinessKnowledgeBaseImportAction';import RepoIcon from '@/components/LibIcon';+import { useDragActive } from '@/features/ResourceManager/DndContextWrapper';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import { useDragActive } from '@/routes/(main)/resource/features/DndContextWrapper';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';import { knowledgeBaseSelectors, useKnowledgeBaseStore } from '@/store/library';const styles = createStaticStyles(({ css, cssVar }) => ({diff --git a/src/routes/(main)/resource/library/_layout/Header/index.tsx b/src/features/ResourceLibrary/Layout/Header/index.tsxsimilarity index 100%rename from src/routes/(main)/resource/library/_layout/Header/index.tsxrename to src/features/ResourceLibrary/Layout/Header/index.tsxdiff --git a/src/routes/(main)/resource/library/_layout/Header/useActiveLibraryId.desktop.test.ts b/src/features/ResourceLibrary/Layout/Header/useActiveLibraryId.desktop.test.tssimilarity index 100%rename from src/routes/(main)/resource/library/_layout/Header/useActiveLibraryId.desktop.test.tsrename to src/features/ResourceLibrary/Layout/Header/useActiveLibraryId.desktop.test.tsdiff --git a/src/routes/(main)/resource/library/_layout/Header/useActiveLibraryId.ts b/src/features/ResourceLibrary/Layout/Header/useActiveLibraryId.tssimilarity index 100%rename from src/routes/(main)/resource/library/_layout/Header/useActiveLibraryId.tsrename to src/features/ResourceLibrary/Layout/Header/useActiveLibraryId.tsdiff --git a/src/routes/(main)/resource/library/_layout/Sidebar.tsx b/src/features/ResourceLibrary/Layout/Sidebar.tsxsimilarity index 100%rename from src/routes/(main)/resource/library/_layout/Sidebar.tsxrename to src/features/ResourceLibrary/Layout/Sidebar.tsxdiff --git a/src/features/ResourceLibrary/Layout/index.tsx b/src/features/ResourceLibrary/Layout/index.tsxnew file mode 100644index 00000000000..f3a8a34091e--- /dev/null+++ b/src/features/ResourceLibrary/Layout/index.tsx@@ -0,0 +1,24 @@+'use client';++import { Flexbox } from '@lobehub/ui';+import { type FC } from 'react';+import { Outlet } from 'react-router';++import RegisterHotkeys from '@/features/ResourceLibrary/RegisterHotkeys';++import Sidebar from './Sidebar';+import { styles } from './style';++const LibraryLayout: FC = () => {+ return (+ <>+ <Sidebar />+ <Flexbox className={styles.mainContainer} flex={1} height={'100%'}>+ <Outlet />+ </Flexbox>+ <RegisterHotkeys />+ </>+ );+};++export default LibraryLayout;diff --git a/src/routes/(main)/resource/library/_layout/style.ts b/src/features/ResourceLibrary/Layout/style.tssimilarity index 100%rename from src/routes/(main)/resource/library/_layout/style.tsrename to src/features/ResourceLibrary/Layout/style.tsdiff --git a/src/routes/(main)/resource/_layout/RegisterHotkeys.tsx b/src/features/ResourceLibrary/RegisterHotkeys.tsxsimilarity index 100%rename from src/routes/(main)/resource/_layout/RegisterHotkeys.tsxrename to src/features/ResourceLibrary/RegisterHotkeys.tsxdiff --git a/src/features/ResourceLibrary/index.tsx b/src/features/ResourceLibrary/index.tsxnew file mode 100644index 00000000000..7df9d61032e--- /dev/null+++ b/src/features/ResourceLibrary/index.tsx@@ -0,0 +1,62 @@+'use client';++import { memo, useLayoutEffect } from 'react';+import { useLocation, useParams } from 'react-router';++import NotFound from '@/components/404';+import AsyncError from '@/components/AsyncError';+import NProgress from '@/components/NProgress';+import Container from '@/features/ResourceLibrary/Container';+import ResourceManager from '@/features/ResourceManager';+import { useInitFileCheck } from '@/features/ResourceManager/hooks/useInitFileCheck';+import { useKnowledgeBaseItem } from '@/features/ResourceManager/hooks/useKnowledgeItem';+import { useResourceManagerStore } from '@/features/ResourceManager/store';++const MainContent = memo(() => {+ const { id: knowledgeBaseId } = useParams<{ id: string }>();+ const location = useLocation();+ const setLibraryId = useResourceManagerStore((s) => s.setLibraryId);++ // Load knowledge base data+ const { data, isLoading, error, mutate } = useKnowledgeBaseItem(knowledgeBaseId || '');++ // Sync libraryId from URL params using useLayoutEffect+ // useLayoutEffect runs synchronously before browser paint, ensuring state is set+ // before Explorer component renders and computes query parameters+ // IMPORTANT: Only depend on knowledgeBaseId and location.pathname, NOT currentLibraryId to avoid feedback loop+ useLayoutEffect(() => {+ const isOnLibraryRoute = location.pathname.includes('/library/');+ if (isOnLibraryRoute) {+ setLibraryId(knowledgeBaseId);+ }+ }, [knowledgeBaseId, setLibraryId, location.pathname]);++ // Sync file view mode from URL+ useInitFileCheck();++ // A network / 500 on the KB fetch is NOT "this library doesn't exist" (Read §1.1):+ // branch a transient error to a reload state that keeps the URL, and reserve the+ // terminal 404 for a genuinely resolved-null (deleted / never-existed) record.+ if (error && !data) return <AsyncError error={error} variant={'page'} onRetry={() => mutate()} />;++ if (!isLoading && !data) return <NotFound />;++ return <ResourceManager />;+});++MainContent.displayName = 'LibraryMainContent';++const LibraryPage = memo(() => {+ return (+ <>+ <NProgress />+ <Container>+ <MainContent />+ </Container>+ </>+ );+});++LibraryPage.displayName = 'LibraryPage';++export default LibraryPage;diff --git a/src/routes/(main)/resource/features/DndContextWrapper.tsx b/src/features/ResourceManager/DndContextWrapper.tsxsimilarity index 100%rename from src/routes/(main)/resource/features/DndContextWrapper.tsxrename to src/features/ResourceManager/DndContextWrapper.tsxdiff --git a/src/routes/(main)/resource/features/FileDetail.tsx b/src/features/ResourceManager/FileDetail.tsxsimilarity index 100%rename from src/routes/(main)/resource/features/FileDetail.tsxrename to src/features/ResourceManager/FileDetail.tsxdiff --git a/src/routes/(main)/resource/library/features/RegisterHotkeys.tsx b/src/features/ResourceManager/Layout/RegisterHotkeys.tsxsimilarity index 100%rename from src/routes/(main)/resource/library/features/RegisterHotkeys.tsxrename to src/features/ResourceManager/Layout/RegisterHotkeys.tsxdiff --git a/src/features/ResourceManager/Layout/index.tsx b/src/features/ResourceManager/Layout/index.tsxnew file mode 100644index 00000000000..e169f43b1f2--- /dev/null+++ b/src/features/ResourceManager/Layout/index.tsx@@ -0,0 +1,17 @@+'use client';++import { type FC } from 'react';+import { Outlet } from 'react-router';++import RegisterHotkeys from './RegisterHotkeys';++const ResourceLayout: FC = () => {+ return (+ <>+ <Outlet />+ <RegisterHotkeys />+ </>+ );+};++export default ResourceLayout;diff --git a/src/features/ResourceManager/components/Editor/index.tsx b/src/features/ResourceManager/components/Editor/index.tsxindex 2023b5eb44a..9f2b332e77f 100644--- a/src/features/ResourceManager/components/Editor/index.tsx+++ b/src/features/ResourceManager/components/Editor/index.tsx@@ -10,8 +10,8 @@ import { useTranslation } from 'react-i18next';import NavHeader from '@/features/NavHeader';import { PageAgentProvider } from '@/features/PageEditor/PageAgentProvider';-import FileDetailComponent from '@/routes/(main)/resource/features/FileDetail';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import FileDetailComponent from '@/features/ResourceManager/FileDetail';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { fileManagerSelectors, useFileStore } from '@/store/file';import { downloadFile } from '@/utils/client/downloadFile';diff --git a/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.test.tsx b/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.test.tsxindex 9052e05f7ae..7275ae95cd7 100644--- a/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.test.tsx+++ b/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.test.tsx@@ -22,11 +22,11 @@ vi.mock('@/hooks/usePermission', () => ({usePermission: () => ({ allowed: canCreate, reason: '' }),}));-vi.mock('@/routes/(main)/resource/features/hooks/useCurrentFolderId', () => ({+vi.mock('@/features/ResourceManager/hooks/useCurrentFolderId', () => ({useCurrentFolderId: () => undefined,}));-vi.mock('@/routes/(main)/resource/features/store', () => ({+vi.mock('@/features/ResourceManager/store', () => ({useResourceManagerStore: (selector: (state: { libraryId?: string }) => unknown) =>selector({ libraryId }),}));diff --git a/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.tsx b/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.tsxindex 6f342309b2d..07d4370f2e6 100644--- a/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.tsx+++ b/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.tsx@@ -5,10 +5,10 @@ import { ArrowUpIcon, PlusIcon } from 'lucide-react';import { useTranslation } from 'react-i18next';import { useCreateNewModal } from '@/features/LibraryModal';+import { useCurrentFolderId } from '@/features/ResourceManager/hooks/useCurrentFolderId';import { useTopLevelFileUpload } from '@/features/ResourceManager/hooks/useTopLevelFileUpload';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { usePermission } from '@/hooks/usePermission';-import { useCurrentFolderId } from '@/routes/(main)/resource/features/hooks/useCurrentFolderId';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';import { useFileStore } from '@/store/file';const ICON_SIZE = 80;diff --git a/src/features/ResourceManager/components/Explorer/Header/Breadcrumb.tsx b/src/features/ResourceManager/components/Explorer/Header/Breadcrumb.tsxindex 1b47d67f64f..276b0019179 100644--- a/src/features/ResourceManager/components/Explorer/Header/Breadcrumb.tsx+++ b/src/features/ResourceManager/components/Explorer/Header/Breadcrumb.tsx@@ -4,9 +4,9 @@ import { memo } from 'react';import { useTranslation } from 'react-i18next';import { useSearchParams } from 'react-router';+import { useFolderPath } from '@/features/ResourceManager/hooks/useFolderPath';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import { useFolderPath } from '@/routes/(main)/resource/features/hooks/useFolderPath';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';import { useFileStore } from '@/store/file';import { knowledgeBaseSelectors, useKnowledgeBaseStore } from '@/store/library';import { FilesTabs } from '@/types/files';diff --git a/src/features/ResourceManager/components/Explorer/Header/SearchInput.tsx b/src/features/ResourceManager/components/Explorer/Header/SearchInput.tsxindex eb0bd6fe87e..e68e289dc2b 100644--- a/src/features/ResourceManager/components/Explorer/Header/SearchInput.tsx+++ b/src/features/ResourceManager/components/Explorer/Header/SearchInput.tsx@@ -7,7 +7,7 @@ import { SearchIcon, XIcon } from 'lucide-react';import { memo, useCallback, useEffect, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import { useResourceManagerStore } from '@/features/ResourceManager/store';const SearchInput = memo(() => {const { t } = useTranslation('components');diff --git a/src/features/ResourceManager/components/Explorer/Header/index.tsx b/src/features/ResourceManager/components/Explorer/Header/index.tsxindex 5fefa266884..bc89dfd8ff6 100644--- a/src/features/ResourceManager/components/Explorer/Header/index.tsx+++ b/src/features/ResourceManager/components/Explorer/Header/index.tsx@@ -11,10 +11,10 @@ import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceimport { useFileBatchTransferActions } from '@/business/client/hooks/useFileBatchTransferActions';import { useIsWorkspaceOwner } from '@/business/client/hooks/useIsWorkspaceOwner';import NavHeader from '@/features/NavHeader';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { getExplorerSelectedCount } from '@/features/ResourceManager/store/selectors';import { openWorkspaceDeleteAllModal } from '@/features/WorkspaceDeleteAllModal';import { usePermission } from '@/hooks/usePermission';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import { getExplorerSelectedCount } from '@/routes/(main)/resource/features/store/selectors';import { useFileStore } from '@/store/file';import { FilesTabs } from '@/types/files';diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.test.tsx b/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.test.tsxindex 26d40e866b3..2d080fcbc80 100644--- a/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.test.tsx+++ b/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.test.tsx@@ -36,7 +36,7 @@ vi.mock('react-i18next', () => ({}),}));-vi.mock('@/routes/(main)/resource/features/store', () => ({+vi.mock('@/features/ResourceManager/store', () => ({useResourceManagerStore: (selector: (state: any) => unknown) =>selector({libraryId: undefined,@@ -47,7 +47,7 @@ vi.mock('@/routes/(main)/resource/features/store', () => ({}),}));-vi.mock('@/routes/(main)/resource/features/store/selectors', () => ({+vi.mock('@/features/ResourceManager/store/selectors', () => ({isExplorerItemSelected: () => false,}));diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx b/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsxindex 26840cb110c..269a18098ce 100644--- a/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx+++ b/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx@@ -5,8 +5,8 @@ import { memo, useCallback } from 'react';import { useTranslation } from 'react-i18next';import { shallow } from 'zustand/shallow';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import { isExplorerItemSelected } from '@/routes/(main)/resource/features/store/selectors';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { isExplorerItemSelected } from '@/features/ResourceManager/store/selectors';import { fileManagerSelectors, getChunkTargetId, useFileStore } from '@/store/file';import type { FileListItem as FileListItemType } from '@/types/files';import { formatSize } from '@/utils/format';diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListItem/useFileListItemDrag.ts b/src/features/ResourceManager/components/Explorer/ListView/ListItem/useFileListItemDrag.tsindex 1750732cd6e..1aaf31fdcba 100644--- a/src/features/ResourceManager/components/Explorer/ListView/ListItem/useFileListItemDrag.ts+++ b/src/features/ResourceManager/components/Explorer/ListView/ListItem/useFileListItemDrag.ts@@ -5,7 +5,7 @@ import {getTransparentDragImage,useDragActive,useSetCurrentDrag,-} from '@/routes/(main)/resource/features/DndContextWrapper';+} from '@/features/ResourceManager/DndContextWrapper';import { useFileStore } from '@/store/file';interface UseFileListItemDragOptions {diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListViewSelectAllHint.tsx b/src/features/ResourceManager/components/Explorer/ListView/ListViewSelectAllHint.tsxindex 6c6a1bc5337..2efaaf37373 100644--- a/src/features/ResourceManager/components/Explorer/ListView/ListViewSelectAllHint.tsx+++ b/src/features/ResourceManager/components/Explorer/ListView/ListViewSelectAllHint.tsx@@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui';import { Button } from '@lobehub/ui/base-ui';import { useTranslation } from 'react-i18next';-import type { SelectAllState } from '@/routes/(main)/resource/features/store/initialState';+import type { SelectAllState } from '@/features/ResourceManager/store/initialState';import { getListViewMinWidth } from './ListItem/constants';import { styles } from './styles';diff --git a/src/features/ResourceManager/components/Explorer/ListView/VirtualizedFileList.tsx b/src/features/ResourceManager/components/Explorer/ListView/VirtualizedFileList.tsxindex 0a1c7a2e030..69ace31af40 100644--- a/src/features/ResourceManager/components/Explorer/ListView/VirtualizedFileList.tsx+++ b/src/features/ResourceManager/components/Explorer/ListView/VirtualizedFileList.tsx@@ -3,8 +3,8 @@ import { useCallback, useEffect, useRef } from 'react';import type { VirtuosoHandle } from 'react-virtuoso';import { Virtuoso } from 'react-virtuoso';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import { isExplorerItemSelected } from '@/routes/(main)/resource/features/store/selectors';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { isExplorerItemSelected } from '@/features/ResourceManager/store/selectors';import type { FileListItem } from '@/types/files';import { useExplorerSelectionActions } from '../hooks/useExplorerSelection';diff --git a/src/features/ResourceManager/components/Explorer/ListView/useExplorerDropZone.ts b/src/features/ResourceManager/components/Explorer/ListView/useExplorerDropZone.tsindex 50892ebd20d..df20858619f 100644--- a/src/features/ResourceManager/components/Explorer/ListView/useExplorerDropZone.ts+++ b/src/features/ResourceManager/components/Explorer/ListView/useExplorerDropZone.ts@@ -2,7 +2,7 @@ import type { DragEvent, RefObject } from 'react';import { useCallback, useEffect, useRef, useState } from 'react';import type { VirtuosoHandle } from 'react-virtuoso';-import { useDragActive } from '@/routes/(main)/resource/features/DndContextWrapper';+import { useDragActive } from '@/features/ResourceManager/DndContextWrapper';export const useExplorerDropZone = (virtuosoRef: RefObject<VirtuosoHandle | null>) => {const isDragActive = useDragActive();diff --git a/src/features/ResourceManager/components/Explorer/ListView/useExplorerListData.test.ts b/src/features/ResourceManager/components/Explorer/ListView/useExplorerListData.test.tsindex 532e01c292f..a963cd92d63 100644--- a/src/features/ResourceManager/components/Explorer/ListView/useExplorerListData.test.ts+++ b/src/features/ResourceManager/components/Explorer/ListView/useExplorerListData.test.ts@@ -20,16 +20,16 @@ const mocks = vi.hoisted(() => ({},}));-vi.mock('@/routes/(main)/resource/features/hooks/useCurrentFolderId', () => ({+vi.mock('@/features/ResourceManager/hooks/useCurrentFolderId', () => ({useCurrentFolderId: () => null,}));-vi.mock('@/routes/(main)/resource/features/store', () => ({+vi.mock('@/features/ResourceManager/store', () => ({useResourceManagerStore: (selector: (state: typeof mocks.resourceManagerState) => unknown) =>selector(mocks.resourceManagerState),}));-vi.mock('@/routes/(main)/resource/features/store/selectors', () => ({+vi.mock('@/features/ResourceManager/store/selectors', () => ({sortFileList: (items: unknown[]) => items,}));diff --git a/src/features/ResourceManager/components/Explorer/ListView/useExplorerListData.ts b/src/features/ResourceManager/components/Explorer/ListView/useExplorerListData.tsindex 9814beee886..0a471e07238 100644--- a/src/features/ResourceManager/components/Explorer/ListView/useExplorerListData.ts+++ b/src/features/ResourceManager/components/Explorer/ListView/useExplorerListData.ts@@ -1,8 +1,8 @@import { useMemo } from 'react';-import { useCurrentFolderId } from '@/routes/(main)/resource/features/hooks/useCurrentFolderId';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import { sortFileList } from '@/routes/(main)/resource/features/store/selectors';+import { useCurrentFolderId } from '@/features/ResourceManager/hooks/useCurrentFolderId';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { sortFileList } from '@/features/ResourceManager/store/selectors';import { useFileStore } from '@/store/file';import { useGlobalStore } from '@/store/global';import {diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MasonryItemWrapper.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MasonryItemWrapper.tsxindex 333ee9a7903..7ef9d1d4224 100644--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MasonryItemWrapper.tsx+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MasonryItemWrapper.tsx@@ -1,6 +1,6 @@import { memo } from 'react';-import { isExplorerItemSelected } from '@/routes/(main)/resource/features/store/selectors';+import { isExplorerItemSelected } from '@/features/ResourceManager/store/selectors';import { type FileListItem } from '@/types/files';import MasonryFileItem from '.';diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/index.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/index.tsxindex 99aba66a239..ebb9d634e98 100644--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/index.tsx+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/index.tsx@@ -8,12 +8,12 @@ import { createStaticStyles, cssVar, cx } from 'antd-style';import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';-import { showContextMenu } from '@/libs/contextMenu';import {getTransparentDragImage,useDragActive,useSetCurrentDrag,-} from '@/routes/(main)/resource/features/DndContextWrapper';+} from '@/features/ResourceManager/DndContextWrapper';+import { showContextMenu } from '@/libs/contextMenu';import { documentService } from '@/services/document';import { getChunkTargetId, useFileStore } from '@/store/file';import { type FileListItem } from '@/types/files';diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/index.tsxindex 26ee9f312a6..7f383c08b08 100644--- a/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx+++ b/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx@@ -8,8 +8,8 @@ import { type UIEvent } from 'react';import { memo, useCallback, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import { sortFileList } from '@/routes/(main)/resource/features/store/selectors';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { sortFileList } from '@/features/ResourceManager/store/selectors';import { useFileStore } from '@/store/file';import { type FileListItem } from '@/types/files';import type { ResourceQueryParams } from '@/types/resource';diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/useMasonryViewState.ts b/src/features/ResourceManager/components/Explorer/MasonryView/useMasonryViewState.tsindex 10114b8530f..71ef552d652 100644--- a/src/features/ResourceManager/components/Explorer/MasonryView/useMasonryViewState.ts+++ b/src/features/ResourceManager/components/Explorer/MasonryView/useMasonryViewState.ts@@ -1,6 +1,6 @@import { useMemo } from 'react';-import type { ViewMode } from '@/routes/(main)/resource/features/store/initialState';+import type { ViewMode } from '@/features/ResourceManager/store/initialState';interface UseMasonryViewStateOptions {dataLength: number;diff --git a/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx b/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsxindex 6252d8c34bb..a1b0bc568e0 100644--- a/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx+++ b/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx@@ -11,10 +11,10 @@ import { Virtuoso } from 'react-virtuoso';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import AsyncError from '@/components/AsyncError';import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { getResourceQueryVisibility } from '@/features/ResourceManager/store/selectors';import { useClientDataSWR } from '@/libs/swr';import { resourceKeys } from '@/libs/swr/keys';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import { getResourceQueryVisibility } from '@/routes/(main)/resource/features/store/selectors';import { resourceService } from '@/services/resource';import { useGlobalStore } from '@/store/global';import {diff --git a/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx b/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsxindex bbb06a34681..6b1decb85fe 100644--- a/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx+++ b/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx@@ -15,9 +15,9 @@ import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceimport { useIsWorkspaceOwner } from '@/business/client/hooks/useIsWorkspaceOwner';import RepoIcon from '@/components/LibIcon';import { useKnowledgeBaseListContext } from '@/features/ResourceManager/components/KnowledgeBaseListProvider';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { openWorkspaceDeleteAllModal } from '@/features/WorkspaceDeleteAllModal';import { usePermission } from '@/hooks/usePermission';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';import { useKnowledgeBaseStore } from '@/store/library';import ActionIconWithChevron from './ActionIconWithChevron';diff --git a/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx b/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsxindex b41f0e23bd6..c9dd2df1f8e 100644--- a/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx+++ b/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx@@ -5,7 +5,7 @@ import { memo, useMemo } from 'react';import { useTranslation } from 'react-i18next';import { type MenuProps } from '@/components/Menu';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import ActionIconWithChevron from './ActionIconWithChevron';diff --git a/src/features/ResourceManager/components/Explorer/hooks/useExplorerSelection.test.tsx b/src/features/ResourceManager/components/Explorer/hooks/useExplorerSelection.test.tsxindex 82792bd8924..3dadb2e7cfa 100644--- a/src/features/ResourceManager/components/Explorer/hooks/useExplorerSelection.test.tsx+++ b/src/features/ResourceManager/components/Explorer/hooks/useExplorerSelection.test.tsx@@ -1,8 +1,8 @@import { act, renderHook } from '@testing-library/react';import { beforeEach, describe, expect, it } from 'vitest';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import { initialState } from '@/routes/(main)/resource/features/store/initialState';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { initialState } from '@/features/ResourceManager/store/initialState';import { isExplorerItemSelectable, useExplorerSelectionActions } from './useExplorerSelection';diff --git a/src/features/ResourceManager/components/Explorer/hooks/useExplorerSelection.ts b/src/features/ResourceManager/components/Explorer/hooks/useExplorerSelection.tsindex 26fc9aa89fb..14085fdac61 100644--- a/src/features/ResourceManager/components/Explorer/hooks/useExplorerSelection.ts+++ b/src/features/ResourceManager/components/Explorer/hooks/useExplorerSelection.ts@@ -2,13 +2,13 @@ import { useCallback, useMemo } from 'react';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import { useIsWorkspaceOwner } from '@/business/client/hooks/useIsWorkspaceOwner';-import { useEventCallback } from '@/hooks/useEventCallback';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import {getExplorerSelectAllUiState,getExplorerSelectedCount,isExplorerItemSelected,-} from '@/routes/(main)/resource/features/store/selectors';+} from '@/features/ResourceManager/store/selectors';+import { useEventCallback } from '@/hooks/useEventCallback';import { useFileStore } from '@/store/file';import { useUserStore } from '@/store/user';import { userProfileSelectors } from '@/store/user/selectors';diff --git a/src/features/ResourceManager/components/Explorer/hooks/useFileItemClick.ts b/src/features/ResourceManager/components/Explorer/hooks/useFileItemClick.tsindex 2f46b5fc73f..92a188223a0 100644--- a/src/features/ResourceManager/components/Explorer/hooks/useFileItemClick.ts+++ b/src/features/ResourceManager/components/Explorer/hooks/useFileItemClick.ts@@ -1,8 +1,8 @@import { useCallback } from 'react';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { useActiveLocation } from '@/hooks/useActiveLocation';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';export interface UseFileItemClickOptions {id: string;diff --git a/src/features/ResourceManager/components/Explorer/hooks/useResetSelectionOnQueryChange.test.tsx b/src/features/ResourceManager/components/Explorer/hooks/useResetSelectionOnQueryChange.test.tsxindex 49eff21860e..abb0ad79a3b 100644--- a/src/features/ResourceManager/components/Explorer/hooks/useResetSelectionOnQueryChange.test.tsx+++ b/src/features/ResourceManager/components/Explorer/hooks/useResetSelectionOnQueryChange.test.tsx@@ -1,8 +1,8 @@import { act, renderHook } from '@testing-library/react';import { beforeEach, describe, expect, it } from 'vitest';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import { initialState } from '@/routes/(main)/resource/features/store/initialState';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { initialState } from '@/features/ResourceManager/store/initialState';import { FilesTabs } from '@/types/files';import { useResetSelectionOnQueryChange } from './useResetSelectionOnQueryChange';diff --git a/src/features/ResourceManager/components/Explorer/hooks/useResetSelectionOnQueryChange.ts b/src/features/ResourceManager/components/Explorer/hooks/useResetSelectionOnQueryChange.tsindex 922cdbc3e69..ed3869b6767 100644--- a/src/features/ResourceManager/components/Explorer/hooks/useResetSelectionOnQueryChange.ts+++ b/src/features/ResourceManager/components/Explorer/hooks/useResetSelectionOnQueryChange.ts@@ -1,6 +1,6 @@import { useEffect } from 'react';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import type { FilesTabs } from '@/types/files';interface ResetSelectionOnQueryChangeOptions {diff --git a/src/features/ResourceManager/components/Explorer/hooks/useViewMode.ts b/src/features/ResourceManager/components/Explorer/hooks/useViewMode.tsindex be05c0dff94..f42bc01f97c 100644--- a/src/features/ResourceManager/components/Explorer/hooks/useViewMode.ts+++ b/src/features/ResourceManager/components/Explorer/hooks/useViewMode.ts@@ -1,8 +1,8 @@import { useCallback, useEffect } from 'react';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { type ViewMode } from '@/features/ResourceManager/store/initialState';import { parseAsStringEnum, useQueryState } from '@/hooks/useQueryParam';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import { type ViewMode } from '@/routes/(main)/resource/features/store/initialState';/*** Hook to manage view mode with URL query syncdiff --git a/src/features/ResourceManager/components/Explorer/index.test.tsx b/src/features/ResourceManager/components/Explorer/index.test.tsxindex 6df41116bd4..0aea1bea15c 100644--- a/src/features/ResourceManager/components/Explorer/index.test.tsx+++ b/src/features/ResourceManager/components/Explorer/index.test.tsx@@ -19,20 +19,20 @@ const mocks = vi.hoisted(() => ({useFetchResources: vi.fn(),}));-vi.mock('@/routes/(main)/resource/features/hooks/useFolderPath', () => ({+vi.mock('@/features/ResourceManager/hooks/useFolderPath', () => ({useFolderPath: () => ({ currentFolderSlug: null }),}));-vi.mock('@/routes/(main)/resource/features/hooks/useResourceManagerUrlSync', () => ({+vi.mock('@/features/ResourceManager/hooks/useResourceManagerUrlSync', () => ({useResourceManagerUrlSync: vi.fn(),}));-vi.mock('@/routes/(main)/resource/features/store', () => ({+vi.mock('@/features/ResourceManager/store', () => ({useResourceManagerStore: (selector: (state: typeof mocks.resourceManagerState) => unknown) =>selector(mocks.resourceManagerState),}));-vi.mock('@/routes/(main)/resource/features/store/selectors', () => ({+vi.mock('@/features/ResourceManager/store/selectors', () => ({getResourceQueryVisibility: (libraryId: string | undefined,visibility: 'private' | 'workspace',diff --git a/src/features/ResourceManager/components/Explorer/index.tsx b/src/features/ResourceManager/components/Explorer/index.tsxindex f48296b2d6f..14b3c5fc47e 100644--- a/src/features/ResourceManager/components/Explorer/index.tsx+++ b/src/features/ResourceManager/components/Explorer/index.tsx@@ -4,13 +4,13 @@ import { Flexbox } from '@lobehub/ui';import { memo, useMemo } from 'react';import AsyncBoundary from '@/components/AsyncBoundary';-import { useFolderPath } from '@/routes/(main)/resource/features/hooks/useFolderPath';-import { useResourceManagerUrlSync } from '@/routes/(main)/resource/features/hooks/useResourceManagerUrlSync';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import { useFolderPath } from '@/features/ResourceManager/hooks/useFolderPath';+import { useResourceManagerUrlSync } from '@/features/ResourceManager/hooks/useResourceManagerUrlSync';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import {getResourceQueryVisibility,sortFileList,-} from '@/routes/(main)/resource/features/store/selectors';+} from '@/features/ResourceManager/store/selectors';import { useFetchResources, useResourceStore } from '@/store/file/slices/resource/hooks';import { KnowledgeBaseListProvider } from '../KnowledgeBaseListProvider';diff --git a/src/features/ResourceManager/components/Header/AddButton.tsx b/src/features/ResourceManager/components/Header/AddButton.tsxindex d29c0b44ac6..e5701afb454 100644--- a/src/features/ResourceManager/components/Header/AddButton.tsx+++ b/src/features/ResourceManager/components/Header/AddButton.tsx@@ -15,10 +15,10 @@ import { type ChangeEvent } from 'react';import { useCallback, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';+import { useCurrentFolderId } from '@/features/ResourceManager/hooks/useCurrentFolderId';import { useTopLevelFileUpload } from '@/features/ResourceManager/hooks/useTopLevelFileUpload';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { usePermission } from '@/hooks/usePermission';-import { useCurrentFolderId } from '@/routes/(main)/resource/features/hooks/useCurrentFolderId';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';import { useFileStore } from '@/store/file';import { FilesTabs } from '@/types/files';diff --git a/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx b/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsxindex 2c60c02873c..dea3fea5612 100644--- a/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx+++ b/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx@@ -12,14 +12,14 @@ import React, { memo, useCallback, useMemo, useRef, useState } from 'react';import FileIcon from '@/components/FileIcon';import { PAGE_FILE_TYPE } from '@/features/ResourceManager/constants';-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import { showContextMenu } from '@/libs/contextMenu';import {getTransparentDragImage,useDragActive,useSetCurrentDrag,-} from '@/routes/(main)/resource/features/DndContextWrapper';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+} from '@/features/ResourceManager/DndContextWrapper';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';+import { showContextMenu } from '@/libs/contextMenu';import type { TreeItem } from '@/store/tree';import { useTreeStore } from '@/store/tree';diff --git a/src/features/ResourceManager/components/LibraryHierarchy/index.tsx b/src/features/ResourceManager/components/LibraryHierarchy/index.tsxindex 52cb2ee1282..fdb37996f5e 100644--- a/src/features/ResourceManager/components/LibraryHierarchy/index.tsx+++ b/src/features/ResourceManager/components/LibraryHierarchy/index.tsx@@ -8,8 +8,8 @@ import { useTranslation } from 'react-i18next';import { VList } from 'virtua';import AsyncBoundary from '@/components/AsyncBoundary';-import { useFolderPath } from '@/routes/(main)/resource/features/hooks/useFolderPath';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import { useFolderPath } from '@/features/ResourceManager/hooks/useFolderPath';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { useFileStore } from '@/store/file';import type { TreeItem } from '@/store/tree';import { useTreeStore } from '@/store/tree';diff --git a/src/features/ResourceManager/components/ResourceModeToggle/index.tsx b/src/features/ResourceManager/components/ResourceModeToggle/index.tsxindex a07cb1251a6..4a1a7997941 100644--- a/src/features/ResourceManager/components/ResourceModeToggle/index.tsx+++ b/src/features/ResourceManager/components/ResourceModeToggle/index.tsx@@ -7,8 +7,8 @@ import { memo, useEffect } from 'react';import { useTranslation } from 'react-i18next';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';-import type { ResourceListVisibilityFilter } from '@/routes/(main)/resource/features/store/initialState';+import { useResourceManagerStore } from '@/features/ResourceManager/store';+import type { ResourceListVisibilityFilter } from '@/features/ResourceManager/store/initialState';const styles = createStaticStyles(({ css, cssVar }) => {return {diff --git a/src/routes/(main)/resource/features/hooks/useCurrentFolderId.ts b/src/features/ResourceManager/hooks/useCurrentFolderId.tssimilarity index 100%rename from src/routes/(main)/resource/features/hooks/useCurrentFolderId.tsrename to src/features/ResourceManager/hooks/useCurrentFolderId.tsdiff --git a/src/routes/(main)/resource/features/hooks/useFolderPath.ts b/src/features/ResourceManager/hooks/useFolderPath.tssimilarity index 100%rename from src/routes/(main)/resource/features/hooks/useFolderPath.tsrename to src/features/ResourceManager/hooks/useFolderPath.tsdiff --git a/src/routes/(main)/resource/features/hooks/useInitFileCheck.ts b/src/features/ResourceManager/hooks/useInitFileCheck.tssimilarity index 100%rename from src/routes/(main)/resource/features/hooks/useInitFileCheck.tsrename to src/features/ResourceManager/hooks/useInitFileCheck.tsdiff --git a/src/routes/(main)/resource/features/hooks/useKnowledgeItem.ts b/src/features/ResourceManager/hooks/useKnowledgeItem.tssimilarity index 100%rename from src/routes/(main)/resource/features/hooks/useKnowledgeItem.tsrename to src/features/ResourceManager/hooks/useKnowledgeItem.tsdiff --git a/src/routes/(main)/resource/features/hooks/useResourceManagerUrlSync.ts b/src/features/ResourceManager/hooks/useResourceManagerUrlSync.tssimilarity index 92%rename from src/routes/(main)/resource/features/hooks/useResourceManagerUrlSync.tsrename to src/features/ResourceManager/hooks/useResourceManagerUrlSync.tsindex 4d3c13e543a..36bcb368ac0 100644--- a/src/routes/(main)/resource/features/hooks/useResourceManagerUrlSync.ts+++ b/src/features/ResourceManager/hooks/useResourceManagerUrlSync.ts@@ -1,7 +1,7 @@import { useEffect } from 'react';import { useSearchParams } from 'react-router';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { SortType } from '@/types/files';/**@@ -21,9 +21,7 @@ export const useResourceManagerUrlSync = () => {// Initialize store from URL on mount (URL → Store)useEffect(() => {const sorterParam = (searchParams.get('sorter') || 'createdAt') as- | 'name'- | 'createdAt'- | 'size';+ 'name' | 'createdAt' | 'size';const sortTypeParam = (searchParams.get('sortType') || SortType.Desc) as SortType;setSorter(sorterParam);diff --git a/src/features/ResourceManager/hooks/useTopLevelFileUpload.ts b/src/features/ResourceManager/hooks/useTopLevelFileUpload.tsindex 6767004966d..dfd90840af4 100644--- a/src/features/ResourceManager/hooks/useTopLevelFileUpload.ts+++ b/src/features/ResourceManager/hooks/useTopLevelFileUpload.ts@@ -1,8 +1,8 @@import { useCallback } from 'react';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';-import { useCurrentFolderId } from '@/routes/(main)/resource/features/hooks/useCurrentFolderId';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';+import { useCurrentFolderId } from '@/features/ResourceManager/hooks/useCurrentFolderId';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { useFileStore } from '@/store/file';/**diff --git a/src/features/ResourceManager/index.tsx b/src/features/ResourceManager/index.tsxindex ef839166853..eea1cdaa87e 100644--- a/src/features/ResourceManager/index.tsx+++ b/src/features/ResourceManager/index.tsx@@ -7,9 +7,9 @@ import { useSearchParams } from 'react-router';import DragUploadZone from '@/components/DragUploadZone';import { PageEditor } from '@/features/PageEditor';+import { useResourceManagerStore } from '@/features/ResourceManager/store';import { usePermission } from '@/hooks/usePermission';import dynamic from '@/libs/next/dynamic';-import { useResourceManagerStore } from '@/routes/(main)/resource/features/store';import { documentService } from '@/services/document';import { useFileStore } from '@/store/file';import { documentSelectors } from '@/store/file/slices/document/selectors';diff --git a/src/routes/(main)/resource/features/store/action.test.ts b/src/features/ResourceManager/store/action.test.tssimilarity index 100%rename from src/routes/(main)/resource/features/store/action.test.tsrename to src/features/ResourceManager/store/action.test.tsdiff --git a/src/routes/(main)/resource/features/store/action.ts b/src/features/ResourceManager/store/action.tssimilarity index 100%rename from src/routes/(main)/resource/features/store/action.tsrename to src/features/ResourceManager/store/action.tsdiff --git a/src/routes/(main)/resource/features/store/index.ts b/src/features/ResourceManager/store/index.tssimilarity index 100%rename from src/routes/(main)/resource/features/store/index.tsrename to src/features/ResourceManager/store/index.tsdiff --git a/src/routes/(main)/resource/features/store/initialState.ts b/src/features/ResourceManager/store/initialState.tssimilarity index 100%rename from src/routes/(main)/resource/features/store/initialState.tsrename to src/features/ResourceManager/store/initialState.tsdiff --git a/src/routes/(main)/resource/features/store/modePersistence.ts b/src/features/ResourceManager/store/modePersistence.tssimilarity index 100%rename from src/routes/(main)/resource/features/store/modePersistence.tsrename to src/features/ResourceManager/store/modePersistence.tsdiff --git a/src/routes/(main)/resource/features/store/selectors.test.ts b/src/features/ResourceManager/store/selectors.test.tssimilarity index 100%rename from src/routes/(main)/resource/features/store/selectors.test.tsrename to src/features/ResourceManager/store/selectors.test.tsdiff --git a/src/routes/(main)/resource/features/store/selectors.ts b/src/features/ResourceManager/store/selectors.tssimilarity index 100%rename from src/routes/(main)/resource/features/store/selectors.tsrename to src/features/ResourceManager/store/selectors.tsdiff --git a/src/routes/(main)/settings/_layout/Body/activeTab.desktop.test.ts b/src/features/Settings/Layout/Body/activeTab.desktop.test.tssimilarity index 100%rename from src/routes/(main)/settings/_layout/Body/activeTab.desktop.test.tsrename to src/features/Settings/Layout/Body/activeTab.desktop.test.tsdiff --git a/src/routes/(main)/settings/_layout/Body/index.tsx b/src/features/Settings/Layout/Body/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/_layout/Body/index.tsxrename to src/features/Settings/Layout/Body/index.tsxdiff --git a/src/routes/(main)/settings/_layout/ContextProvider/index.tsx b/src/features/Settings/Layout/ContextProvider/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/_layout/ContextProvider/index.tsxrename to src/features/Settings/Layout/ContextProvider/index.tsxdiff --git a/src/routes/(main)/settings/_layout/Header.tsx b/src/features/Settings/Layout/Header.tsxsimilarity index 100%rename from src/routes/(main)/settings/_layout/Header.tsxrename to src/features/Settings/Layout/Header.tsxdiff --git a/src/routes/(main)/settings/_layout/SideBar.tsx b/src/features/Settings/Layout/SideBar.tsxsimilarity index 100%rename from src/routes/(main)/settings/_layout/SideBar.tsxrename to src/features/Settings/Layout/SideBar.tsxdiff --git a/src/routes/(main)/settings/_layout/SidebarContent.tsx b/src/features/Settings/Layout/SidebarContent.tsxsimilarity index 100%rename from src/routes/(main)/settings/_layout/SidebarContent.tsxrename to src/features/Settings/Layout/SidebarContent.tsxdiff --git a/src/features/Settings/Layout/index.tsx b/src/features/Settings/Layout/index.tsxnew file mode 100644index 00000000000..f330cbff7bb--- /dev/null+++ b/src/features/Settings/Layout/index.tsx@@ -0,0 +1,28 @@+'use client';++import { Flexbox } from '@lobehub/ui';+import { type FC } from 'react';+import { Outlet } from 'react-router';++import SideBar from '@/features/Settings/Layout/SideBar';++import SettingsContextProvider from './ContextProvider';+import { styles } from './style';++const Layout: FC = () => {+ return (+ <SettingsContextProvider+ value={{+ showOpenAIApiKey: true,+ showOpenAIProxyUrl: true,+ }}+ >+ <SideBar />+ <Flexbox className={styles.mainContainer} flex={1} height={'100%'}>+ <Outlet />+ </Flexbox>+ </SettingsContextProvider>+ );+};++export default Layout;diff --git a/src/routes/(main)/settings/_layout/style.ts b/src/features/Settings/Layout/style.tssimilarity index 100%rename from src/routes/(main)/settings/_layout/style.tsrename to src/features/Settings/Layout/style.tsdiff --git a/src/routes/(main)/settings/_layout/type.ts b/src/features/Settings/Layout/type.tssimilarity index 100%rename from src/routes/(main)/settings/_layout/type.tsrename to src/features/Settings/Layout/type.tsdiff --git a/src/routes/(main)/settings/about/features/About.tsx b/src/features/Settings/about/features/About.tsxsimilarity index 100%rename from src/routes/(main)/settings/about/features/About.tsxrename to src/features/Settings/about/features/About.tsxdiff --git a/src/routes/(main)/settings/about/features/AboutList.tsx b/src/features/Settings/about/features/AboutList.tsxsimilarity index 100%rename from src/routes/(main)/settings/about/features/AboutList.tsxrename to src/features/Settings/about/features/AboutList.tsxdiff --git a/src/routes/(main)/settings/about/features/Analytics.tsx b/src/features/Settings/about/features/Analytics.tsxsimilarity index 100%rename from src/routes/(main)/settings/about/features/Analytics.tsxrename to src/features/Settings/about/features/Analytics.tsxdiff --git a/src/routes/(main)/settings/about/features/ItemCard.tsx b/src/features/Settings/about/features/ItemCard.tsxsimilarity index 100%rename from src/routes/(main)/settings/about/features/ItemCard.tsxrename to src/features/Settings/about/features/ItemCard.tsxdiff --git a/src/routes/(main)/settings/about/features/ItemLink.tsx b/src/features/Settings/about/features/ItemLink.tsxsimilarity index 100%rename from src/routes/(main)/settings/about/features/ItemLink.tsxrename to src/features/Settings/about/features/ItemLink.tsxdiff --git a/src/routes/(main)/settings/about/features/Version.tsx b/src/features/Settings/about/features/Version.tsxsimilarity index 100%rename from src/routes/(main)/settings/about/features/Version.tsxrename to src/features/Settings/about/features/Version.tsxdiff --git a/src/routes/(main)/settings/about/features/appVersion.desktop.ts b/src/features/Settings/about/features/appVersion.desktop.tssimilarity index 100%rename from src/routes/(main)/settings/about/features/appVersion.desktop.tsrename to src/features/Settings/about/features/appVersion.desktop.tsdiff --git a/src/routes/(main)/settings/about/features/appVersion.ts b/src/features/Settings/about/features/appVersion.tssimilarity index 100%rename from src/routes/(main)/settings/about/features/appVersion.tsrename to src/features/Settings/about/features/appVersion.tsdiff --git a/src/routes/(main)/settings/about/index.tsx b/src/features/Settings/about/index.tsxsimilarity index 86%rename from src/routes/(main)/settings/about/index.tsxrename to src/features/Settings/about/index.tsxindex 51570c9c214..cb60baaa40f 100644--- a/src/routes/(main)/settings/about/index.tsx+++ b/src/features/Settings/about/index.tsx@@ -1,6 +1,6 @@import { useTranslation } from 'react-i18next';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import About from './features/About';import Analytics from './features/Analytics';diff --git a/src/routes/(main)/settings/advanced/index.tsx b/src/features/Settings/advanced/index.tsxsimilarity index 98%rename from src/routes/(main)/settings/advanced/index.tsxrename to src/features/Settings/advanced/index.tsxindex 0466e70e2c1..87cc6312b34 100644--- a/src/routes/(main)/settings/advanced/index.tsx+++ b/src/features/Settings/advanced/index.tsx@@ -12,8 +12,8 @@ import { useTranslation } from 'react-i18next';import AsyncError from '@/components/AsyncError';import { FORM_STYLE } from '@/const/layoutTokens';+import SettingHeader from '@/features/Settings/features/SettingHeader';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';import { autoUpdateService } from '@/services/electron/autoUpdate';import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';import { useUserStore } from '@/store/user';diff --git a/src/routes/(main)/settings/advanced/settingsCopy.test.ts b/src/features/Settings/advanced/settingsCopy.test.tssimilarity index 100%rename from src/routes/(main)/settings/advanced/settingsCopy.test.tsrename to src/features/Settings/advanced/settingsCopy.test.tsdiff --git a/src/routes/(main)/settings/apikey/features/ApiKey.test.tsx b/src/features/Settings/apikey/features/ApiKey.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/apikey/features/ApiKey.test.tsxrename to src/features/Settings/apikey/features/ApiKey.test.tsxdiff --git a/src/routes/(main)/settings/apikey/features/ApiKey.tsx b/src/features/Settings/apikey/features/ApiKey.tsxsimilarity index 100%rename from src/routes/(main)/settings/apikey/features/ApiKey.tsxrename to src/features/Settings/apikey/features/ApiKey.tsxdiff --git a/src/routes/(main)/settings/apikey/features/ApiKeyDatePicker/index.tsx b/src/features/Settings/apikey/features/ApiKeyDatePicker/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/apikey/features/ApiKeyDatePicker/index.tsxrename to src/features/Settings/apikey/features/ApiKeyDatePicker/index.tsxdiff --git a/src/routes/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx b/src/features/Settings/apikey/features/ApiKeyDisplay/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/apikey/features/ApiKeyDisplay/index.tsxrename to src/features/Settings/apikey/features/ApiKeyDisplay/index.tsxdiff --git a/src/routes/(main)/settings/apikey/features/ApiKeyModal/Content.tsx b/src/features/Settings/apikey/features/ApiKeyModal/Content.tsxsimilarity index 100%rename from src/routes/(main)/settings/apikey/features/ApiKeyModal/Content.tsxrename to src/features/Settings/apikey/features/ApiKeyModal/Content.tsxdiff --git a/src/routes/(main)/settings/apikey/features/ApiKeyModal/index.tsx b/src/features/Settings/apikey/features/ApiKeyModal/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/apikey/features/ApiKeyModal/index.tsxrename to src/features/Settings/apikey/features/ApiKeyModal/index.tsxdiff --git a/src/routes/(main)/settings/apikey/features/EditableCell/index.tsx b/src/features/Settings/apikey/features/EditableCell/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/apikey/features/EditableCell/index.tsxrename to src/features/Settings/apikey/features/EditableCell/index.tsxdiff --git a/src/routes/(main)/settings/apikey/features/index.ts b/src/features/Settings/apikey/features/index.tssimilarity index 100%rename from src/routes/(main)/settings/apikey/features/index.tsrename to src/features/Settings/apikey/features/index.tsdiff --git a/src/routes/(main)/settings/apikey/index.tsx b/src/features/Settings/apikey/index.tsxsimilarity index 83%rename from src/routes/(main)/settings/apikey/index.tsxrename to src/features/Settings/apikey/index.tsxindex 51ebe19acb3..7ceaab16bf5 100644--- a/src/routes/(main)/settings/apikey/index.tsx+++ b/src/features/Settings/apikey/index.tsx@@ -1,6 +1,6 @@import { useTranslation } from 'react-i18next';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import ApiKey from './features/ApiKey';diff --git a/src/routes/(main)/settings/appearance/features/Desktop.tsx b/src/features/Settings/appearance/features/Desktop.tsxsimilarity index 100%rename from src/routes/(main)/settings/appearance/features/Desktop.tsxrename to src/features/Settings/appearance/features/Desktop.tsxdiff --git a/src/features/Settings/Appearance/Terminal/index.test.tsx b/src/features/Settings/appearance/features/Terminal/index.test.tsxsimilarity index 100%rename from src/features/Settings/Appearance/Terminal/index.test.tsxrename to src/features/Settings/appearance/features/Terminal/index.test.tsxdiff --git a/src/features/Settings/Appearance/Terminal/index.tsx b/src/features/Settings/appearance/features/Terminal/index.tsxsimilarity index 100%rename from src/features/Settings/Appearance/Terminal/index.tsxrename to src/features/Settings/appearance/features/Terminal/index.tsxdiff --git a/src/routes/(main)/settings/appearance/index.tsx b/src/features/Settings/appearance/index.tsxsimilarity index 82%rename from src/routes/(main)/settings/appearance/index.tsxrename to src/features/Settings/appearance/index.tsxindex fc052d17c99..04fafe2d7c0 100644--- a/src/routes/(main)/settings/appearance/index.tsx+++ b/src/features/Settings/appearance/index.tsx@@ -1,12 +1,12 @@import { useTranslation } from 'react-i18next';-import Terminal from '@/features/Settings/Appearance/Terminal';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import ChatAppearance from '../chat-appearance/features/ChatAppearance';import Appearance from '../common/features/Appearance';import Common from '../common/features/Common/Common';import Desktop from './features/Desktop';+import Terminal from './features/Terminal';interface PageProps {showSettingHeader?: boolean;diff --git a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/ChatPreview.tsx b/src/features/Settings/chat-appearance/features/ChatAppearance/ChatPreview.tsxsimilarity index 100%rename from src/routes/(main)/settings/chat-appearance/features/ChatAppearance/ChatPreview.tsxrename to src/features/Settings/chat-appearance/features/ChatAppearance/ChatPreview.tsxdiff --git a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/ChatTransitionPreview.tsx b/src/features/Settings/chat-appearance/features/ChatAppearance/ChatTransitionPreview.tsxsimilarity index 100%rename from src/routes/(main)/settings/chat-appearance/features/ChatAppearance/ChatTransitionPreview.tsxrename to src/features/Settings/chat-appearance/features/ChatAppearance/ChatTransitionPreview.tsxdiff --git a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/HighlighterPreview.tsx b/src/features/Settings/chat-appearance/features/ChatAppearance/HighlighterPreview.tsxsimilarity index 100%rename from src/routes/(main)/settings/chat-appearance/features/ChatAppearance/HighlighterPreview.tsxrename to src/features/Settings/chat-appearance/features/ChatAppearance/HighlighterPreview.tsxdiff --git a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/LinkIconPreview.tsx b/src/features/Settings/chat-appearance/features/ChatAppearance/LinkIconPreview.tsxsimilarity index 100%rename from src/routes/(main)/settings/chat-appearance/features/ChatAppearance/LinkIconPreview.tsxrename to src/features/Settings/chat-appearance/features/ChatAppearance/LinkIconPreview.tsxdiff --git a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/MermaidPreview.tsx b/src/features/Settings/chat-appearance/features/ChatAppearance/MermaidPreview.tsxsimilarity index 100%rename from src/routes/(main)/settings/chat-appearance/features/ChatAppearance/MermaidPreview.tsxrename to src/features/Settings/chat-appearance/features/ChatAppearance/MermaidPreview.tsxdiff --git a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx b/src/features/Settings/chat-appearance/features/ChatAppearance/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsxrename to src/features/Settings/chat-appearance/features/ChatAppearance/index.tsxdiff --git a/src/routes/(main)/settings/common/features/Appearance/Preview.tsx b/src/features/Settings/common/features/Appearance/Preview.tsxsimilarity index 100%rename from src/routes/(main)/settings/common/features/Appearance/Preview.tsxrename to src/features/Settings/common/features/Appearance/Preview.tsxdiff --git a/src/routes/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesNeutral.tsx b/src/features/Settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesNeutral.tsxsimilarity index 100%rename from src/routes/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesNeutral.tsxrename to src/features/Settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesNeutral.tsxdiff --git a/src/routes/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesPrimary.tsx b/src/features/Settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesPrimary.tsxsimilarity index 100%rename from src/routes/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesPrimary.tsxrename to src/features/Settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesPrimary.tsxdiff --git a/src/routes/(main)/settings/common/features/Appearance/ThemeSwatches/index.ts b/src/features/Settings/common/features/Appearance/ThemeSwatches/index.tssimilarity index 100%rename from src/routes/(main)/settings/common/features/Appearance/ThemeSwatches/index.tsrename to src/features/Settings/common/features/Appearance/ThemeSwatches/index.tsdiff --git a/src/routes/(main)/settings/common/features/Appearance/index.tsx b/src/features/Settings/common/features/Appearance/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/common/features/Appearance/index.tsxrename to src/features/Settings/common/features/Appearance/index.tsxdiff --git a/src/routes/(main)/settings/common/features/Common/Common.tsx b/src/features/Settings/common/features/Common/Common.tsxsimilarity index 100%rename from src/routes/(main)/settings/common/features/Common/Common.tsxrename to src/features/Settings/common/features/Common/Common.tsxdiff --git a/src/routes/(main)/settings/connector/index.tsx b/src/features/Settings/connector/index.tsxsimilarity index 73%rename from src/routes/(main)/settings/connector/index.tsxrename to src/features/Settings/connector/index.tsxindex 2b4ab8836b8..fe90fe0035e 100644--- a/src/routes/(main)/settings/connector/index.tsx+++ b/src/features/Settings/connector/index.tsx@@ -2,7 +2,7 @@import { memo } from 'react';-import { ToolSettings } from '@/routes/(main)/settings/skill';+import { ToolSettings } from '@/features/Settings/skill';const Page = memo(() => <ToolSettings viewMode="connector" />);diff --git a/src/routes/(main)/settings/creds/features/CreateCredModal/Content.tsx b/src/features/Settings/creds/features/CreateCredModal/Content.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/CreateCredModal/Content.tsxrename to src/features/Settings/creds/features/CreateCredModal/Content.tsxdiff --git a/src/routes/(main)/settings/creds/features/CreateCredModal/CredTypeSelector.tsx b/src/features/Settings/creds/features/CreateCredModal/CredTypeSelector.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/CreateCredModal/CredTypeSelector.tsxrename to src/features/Settings/creds/features/CreateCredModal/CredTypeSelector.tsxdiff --git a/src/routes/(main)/settings/creds/features/CreateCredModal/FileCredForm.tsx b/src/features/Settings/creds/features/CreateCredModal/FileCredForm.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/CreateCredModal/FileCredForm.tsxrename to src/features/Settings/creds/features/CreateCredModal/FileCredForm.tsxdiff --git a/src/routes/(main)/settings/creds/features/CreateCredModal/KVCredForm.tsx b/src/features/Settings/creds/features/CreateCredModal/KVCredForm.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/CreateCredModal/KVCredForm.tsxrename to src/features/Settings/creds/features/CreateCredModal/KVCredForm.tsxdiff --git a/src/routes/(main)/settings/creds/features/CreateCredModal/OAuthCredForm.tsx b/src/features/Settings/creds/features/CreateCredModal/OAuthCredForm.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/CreateCredModal/OAuthCredForm.tsxrename to src/features/Settings/creds/features/CreateCredModal/OAuthCredForm.tsxdiff --git a/src/routes/(main)/settings/creds/features/CreateCredModal/index.tsx b/src/features/Settings/creds/features/CreateCredModal/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/CreateCredModal/index.tsxrename to src/features/Settings/creds/features/CreateCredModal/index.tsxdiff --git a/src/routes/(main)/settings/creds/features/CredItem.tsx b/src/features/Settings/creds/features/CredItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/CredItem.tsxrename to src/features/Settings/creds/features/CredItem.tsxdiff --git a/src/routes/(main)/settings/creds/features/CredsList.tsx b/src/features/Settings/creds/features/CredsList.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/CredsList.tsxrename to src/features/Settings/creds/features/CredsList.tsxdiff --git a/src/routes/(main)/settings/creds/features/EditCredModal/Content.tsx b/src/features/Settings/creds/features/EditCredModal/Content.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/EditCredModal/Content.tsxrename to src/features/Settings/creds/features/EditCredModal/Content.tsxdiff --git a/src/routes/(main)/settings/creds/features/EditCredModal/EditKVForm.tsx b/src/features/Settings/creds/features/EditCredModal/EditKVForm.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/EditCredModal/EditKVForm.tsxrename to src/features/Settings/creds/features/EditCredModal/EditKVForm.tsxdiff --git a/src/routes/(main)/settings/creds/features/EditCredModal/EditMetaForm.tsx b/src/features/Settings/creds/features/EditCredModal/EditMetaForm.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/EditCredModal/EditMetaForm.tsxrename to src/features/Settings/creds/features/EditCredModal/EditMetaForm.tsxdiff --git a/src/routes/(main)/settings/creds/features/EditCredModal/index.tsx b/src/features/Settings/creds/features/EditCredModal/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/EditCredModal/index.tsxrename to src/features/Settings/creds/features/EditCredModal/index.tsxdiff --git a/src/routes/(main)/settings/creds/features/ViewCredModal/Content.tsx b/src/features/Settings/creds/features/ViewCredModal/Content.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/ViewCredModal/Content.tsxrename to src/features/Settings/creds/features/ViewCredModal/Content.tsxdiff --git a/src/routes/(main)/settings/creds/features/ViewCredModal/index.tsx b/src/features/Settings/creds/features/ViewCredModal/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/features/ViewCredModal/index.tsxrename to src/features/Settings/creds/features/ViewCredModal/index.tsxdiff --git a/src/routes/(main)/settings/creds/features/style.ts b/src/features/Settings/creds/features/style.tssimilarity index 100%rename from src/routes/(main)/settings/creds/features/style.tsrename to src/features/Settings/creds/features/style.tsdiff --git a/src/routes/(main)/settings/creds/features/useCredsApi.ts b/src/features/Settings/creds/features/useCredsApi.tssimilarity index 100%rename from src/routes/(main)/settings/creds/features/useCredsApi.tsrename to src/features/Settings/creds/features/useCredsApi.tsdiff --git a/src/routes/(main)/settings/creds/index.tsx b/src/features/Settings/creds/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/creds/index.tsxrename to src/features/Settings/creds/index.tsxdiff --git a/src/routes/(main)/settings/devices/index.tsx b/src/features/Settings/devices/index.tsxsimilarity index 93%rename from src/routes/(main)/settings/devices/index.tsxrename to src/features/Settings/devices/index.tsxindex 4b4b6a91af9..5d49471ccbf 100644--- a/src/routes/(main)/settings/devices/index.tsx+++ b/src/features/Settings/devices/index.tsx@@ -4,7 +4,7 @@ import { memo, useState } from 'react';import { useTranslation } from 'react-i18next';import { DeviceConnectModal, DeviceManager } from '@/features/DeviceManager';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';interface PageProps {showSettingHeader?: boolean;diff --git a/src/routes/(main)/settings/features/SettingHeader.tsx b/src/features/Settings/features/SettingHeader.tsxsimilarity index 100%rename from src/routes/(main)/settings/features/SettingHeader.tsxrename to src/features/Settings/features/SettingHeader.tsxdiff --git a/src/routes/(main)/settings/features/SettingsContent.tsx b/src/features/Settings/features/SettingsContent.tsxsimilarity index 100%rename from src/routes/(main)/settings/features/SettingsContent.tsxrename to src/features/Settings/features/SettingsContent.tsxdiff --git a/src/routes/(main)/settings/features/componentMap.desktop.ts b/src/features/Settings/features/componentMap.desktop.tssimilarity index 100%rename from src/routes/(main)/settings/features/componentMap.desktop.tsrename to src/features/Settings/features/componentMap.desktop.tsdiff --git a/src/routes/(main)/settings/features/componentMap.sync.test.ts b/src/features/Settings/features/componentMap.sync.test.tssimilarity index 100%rename from src/routes/(main)/settings/features/componentMap.sync.test.tsrename to src/features/Settings/features/componentMap.sync.test.tsdiff --git a/src/routes/(main)/settings/features/componentMap.ts b/src/features/Settings/features/componentMap.tssimilarity index 100%rename from src/routes/(main)/settings/features/componentMap.tsrename to src/features/Settings/features/componentMap.tsdiff --git a/src/routes/(main)/settings/features/routeMeta.ts b/src/features/Settings/features/routeMeta.tssimilarity index 100%rename from src/routes/(main)/settings/features/routeMeta.tsrename to src/features/Settings/features/routeMeta.tsdiff --git a/src/routes/(main)/settings/hooks/useCategory.test.tsx b/src/features/Settings/hooks/useCategory.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/hooks/useCategory.test.tsxrename to src/features/Settings/hooks/useCategory.test.tsxdiff --git a/src/routes/(main)/settings/hooks/useCategory.tsx b/src/features/Settings/hooks/useCategory.tsxsimilarity index 100%rename from src/routes/(main)/settings/hooks/useCategory.tsxrename to src/features/Settings/hooks/useCategory.tsxdiff --git a/src/routes/(main)/settings/hotkey/features/Conversation.tsx b/src/features/Settings/hotkey/features/Conversation.tsxsimilarity index 100%rename from src/routes/(main)/settings/hotkey/features/Conversation.tsxrename to src/features/Settings/hotkey/features/Conversation.tsxdiff --git a/src/routes/(main)/settings/hotkey/features/Desktop.tsx b/src/features/Settings/hotkey/features/Desktop.tsxsimilarity index 100%rename from src/routes/(main)/settings/hotkey/features/Desktop.tsxrename to src/features/Settings/hotkey/features/Desktop.tsxdiff --git a/src/routes/(main)/settings/hotkey/features/Essential.tsx b/src/features/Settings/hotkey/features/Essential.tsxsimilarity index 100%rename from src/routes/(main)/settings/hotkey/features/Essential.tsxrename to src/features/Settings/hotkey/features/Essential.tsxdiff --git a/src/routes/(main)/settings/hotkey/features/styles.ts b/src/features/Settings/hotkey/features/styles.tssimilarity index 100%rename from src/routes/(main)/settings/hotkey/features/styles.tsrename to src/features/Settings/hotkey/features/styles.tsdiff --git a/src/routes/(main)/settings/hotkey/index.tsx b/src/features/Settings/hotkey/index.tsxsimilarity index 88%rename from src/routes/(main)/settings/hotkey/index.tsxrename to src/features/Settings/hotkey/index.tsxindex 7218b1ca5f6..8b7eb2c98ef 100644--- a/src/routes/(main)/settings/hotkey/index.tsx+++ b/src/features/Settings/hotkey/index.tsx@@ -1,7 +1,7 @@import { useTranslation } from 'react-i18next';import { isDesktop } from '@/const/version';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import Conversation from './features/Conversation';import Desktop from './features/Desktop';diff --git a/src/routes/(main)/settings/image/features/Image.tsx b/src/features/Settings/image/features/Image.tsxsimilarity index 100%rename from src/routes/(main)/settings/image/features/Image.tsxrename to src/features/Settings/image/features/Image.tsxdiff --git a/src/features/Settings/index.tsx b/src/features/Settings/index.tsxnew file mode 100644index 00000000000..024adf92705--- /dev/null+++ b/src/features/Settings/index.tsx@@ -0,0 +1,40 @@+'use client';++import { memo } from 'react';+import { useMatches, useParams } from 'react-router';++import { SettingsTabs } from '@/store/global/initialState';++import SettingsContent from './features/SettingsContent';+import { type LayoutProps } from './Layout/type';++interface SettingsRouteHandle {+ settingsTab?: SettingsTabs;+}++const isSettingsRouteHandle = (handle: unknown): handle is SettingsRouteHandle => {+ return typeof handle === 'object' && handle !== null && 'settingsTab' in handle;+};++const getSettingsTabFromMatches = (matches: ReturnType<typeof useMatches>) => {+ for (const match of [...matches].reverse()) {+ const { handle } = match;+ if (isSettingsRouteHandle(handle) && handle.settingsTab) return handle.settingsTab;+ }+};++const Layout = memo<LayoutProps>(() => {+ const params = useParams<{ tab?: string }>();+ const matches = useMatches();++ const activeTab =+ (params.tab as SettingsTabs | undefined) ||+ getSettingsTabFromMatches(matches) ||+ SettingsTabs.Profile;++ return <SettingsContent activeTab={activeTab} mobile={false} />;+});++Layout.displayName = 'DesktopSettingsLayout';++export default Layout;diff --git a/src/routes/(main)/settings/labels/index.tsx b/src/features/Settings/labels/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/labels/index.tsxrename to src/features/Settings/labels/index.tsxdiff --git a/src/routes/(main)/settings/labs/index.test.tsx b/src/features/Settings/labs/index.test.tsxsimilarity index 98%rename from src/routes/(main)/settings/labs/index.test.tsxrename to src/features/Settings/labs/index.test.tsxindex eb49f753423..7af5571cdab 100644--- a/src/routes/(main)/settings/labs/index.test.tsx+++ b/src/features/Settings/labs/index.test.tsx@@ -71,7 +71,7 @@ vi.mock('@lobehub/ui/base-ui', () => ({Switch: () => <button />,}));-vi.mock('@/routes/(main)/settings/features/SettingHeader', () => ({+vi.mock('@/features/Settings/features/SettingHeader', () => ({default: ({ description, title }: { description?: string; title: string }) => (<header><h1>{title}</h1>diff --git a/src/routes/(main)/settings/labs/index.tsx b/src/features/Settings/labs/index.tsxsimilarity index 98%rename from src/routes/(main)/settings/labs/index.tsxrename to src/features/Settings/labs/index.tsxindex 237628512d0..2d1b575976d 100644--- a/src/routes/(main)/settings/labs/index.tsx+++ b/src/features/Settings/labs/index.tsx@@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next';import AsyncError from '@/components/AsyncError';import { FORM_STYLE } from '@/const/layoutTokens';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import { useUserStore } from '@/store/user';import { labPreferSelectors, preferenceSelectors } from '@/store/user/selectors';import { type UserLab } from '@/types/user';diff --git a/src/routes/(main)/settings/memory/features/ManageMemoryButton.tsx b/src/features/Settings/memory/features/ManageMemoryButton.tsxsimilarity index 100%rename from src/routes/(main)/settings/memory/features/ManageMemoryButton.tsxrename to src/features/Settings/memory/features/ManageMemoryButton.tsxdiff --git a/src/routes/(main)/settings/memory/features/Memory.tsx b/src/features/Settings/memory/features/Memory.tsxsimilarity index 100%rename from src/routes/(main)/settings/memory/features/Memory.tsxrename to src/features/Settings/memory/features/Memory.tsxdiff --git a/src/routes/(main)/settings/memory/index.tsx b/src/features/Settings/memory/index.tsxsimilarity index 87%rename from src/routes/(main)/settings/memory/index.tsxrename to src/features/Settings/memory/index.tsxindex 450a80b64d9..acf190d584d 100644--- a/src/routes/(main)/settings/memory/index.tsx+++ b/src/features/Settings/memory/index.tsx@@ -2,7 +2,7 @@import { useTranslation } from 'react-i18next';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import { ManageMemoryButton } from './features/ManageMemoryButton';import Memory from './features/Memory';diff --git a/src/routes/(main)/settings/messenger/index.tsx b/src/features/Settings/messenger/index.tsxsimilarity index 84%rename from src/routes/(main)/settings/messenger/index.tsxrename to src/features/Settings/messenger/index.tsxindex 7073653dd0f..bb99f560b02 100644--- a/src/routes/(main)/settings/messenger/index.tsx+++ b/src/features/Settings/messenger/index.tsx@@ -1,7 +1,7 @@import { useTranslation } from 'react-i18next';import MessengerSettings from '@/features/Messenger';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';interface PageProps {showSettingHeader?: boolean;diff --git a/src/routes/(main)/settings/oauth-apps/features/AppDetail/EditForm.tsx b/src/features/Settings/oauth-apps/features/AppDetail/EditForm.tsxsimilarity index 100%rename from src/routes/(main)/settings/oauth-apps/features/AppDetail/EditForm.tsxrename to src/features/Settings/oauth-apps/features/AppDetail/EditForm.tsxdiff --git a/src/routes/(main)/settings/oauth-apps/features/AppDetail/index.tsx b/src/features/Settings/oauth-apps/features/AppDetail/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/oauth-apps/features/AppDetail/index.tsxrename to src/features/Settings/oauth-apps/features/AppDetail/index.tsxdiff --git a/src/routes/(main)/settings/oauth-apps/features/AppItem/index.tsx b/src/features/Settings/oauth-apps/features/AppItem/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/oauth-apps/features/AppItem/index.tsxrename to src/features/Settings/oauth-apps/features/AppItem/index.tsxdiff --git a/src/routes/(main)/settings/oauth-apps/features/ClientIdDisplay/index.tsx b/src/features/Settings/oauth-apps/features/ClientIdDisplay/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/oauth-apps/features/ClientIdDisplay/index.tsxrename to src/features/Settings/oauth-apps/features/ClientIdDisplay/index.tsxdiff --git a/src/routes/(main)/settings/oauth-apps/features/CreateAppModal/Content.tsx b/src/features/Settings/oauth-apps/features/CreateAppModal/Content.tsxsimilarity index 100%rename from src/routes/(main)/settings/oauth-apps/features/CreateAppModal/Content.tsxrename to src/features/Settings/oauth-apps/features/CreateAppModal/Content.tsxdiff --git a/src/routes/(main)/settings/oauth-apps/features/CreateAppModal/index.tsx b/src/features/Settings/oauth-apps/features/CreateAppModal/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/oauth-apps/features/CreateAppModal/index.tsxrename to src/features/Settings/oauth-apps/features/CreateAppModal/index.tsxdiff --git a/src/routes/(main)/settings/oauth-apps/features/OAuthApps.tsx b/src/features/Settings/oauth-apps/features/OAuthApps.tsxsimilarity index 100%rename from src/routes/(main)/settings/oauth-apps/features/OAuthApps.tsxrename to src/features/Settings/oauth-apps/features/OAuthApps.tsxdiff --git a/src/routes/(main)/settings/oauth-apps/features/index.ts b/src/features/Settings/oauth-apps/features/index.tssimilarity index 100%rename from src/routes/(main)/settings/oauth-apps/features/index.tsrename to src/features/Settings/oauth-apps/features/index.tsdiff --git a/src/routes/(main)/settings/oauth-apps/index.test.tsx b/src/features/Settings/oauth-apps/index.test.tsxsimilarity index 97%rename from src/routes/(main)/settings/oauth-apps/index.test.tsxrename to src/features/Settings/oauth-apps/index.test.tsxindex 200163f8560..245b7e50eaa 100644--- a/src/routes/(main)/settings/oauth-apps/index.test.tsx+++ b/src/features/Settings/oauth-apps/index.test.tsx@@ -49,7 +49,7 @@ vi.mock('@/libs/trpc/client', () => ({lambdaClient: { oauthApp: { create: { mutate: vi.fn() } } },}));-vi.mock('@/routes/(main)/settings/features/SettingHeader', () => ({+vi.mock('@/features/Settings/features/SettingHeader', () => ({default: ({ title }: { title: string }) => <h1>{title}</h1>,}));diff --git a/src/routes/(main)/settings/oauth-apps/index.tsx b/src/features/Settings/oauth-apps/index.tsxsimilarity index 97%rename from src/routes/(main)/settings/oauth-apps/index.tsxrename to src/features/Settings/oauth-apps/index.tsxindex 7d9556488ac..45be1ac4f1b 100644--- a/src/routes/(main)/settings/oauth-apps/index.tsx+++ b/src/features/Settings/oauth-apps/index.tsx@@ -5,10 +5,10 @@ import { useParams } from 'react-router';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import NotFound from '@/components/404';+import SettingHeader from '@/features/Settings/features/SettingHeader';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { usePermission } from '@/hooks/usePermission';import { lambdaClient } from '@/libs/trpc/client';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';import { useUserStore } from '@/store/user';import { labPreferSelectors, preferenceSelectors } from '@/store/user/selectors';diff --git a/src/routes/(main)/settings/profile/features/AvatarRow.tsx b/src/features/Settings/profile/features/AvatarRow.tsxsimilarity index 100%rename from src/routes/(main)/settings/profile/features/AvatarRow.tsxrename to src/features/Settings/profile/features/AvatarRow.tsxdiff --git a/src/routes/(main)/settings/profile/features/ComposioAuthorizationList/index.tsx b/src/features/Settings/profile/features/ComposioAuthorizationList/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/profile/features/ComposioAuthorizationList/index.tsxrename to src/features/Settings/profile/features/ComposioAuthorizationList/index.tsxdiff --git a/src/routes/(main)/settings/profile/features/EmailRow.tsx b/src/features/Settings/profile/features/EmailRow.tsxsimilarity index 100%rename from src/routes/(main)/settings/profile/features/EmailRow.tsxrename to src/features/Settings/profile/features/EmailRow.tsxdiff --git a/src/routes/(main)/settings/profile/features/FullNameRow.tsx b/src/features/Settings/profile/features/FullNameRow.tsxsimilarity index 100%rename from src/routes/(main)/settings/profile/features/FullNameRow.tsxrename to src/features/Settings/profile/features/FullNameRow.tsxdiff --git a/src/routes/(main)/settings/profile/features/InterestsRow.test.tsx b/src/features/Settings/profile/features/InterestsRow.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/profile/features/InterestsRow.test.tsxrename to src/features/Settings/profile/features/InterestsRow.test.tsxdiff --git a/src/routes/(main)/settings/profile/features/InterestsRow.tsx b/src/features/Settings/profile/features/InterestsRow.tsxsimilarity index 98%rename from src/routes/(main)/settings/profile/features/InterestsRow.tsxrename to src/features/Settings/profile/features/InterestsRow.tsxindex 945732f7f69..aa6be07be3d 100644--- a/src/routes/(main)/settings/profile/features/InterestsRow.tsx+++ b/src/features/Settings/profile/features/InterestsRow.tsx@@ -8,7 +8,7 @@ import { BriefcaseIcon } from 'lucide-react';import { useCallback, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';-import { INTEREST_AREAS } from '@/routes/onboarding/config';+import { INTEREST_AREAS } from '@/features/Onboarding/config';import { useUserStore } from '@/store/user';import { userProfileSelectors } from '@/store/user/selectors';import { saveToast } from '@/store/utils/saveToast';diff --git a/src/routes/(main)/settings/profile/features/PasswordRow.tsx b/src/features/Settings/profile/features/PasswordRow.tsxsimilarity index 100%rename from src/routes/(main)/settings/profile/features/PasswordRow.tsxrename to src/features/Settings/profile/features/PasswordRow.tsxdiff --git a/src/routes/(main)/settings/profile/features/ProfileRow.tsx b/src/features/Settings/profile/features/ProfileRow.tsxsimilarity index 100%rename from src/routes/(main)/settings/profile/features/ProfileRow.tsxrename to src/features/Settings/profile/features/ProfileRow.tsxdiff --git a/src/routes/(main)/settings/profile/features/SSOProvidersList/index.tsx b/src/features/Settings/profile/features/SSOProvidersList/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/profile/features/SSOProvidersList/index.tsxrename to src/features/Settings/profile/features/SSOProvidersList/index.tsxdiff --git a/src/routes/(main)/settings/profile/features/UsernameRow.tsx b/src/features/Settings/profile/features/UsernameRow.tsxsimilarity index 100%rename from src/routes/(main)/settings/profile/features/UsernameRow.tsxrename to src/features/Settings/profile/features/UsernameRow.tsxdiff --git a/src/routes/(main)/settings/profile/features/usePasswordReset.test.ts b/src/features/Settings/profile/features/usePasswordReset.test.tssimilarity index 100%rename from src/routes/(main)/settings/profile/features/usePasswordReset.test.tsrename to src/features/Settings/profile/features/usePasswordReset.test.tsdiff --git a/src/routes/(main)/settings/profile/features/usePasswordReset.ts b/src/features/Settings/profile/features/usePasswordReset.tssimilarity index 100%rename from src/routes/(main)/settings/profile/features/usePasswordReset.tsrename to src/features/Settings/profile/features/usePasswordReset.tsdiff --git a/src/routes/(main)/settings/profile/index.tsx b/src/features/Settings/profile/index.tsxsimilarity index 98%rename from src/routes/(main)/settings/profile/index.tsxrename to src/features/Settings/profile/index.tsxindex 70ebc73e222..9b1ed1362d6 100644--- a/src/routes/(main)/settings/profile/index.tsx+++ b/src/features/Settings/profile/index.tsx@@ -6,7 +6,7 @@ import { Divider } from 'antd';import { useEffect } from 'react';import { useTranslation } from 'react-i18next';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import { useServerConfigStore } from '@/store/serverConfig';import { serverConfigSelectors } from '@/store/serverConfig/selectors';import { useToolStore } from '@/store/tool';diff --git a/src/routes/(main)/settings/provider/(list)/ProviderGrid/Card.tsx b/src/features/Settings/provider/(list)/ProviderGrid/Card.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/(list)/ProviderGrid/Card.tsxrename to src/features/Settings/provider/(list)/ProviderGrid/Card.tsxdiff --git a/src/routes/(main)/settings/provider/(list)/ProviderGrid/EnableSwitch.tsx b/src/features/Settings/provider/(list)/ProviderGrid/EnableSwitch.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/(list)/ProviderGrid/EnableSwitch.tsxrename to src/features/Settings/provider/(list)/ProviderGrid/EnableSwitch.tsxdiff --git a/src/routes/(main)/settings/provider/(list)/ProviderGrid/index.tsx b/src/features/Settings/provider/(list)/ProviderGrid/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/(list)/ProviderGrid/index.tsxrename to src/features/Settings/provider/(list)/ProviderGrid/index.tsxdiff --git a/src/routes/(main)/settings/provider/(list)/ProviderGrid/style.ts b/src/features/Settings/provider/(list)/ProviderGrid/style.tssimilarity index 100%rename from src/routes/(main)/settings/provider/(list)/ProviderGrid/style.tsrename to src/features/Settings/provider/(list)/ProviderGrid/style.tsdiff --git a/src/routes/(main)/settings/provider/(list)/index.tsx b/src/features/Settings/provider/(list)/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/(list)/index.tsxrename to src/features/Settings/provider/(list)/index.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/Actions.tsx b/src/features/Settings/provider/ProviderMenu/Actions.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/Actions.tsxrename to src/features/Settings/provider/ProviderMenu/Actions.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/AddNew.tsx b/src/features/Settings/provider/ProviderMenu/AddNew.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/AddNew.tsxrename to src/features/Settings/provider/ProviderMenu/AddNew.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/All.tsx b/src/features/Settings/provider/ProviderMenu/All.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/All.tsxrename to src/features/Settings/provider/ProviderMenu/All.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/Item.tsx b/src/features/Settings/provider/ProviderMenu/Item.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/Item.tsxrename to src/features/Settings/provider/ProviderMenu/Item.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/List.tsx b/src/features/Settings/provider/ProviderMenu/List.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/List.tsxrename to src/features/Settings/provider/ProviderMenu/List.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/SearchResult.tsx b/src/features/Settings/provider/ProviderMenu/SearchResult.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/SearchResult.tsxrename to src/features/Settings/provider/ProviderMenu/SearchResult.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/SortProviderModal/GroupItem.tsx b/src/features/Settings/provider/ProviderMenu/SortProviderModal/GroupItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/SortProviderModal/GroupItem.tsxrename to src/features/Settings/provider/ProviderMenu/SortProviderModal/GroupItem.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/SortProviderModal/index.tsx b/src/features/Settings/provider/ProviderMenu/SortProviderModal/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/SortProviderModal/index.tsxrename to src/features/Settings/provider/ProviderMenu/SortProviderModal/index.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/index.tsx b/src/features/Settings/provider/ProviderMenu/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/index.tsxrename to src/features/Settings/provider/ProviderMenu/index.tsxdiff --git a/src/routes/(main)/settings/provider/ProviderMenu/useDropdownMenu.tsx b/src/features/Settings/provider/ProviderMenu/useDropdownMenu.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/ProviderMenu/useDropdownMenu.tsxrename to src/features/Settings/provider/ProviderMenu/useDropdownMenu.tsxdiff --git a/src/routes/(main)/settings/provider/_layout/Desktop/Container.tsx b/src/features/Settings/provider/_layout/Desktop/Container.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/_layout/Desktop/Container.tsxrename to src/features/Settings/provider/_layout/Desktop/Container.tsxdiff --git a/src/routes/(main)/settings/provider/_layout/Desktop/index.tsx b/src/features/Settings/provider/_layout/Desktop/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/_layout/Desktop/index.tsxrename to src/features/Settings/provider/_layout/Desktop/index.tsxdiff --git a/src/routes/(main)/settings/provider/_layout/Desktop/style.ts b/src/features/Settings/provider/_layout/Desktop/style.tssimilarity index 100%rename from src/routes/(main)/settings/provider/_layout/Desktop/style.tsrename to src/features/Settings/provider/_layout/Desktop/style.tsdiff --git a/src/routes/(main)/settings/provider/_layout/Mobile.tsx b/src/features/Settings/provider/_layout/Mobile.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/_layout/Mobile.tsxrename to src/features/Settings/provider/_layout/Mobile.tsxdiff --git a/src/routes/(main)/settings/provider/const.ts b/src/features/Settings/provider/const.tssimilarity index 100%rename from src/routes/(main)/settings/provider/const.tsrename to src/features/Settings/provider/const.tsdiff --git a/src/routes/(main)/settings/provider/detail/azure/index.tsx b/src/features/Settings/provider/detail/azure/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/azure/index.tsxrename to src/features/Settings/provider/detail/azure/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/azureai/index.tsx b/src/features/Settings/provider/detail/azureai/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/azureai/index.tsxrename to src/features/Settings/provider/detail/azureai/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/bedrock/index.tsx b/src/features/Settings/provider/detail/bedrock/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/bedrock/index.tsxrename to src/features/Settings/provider/detail/bedrock/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/cloudflare/index.tsx b/src/features/Settings/provider/detail/cloudflare/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/cloudflare/index.tsxrename to src/features/Settings/provider/detail/cloudflare/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/comfyui/index.tsx b/src/features/Settings/provider/detail/comfyui/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/comfyui/index.tsxrename to src/features/Settings/provider/detail/comfyui/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/default/CustomProviderDetail.tsx b/src/features/Settings/provider/detail/default/CustomProviderDetail.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/default/CustomProviderDetail.tsxrename to src/features/Settings/provider/detail/default/CustomProviderDetail.tsxdiff --git a/src/routes/(main)/settings/provider/detail/default/ProviderDetialPage.tsx b/src/features/Settings/provider/detail/default/ProviderDetialPage.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/default/ProviderDetialPage.tsxrename to src/features/Settings/provider/detail/default/ProviderDetialPage.tsxdiff --git a/src/routes/(main)/settings/provider/detail/default/index.tsx b/src/features/Settings/provider/detail/default/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/default/index.tsxrename to src/features/Settings/provider/detail/default/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/github/index.tsx b/src/features/Settings/provider/detail/github/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/github/index.tsxrename to src/features/Settings/provider/detail/github/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/index.tsx b/src/features/Settings/provider/detail/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/index.tsxrename to src/features/Settings/provider/detail/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/newapi/index.tsx b/src/features/Settings/provider/detail/newapi/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/newapi/index.tsxrename to src/features/Settings/provider/detail/newapi/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/ollama/CheckError.tsx b/src/features/Settings/provider/detail/ollama/CheckError.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/ollama/CheckError.tsxrename to src/features/Settings/provider/detail/ollama/CheckError.tsxdiff --git a/src/routes/(main)/settings/provider/detail/ollama/Container.tsx b/src/features/Settings/provider/detail/ollama/Container.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/ollama/Container.tsxrename to src/features/Settings/provider/detail/ollama/Container.tsxdiff --git a/src/routes/(main)/settings/provider/detail/ollama/index.tsx b/src/features/Settings/provider/detail/ollama/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/ollama/index.tsxrename to src/features/Settings/provider/detail/ollama/index.tsxdiff --git a/src/routes/(main)/settings/provider/detail/openai/index.tsx b/src/features/Settings/provider/detail/openai/index.tsxsimilarity index 86%rename from src/routes/(main)/settings/provider/detail/openai/index.tsxrename to src/features/Settings/provider/detail/openai/index.tsxindex d118333f696..f6c6cb0b74a 100644--- a/src/routes/(main)/settings/provider/detail/openai/index.tsx+++ b/src/features/Settings/provider/detail/openai/index.tsx@@ -1,6 +1,7 @@import { OpenAIProviderCard } from 'model-bank/modelProviders';-import { useSettingsContext } from '../../../_layout/ContextProvider';+import { useSettingsContext } from '@/features/Settings/Layout/ContextProvider';+import ProviderDetail from '../default';const Page = () => {diff --git a/src/routes/(main)/settings/provider/detail/vertexai/index.tsx b/src/features/Settings/provider/detail/vertexai/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/detail/vertexai/index.tsxrename to src/features/Settings/provider/detail/vertexai/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/CreateNewProvider/Content.tsx b/src/features/Settings/provider/features/CreateNewProvider/Content.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/CreateNewProvider/Content.tsxrename to src/features/Settings/provider/features/CreateNewProvider/Content.tsxdiff --git a/src/routes/(main)/settings/provider/features/CreateNewProvider/index.tsx b/src/features/Settings/provider/features/CreateNewProvider/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/CreateNewProvider/index.tsxrename to src/features/Settings/provider/features/CreateNewProvider/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Content.tsx b/src/features/Settings/provider/features/ModelList/CreateNewModelModal/Content.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Content.tsxrename to src/features/Settings/provider/features/ModelList/CreateNewModelModal/Content.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx b/src/features/Settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsxrename to src/features/Settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Footer.tsx b/src/features/Settings/provider/features/ModelList/CreateNewModelModal/Footer.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Footer.tsxrename to src/features/Settings/provider/features/ModelList/CreateNewModelModal/Footer.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx b/src/features/Settings/provider/features/ModelList/CreateNewModelModal/Form.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsxrename to src/features/Settings/provider/features/ModelList/CreateNewModelModal/Form.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/__tests__/ExtendParamsSelect.test.tsx b/src/features/Settings/provider/features/ModelList/CreateNewModelModal/__tests__/ExtendParamsSelect.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/__tests__/ExtendParamsSelect.test.tsxrename to src/features/Settings/provider/features/ModelList/CreateNewModelModal/__tests__/ExtendParamsSelect.test.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/__tests__/utils.test.ts b/src/features/Settings/provider/features/ModelList/CreateNewModelModal/__tests__/utils.test.tssimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/__tests__/utils.test.tsrename to src/features/Settings/provider/features/ModelList/CreateNewModelModal/__tests__/utils.test.tsdiff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/index.tsx b/src/features/Settings/provider/features/ModelList/CreateNewModelModal/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/index.tsxrename to src/features/Settings/provider/features/ModelList/CreateNewModelModal/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/utils.ts b/src/features/Settings/provider/features/ModelList/CreateNewModelModal/utils.tssimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/utils.tsrename to src/features/Settings/provider/features/ModelList/CreateNewModelModal/utils.tsdiff --git a/src/routes/(main)/settings/provider/features/ModelList/DisabledModels.tsx b/src/features/Settings/provider/features/ModelList/DisabledModels.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/DisabledModels.tsxrename to src/features/Settings/provider/features/ModelList/DisabledModels.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/EmptyModels.tsx b/src/features/Settings/provider/features/ModelList/EmptyModels.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/EmptyModels.tsxrename to src/features/Settings/provider/features/ModelList/EmptyModels.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/EnabledModelList/index.tsx b/src/features/Settings/provider/features/ModelList/EnabledModelList/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/EnabledModelList/index.tsxrename to src/features/Settings/provider/features/ModelList/EnabledModelList/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/Content.tsx b/src/features/Settings/provider/features/ModelList/ModelConfigModal/Content.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/Content.tsxrename to src/features/Settings/provider/features/ModelList/ModelConfigModal/Content.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/Footer.tsx b/src/features/Settings/provider/features/ModelList/ModelConfigModal/Footer.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/Footer.tsxrename to src/features/Settings/provider/features/ModelList/ModelConfigModal/Footer.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/index.tsx b/src/features/Settings/provider/features/ModelList/ModelConfigModal/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/index.tsxrename to src/features/Settings/provider/features/ModelList/ModelConfigModal/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelItem.tsx b/src/features/Settings/provider/features/ModelList/ModelItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/ModelItem.tsxrename to src/features/Settings/provider/features/ModelList/ModelItem.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelTitle/Search.test.tsx b/src/features/Settings/provider/features/ModelList/ModelTitle/Search.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/ModelTitle/Search.test.tsxrename to src/features/Settings/provider/features/ModelList/ModelTitle/Search.test.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelTitle/Search.tsx b/src/features/Settings/provider/features/ModelList/ModelTitle/Search.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/ModelTitle/Search.tsxrename to src/features/Settings/provider/features/ModelList/ModelTitle/Search.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelTitle/index.tsx b/src/features/Settings/provider/features/ModelList/ModelTitle/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/ModelTitle/index.tsxrename to src/features/Settings/provider/features/ModelList/ModelTitle/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/ProviderSettingsContext.ts b/src/features/Settings/provider/features/ModelList/ProviderSettingsContext.tssimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/ProviderSettingsContext.tsrename to src/features/Settings/provider/features/ModelList/ProviderSettingsContext.tsdiff --git a/src/routes/(main)/settings/provider/features/ModelList/SearchResult.test.tsx b/src/features/Settings/provider/features/ModelList/SearchResult.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/SearchResult.test.tsxrename to src/features/Settings/provider/features/ModelList/SearchResult.test.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/SearchResult.tsx b/src/features/Settings/provider/features/ModelList/SearchResult.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/SearchResult.tsxrename to src/features/Settings/provider/features/ModelList/SearchResult.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/SkeletonList.tsx b/src/features/Settings/provider/features/ModelList/SkeletonList.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/SkeletonList.tsxrename to src/features/Settings/provider/features/ModelList/SkeletonList.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsx b/src/features/Settings/provider/features/ModelList/SortModelModal/ListItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsxrename to src/features/Settings/provider/features/ModelList/SortModelModal/ListItem.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/SortModelModal/index.tsx b/src/features/Settings/provider/features/ModelList/SortModelModal/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/SortModelModal/index.tsxrename to src/features/Settings/provider/features/ModelList/SortModelModal/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/ModelList/index.tsx b/src/features/Settings/provider/features/ModelList/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ModelList/index.tsxrename to src/features/Settings/provider/features/ModelList/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx b/src/features/Settings/provider/features/ProviderConfig/Checker.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsxrename to src/features/Settings/provider/features/ProviderConfig/Checker.tsxdiff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/EnableSwitch.tsx b/src/features/Settings/provider/features/ProviderConfig/EnableSwitch.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ProviderConfig/EnableSwitch.tsxrename to src/features/Settings/provider/features/ProviderConfig/EnableSwitch.tsxdiff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsx b/src/features/Settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsxrename to src/features/Settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/useOAuthDeviceFlow.ts b/src/features/Settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/useOAuthDeviceFlow.tssimilarity index 100%rename from src/routes/(main)/settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/useOAuthDeviceFlow.tsrename to src/features/Settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/useOAuthDeviceFlow.tsdiff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx b/src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsxrename to src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsxdiff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsx b/src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsxrename to src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/normalizeProviderSettings.test.ts b/src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/normalizeProviderSettings.test.tssimilarity index 100%rename from src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/normalizeProviderSettings.test.tsrename to src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/normalizeProviderSettings.test.tsdiff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/index.tsx b/src/features/Settings/provider/features/ProviderConfig/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/provider/features/ProviderConfig/index.tsxrename to src/features/Settings/provider/features/ProviderConfig/index.tsxdiff --git a/src/routes/(main)/settings/provider/features/customProviderSdkOptions.ts b/src/features/Settings/provider/features/customProviderSdkOptions.tssimilarity index 100%rename from src/routes/(main)/settings/provider/features/customProviderSdkOptions.tsrename to src/features/Settings/provider/features/customProviderSdkOptions.tsdiff --git a/src/routes/(main)/settings/provider/features/providerSettings.ts b/src/features/Settings/provider/features/providerSettings.tssimilarity index 100%rename from src/routes/(main)/settings/provider/features/providerSettings.tsrename to src/features/Settings/provider/features/providerSettings.tsdiff --git a/src/features/Settings/provider/index.tsx b/src/features/Settings/provider/index.tsxnew file mode 100644index 00000000000..005f37ec936--- /dev/null+++ b/src/features/Settings/provider/index.tsx@@ -0,0 +1,72 @@+'use client';++import { Flexbox } from '@lobehub/ui';+import { memo } from 'react';+import { Outlet, useParams } from 'react-router';++import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';++import DesktopLayoutContainer from './_layout/Desktop/Container';+import ProviderDetailPageComponent from './detail';+import ProviderMenu from './ProviderMenu';++// Layout component that wraps provider pages with navigation+export const ProviderLayout = memo(() => {+ const navigate = useWorkspaceAwareNavigate();++ const handleProviderSelect = (providerKey: string) => {+ navigate(`/settings/provider/${providerKey}`);+ };++ return (+ <Flexbox+ horizontal+ width={'100%'}+ style={{+ maxHeight: '100%',+ }}+ >+ <ProviderMenu mobile={false} onProviderSelect={handleProviderSelect} />+ <DesktopLayoutContainer>+ <Outlet />+ </DesktopLayoutContainer>+ </Flexbox>+ );+});++ProviderLayout.displayName = 'ProviderLayout';++// Detail page component that receives providerId from route params+export const ProviderDetailPage = memo(() => {+ const params = useParams<{ providerId: string }>();+ const navigate = useWorkspaceAwareNavigate();++ const handleProviderSelect = (providerKey: string) => {+ navigate(`/settings/provider/${providerKey}`);+ };++ return (+ <ProviderDetailPageComponent+ id={params.providerId ?? ''}+ onProviderSelect={handleProviderSelect}+ />+ );+});++ProviderDetailPage.displayName = 'ProviderDetailPage';++// Default export for backward compatibility (used by SettingsContent)+type ProviderPageType = {+ mobile?: boolean;+};++const ProviderPage = (props: ProviderPageType) => {+ const { mobile } = props;++ // For mobile or when used via SettingsContent, use the old Page component+ // This is a fallback for non-router usage+ const OldPage = require('./(list)').default;+ return <OldPage mobile={mobile} />;+};++export default ProviderPage;diff --git a/src/routes/(main)/settings/provider/type.ts b/src/features/Settings/provider/type.tssimilarity index 100%rename from src/routes/(main)/settings/provider/type.tsrename to src/features/Settings/provider/type.tsdiff --git a/src/routes/(main)/settings/proxy/features/ProxyForm.test.tsx b/src/features/Settings/proxy/features/ProxyForm.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/proxy/features/ProxyForm.test.tsxrename to src/features/Settings/proxy/features/ProxyForm.test.tsxdiff --git a/src/routes/(main)/settings/proxy/features/ProxyForm.tsx b/src/features/Settings/proxy/features/ProxyForm.tsxsimilarity index 100%rename from src/routes/(main)/settings/proxy/features/ProxyForm.tsxrename to src/features/Settings/proxy/features/ProxyForm.tsxdiff --git a/src/routes/(main)/settings/proxy/features/SaveBar.tsx b/src/features/Settings/proxy/features/SaveBar.tsxsimilarity index 100%rename from src/routes/(main)/settings/proxy/features/SaveBar.tsxrename to src/features/Settings/proxy/features/SaveBar.tsxdiff --git a/src/routes/(main)/settings/proxy/features/useProxyDirty.ts b/src/features/Settings/proxy/features/useProxyDirty.tssimilarity index 100%rename from src/routes/(main)/settings/proxy/features/useProxyDirty.tsrename to src/features/Settings/proxy/features/useProxyDirty.tsdiff --git a/src/routes/(main)/settings/proxy/index.tsx b/src/features/Settings/proxy/index.tsxsimilarity index 78%rename from src/routes/(main)/settings/proxy/index.tsxrename to src/features/Settings/proxy/index.tsxindex e7cda457e3d..dfc30000d84 100644--- a/src/routes/(main)/settings/proxy/index.tsx+++ b/src/features/Settings/proxy/index.tsx@@ -1,6 +1,6 @@import { useTranslation } from 'react-i18next';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import ProxyForm from './features/ProxyForm';diff --git a/src/routes/(main)/settings/security/index.tsx b/src/features/Settings/security/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/security/index.tsxrename to src/features/Settings/security/index.tsxdiff --git a/src/routes/(main)/settings/service-model/index.tsx b/src/features/Settings/service-model/index.tsxsimilarity index 90%rename from src/routes/(main)/settings/service-model/index.tsxrename to src/features/Settings/service-model/index.tsxindex f9d3add1d31..c7626d7bb11 100644--- a/src/routes/(main)/settings/service-model/index.tsx+++ b/src/features/Settings/service-model/index.tsx@@ -3,7 +3,7 @@import { useTranslation } from 'react-i18next';import { ModelAssignmentsForm } from '@/features/ServiceModel';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';import Image from '../image/features/Image';diff --git a/src/routes/(main)/settings/skill/features/Actions.tsx b/src/features/Settings/skill/features/Actions.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/Actions.tsxrename to src/features/Settings/skill/features/Actions.tsxdiff --git a/src/routes/(main)/settings/skill/features/AgentConnectorItem.tsx b/src/features/Settings/skill/features/AgentConnectorItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/AgentConnectorItem.tsxrename to src/features/Settings/skill/features/AgentConnectorItem.tsxdiff --git a/src/routes/(main)/settings/skill/features/AgentConnectorUsage.tsx b/src/features/Settings/skill/features/AgentConnectorUsage.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/AgentConnectorUsage.tsxrename to src/features/Settings/skill/features/AgentConnectorUsage.tsxdiff --git a/src/routes/(main)/settings/skill/features/AgentSkillItem.tsx b/src/features/Settings/skill/features/AgentSkillItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/AgentSkillItem.tsxrename to src/features/Settings/skill/features/AgentSkillItem.tsxdiff --git a/src/routes/(main)/settings/skill/features/BuiltinSkillItem.tsx b/src/features/Settings/skill/features/BuiltinSkillItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/BuiltinSkillItem.tsxrename to src/features/Settings/skill/features/BuiltinSkillItem.tsxdiff --git a/src/routes/(main)/settings/skill/features/ComposioSkillItem.tsx b/src/features/Settings/skill/features/ComposioSkillItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/ComposioSkillItem.tsxrename to src/features/Settings/skill/features/ComposioSkillItem.tsxdiff --git a/src/routes/(main)/settings/skill/features/EditCustomPlugin.tsx b/src/features/Settings/skill/features/EditCustomPlugin.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/EditCustomPlugin.tsxrename to src/features/Settings/skill/features/EditCustomPlugin.tsxdiff --git a/src/routes/(main)/settings/skill/features/LeftPanel.tsx b/src/features/Settings/skill/features/LeftPanel.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/LeftPanel.tsxrename to src/features/Settings/skill/features/LeftPanel.tsxdiff --git a/src/routes/(main)/settings/skill/features/LobehubSkillItem.tsx b/src/features/Settings/skill/features/LobehubSkillItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/LobehubSkillItem.tsxrename to src/features/Settings/skill/features/LobehubSkillItem.tsxdiff --git a/src/routes/(main)/settings/skill/features/McpSkillItem.tsx b/src/features/Settings/skill/features/McpSkillItem.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/McpSkillItem.tsxrename to src/features/Settings/skill/features/McpSkillItem.tsxdiff --git a/src/routes/(main)/settings/skill/features/SkillDetail/index.test.tsx b/src/features/Settings/skill/features/SkillDetail/index.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/SkillDetail/index.test.tsxrename to src/features/Settings/skill/features/SkillDetail/index.test.tsxdiff --git a/src/routes/(main)/settings/skill/features/SkillDetail/index.tsx b/src/features/Settings/skill/features/SkillDetail/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/SkillDetail/index.tsxrename to src/features/Settings/skill/features/SkillDetail/index.tsxdiff --git a/src/routes/(main)/settings/skill/features/SkillDetail/localization.test.ts b/src/features/Settings/skill/features/SkillDetail/localization.test.tssimilarity index 100%rename from src/routes/(main)/settings/skill/features/SkillDetail/localization.test.tsrename to src/features/Settings/skill/features/SkillDetail/localization.test.tsdiff --git a/src/routes/(main)/settings/skill/features/SkillDetail/localization.ts b/src/features/Settings/skill/features/SkillDetail/localization.tssimilarity index 100%rename from src/routes/(main)/settings/skill/features/SkillDetail/localization.tsrename to src/features/Settings/skill/features/SkillDetail/localization.tsdiff --git a/src/routes/(main)/settings/skill/features/SkillList.tsx b/src/features/Settings/skill/features/SkillList.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/features/SkillList.tsxrename to src/features/Settings/skill/features/SkillList.tsxdiff --git a/src/routes/(main)/settings/skill/features/style.ts b/src/features/Settings/skill/features/style.tssimilarity index 100%rename from src/routes/(main)/settings/skill/features/style.tsrename to src/features/Settings/skill/features/style.tsdiff --git a/src/routes/(main)/settings/skill/index.tsx b/src/features/Settings/skill/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/skill/index.tsxrename to src/features/Settings/skill/index.tsxdiff --git a/src/routes/(main)/settings/stats/features/components/StatsFormGroup.tsx b/src/features/Settings/stats/features/components/StatsFormGroup.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/components/StatsFormGroup.tsxrename to src/features/Settings/stats/features/components/StatsFormGroup.tsxdiff --git a/src/routes/(main)/settings/stats/features/components/TimeLabel.tsx b/src/features/Settings/stats/features/components/TimeLabel.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/components/TimeLabel.tsxrename to src/features/Settings/stats/features/components/TimeLabel.tsxdiff --git a/src/routes/(main)/settings/stats/features/components/UsageBarChart.tsx b/src/features/Settings/stats/features/components/UsageBarChart.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/components/UsageBarChart.tsxrename to src/features/Settings/stats/features/components/UsageBarChart.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/ShareButton/Preview.tsx b/src/features/Settings/stats/features/overview/ShareButton/Preview.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/ShareButton/Preview.tsxrename to src/features/Settings/stats/features/overview/ShareButton/Preview.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/ShareButton/ShareModal.tsx b/src/features/Settings/stats/features/overview/ShareButton/ShareModal.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/ShareButton/ShareModal.tsxrename to src/features/Settings/stats/features/overview/ShareButton/ShareModal.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/ShareButton/TotalCard.tsx b/src/features/Settings/stats/features/overview/ShareButton/TotalCard.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/ShareButton/TotalCard.tsxrename to src/features/Settings/stats/features/overview/ShareButton/TotalCard.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/ShareButton/index.tsx b/src/features/Settings/stats/features/overview/ShareButton/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/ShareButton/index.tsxrename to src/features/Settings/stats/features/overview/ShareButton/index.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/TotalAssistants.tsx b/src/features/Settings/stats/features/overview/TotalAssistants.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/TotalAssistants.tsxrename to src/features/Settings/stats/features/overview/TotalAssistants.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/TotalMessages.tsx b/src/features/Settings/stats/features/overview/TotalMessages.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/TotalMessages.tsxrename to src/features/Settings/stats/features/overview/TotalMessages.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/TotalTokens.tsx b/src/features/Settings/stats/features/overview/TotalTokens.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/TotalTokens.tsxrename to src/features/Settings/stats/features/overview/TotalTokens.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/TotalTopics.tsx b/src/features/Settings/stats/features/overview/TotalTopics.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/TotalTopics.tsxrename to src/features/Settings/stats/features/overview/TotalTopics.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/Welcome.tsx b/src/features/Settings/stats/features/overview/Welcome.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/Welcome.tsxrename to src/features/Settings/stats/features/overview/Welcome.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/WorkspaceWelcome.tsx b/src/features/Settings/stats/features/overview/WorkspaceWelcome.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/WorkspaceWelcome.tsxrename to src/features/Settings/stats/features/overview/WorkspaceWelcome.tsxdiff --git a/src/routes/(main)/settings/stats/features/overview/index.ts b/src/features/Settings/stats/features/overview/index.tssimilarity index 100%rename from src/routes/(main)/settings/stats/features/overview/index.tsrename to src/features/Settings/stats/features/overview/index.tsdiff --git a/src/routes/(main)/settings/stats/features/rankings/AssistantsRank.tsx b/src/features/Settings/stats/features/rankings/AssistantsRank.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/rankings/AssistantsRank.tsxrename to src/features/Settings/stats/features/rankings/AssistantsRank.tsxdiff --git a/src/routes/(main)/settings/stats/features/rankings/ModelsRank.tsx b/src/features/Settings/stats/features/rankings/ModelsRank.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/rankings/ModelsRank.tsxrename to src/features/Settings/stats/features/rankings/ModelsRank.tsxdiff --git a/src/routes/(main)/settings/stats/features/rankings/TopicsRank.tsx b/src/features/Settings/stats/features/rankings/TopicsRank.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/rankings/TopicsRank.tsxrename to src/features/Settings/stats/features/rankings/TopicsRank.tsxdiff --git a/src/routes/(main)/settings/stats/features/rankings/index.ts b/src/features/Settings/stats/features/rankings/index.tssimilarity index 100%rename from src/routes/(main)/settings/stats/features/rankings/index.tsrename to src/features/Settings/stats/features/rankings/index.tsdiff --git a/src/routes/(main)/settings/stats/features/usage/UsageCards/ActiveModels/ModelTable.tsx b/src/features/Settings/stats/features/usage/UsageCards/ActiveModels/ModelTable.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/usage/UsageCards/ActiveModels/ModelTable.tsxrename to src/features/Settings/stats/features/usage/UsageCards/ActiveModels/ModelTable.tsxdiff --git a/src/routes/(main)/settings/stats/features/usage/UsageCards/ActiveModels/index.test.tsx b/src/features/Settings/stats/features/usage/UsageCards/ActiveModels/index.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/usage/UsageCards/ActiveModels/index.test.tsxrename to src/features/Settings/stats/features/usage/UsageCards/ActiveModels/index.test.tsxdiff --git a/src/routes/(main)/settings/stats/features/usage/UsageCards/ActiveModels/index.tsx b/src/features/Settings/stats/features/usage/UsageCards/ActiveModels/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/usage/UsageCards/ActiveModels/index.tsxrename to src/features/Settings/stats/features/usage/UsageCards/ActiveModels/index.tsxdiff --git a/src/routes/(main)/settings/stats/features/usage/UsageCards/MonthSpend.tsx b/src/features/Settings/stats/features/usage/UsageCards/MonthSpend.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/usage/UsageCards/MonthSpend.tsxrename to src/features/Settings/stats/features/usage/UsageCards/MonthSpend.tsxdiff --git a/src/routes/(main)/settings/stats/features/usage/UsageCards/TodaySpend.tsx b/src/features/Settings/stats/features/usage/UsageCards/TodaySpend.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/usage/UsageCards/TodaySpend.tsxrename to src/features/Settings/stats/features/usage/UsageCards/TodaySpend.tsxdiff --git a/src/routes/(main)/settings/stats/features/usage/UsageCards/index.tsx b/src/features/Settings/stats/features/usage/UsageCards/index.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/usage/UsageCards/index.tsxrename to src/features/Settings/stats/features/usage/UsageCards/index.tsxdiff --git a/src/routes/(main)/settings/stats/features/usage/UsageTable.tsx b/src/features/Settings/stats/features/usage/UsageTable.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/usage/UsageTable.tsxrename to src/features/Settings/stats/features/usage/UsageTable.tsxdiff --git a/src/routes/(main)/settings/stats/features/usage/UsageTrends.tsx b/src/features/Settings/stats/features/usage/UsageTrends.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/usage/UsageTrends.tsxrename to src/features/Settings/stats/features/usage/UsageTrends.tsxdiff --git a/src/routes/(main)/settings/stats/features/usage/index.ts b/src/features/Settings/stats/features/usage/index.tssimilarity index 100%rename from src/routes/(main)/settings/stats/features/usage/index.tsrename to src/features/Settings/stats/features/usage/index.tsdiff --git a/src/routes/(main)/settings/stats/features/visualization/AiHeatmaps.tsx b/src/features/Settings/stats/features/visualization/AiHeatmaps.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/visualization/AiHeatmaps.tsxrename to src/features/Settings/stats/features/visualization/AiHeatmaps.tsxdiff --git a/src/routes/(main)/settings/stats/features/visualization/HeatmapStats.tsx b/src/features/Settings/stats/features/visualization/HeatmapStats.tsxsimilarity index 100%rename from src/routes/(main)/settings/stats/features/visualization/HeatmapStats.tsxrename to src/features/Settings/stats/features/visualization/HeatmapStats.tsxdiff --git a/src/routes/(main)/settings/stats/features/visualization/index.ts b/src/features/Settings/stats/features/visualization/index.tssimilarity index 100%rename from src/routes/(main)/settings/stats/features/visualization/index.tsrename to src/features/Settings/stats/features/visualization/index.tsdiff --git a/src/routes/(main)/settings/stats/index.tsx b/src/features/Settings/stats/index.tsxsimilarity index 98%rename from src/routes/(main)/settings/stats/index.tsxrename to src/features/Settings/stats/index.tsxindex 693553130ed..5e43e980259 100644--- a/src/routes/(main)/settings/stats/index.tsx+++ b/src/features/Settings/stats/index.tsx@@ -11,9 +11,9 @@ import { memo, type ReactNode, useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';import AsyncBoundary from '@/components/AsyncBoundary';+import SettingHeader from '@/features/Settings/features/SettingHeader';import { useClientDataSWR } from '@/libs/swr';import { statsKeys } from '@/libs/swr/keys';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';import { usageService } from '@/services/usage';import {diff --git a/src/routes/(main)/settings/stats/types.ts b/src/features/Settings/stats/types.tssimilarity index 100%rename from src/routes/(main)/settings/stats/types.tsrename to src/features/Settings/stats/types.tsdiff --git a/src/routes/(main)/settings/storage/features/Advanced.test.tsx b/src/features/Settings/storage/features/Advanced.test.tsxsimilarity index 100%rename from src/routes/(main)/settings/storage/features/Advanced.test.tsxrename to src/features/Settings/storage/features/Advanced.test.tsxdiff --git a/src/routes/(main)/settings/storage/features/Advanced.tsx b/src/features/Settings/storage/features/Advanced.tsxsimilarity index 100%rename from src/routes/(main)/settings/storage/features/Advanced.tsxrename to src/features/Settings/storage/features/Advanced.tsxdiff --git a/src/routes/(main)/settings/storage/index.tsx b/src/features/Settings/storage/index.tsxsimilarity index 93%rename from src/routes/(main)/settings/storage/index.tsxrename to src/features/Settings/storage/index.tsxindex 90c5586f448..c2be02582e5 100644--- a/src/routes/(main)/settings/storage/index.tsx+++ b/src/features/Settings/storage/index.tsx@@ -3,7 +3,7 @@import { Flexbox, FormGroup, Skeleton } from '@lobehub/ui';import { useTranslation } from 'react-i18next';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import { useServerConfigStore } from '@/store/serverConfig';import { useUserStore } from '@/store/user';import { authSelectors } from '@/store/user/selectors';diff --git a/src/routes/(main)/settings/system-tools/features/AppEnvironmentSection.tsx b/src/features/Settings/system-tools/features/AppEnvironmentSection.tsxsimilarity index 100%rename from src/routes/(main)/settings/system-tools/features/AppEnvironmentSection.tsxrename to src/features/Settings/system-tools/features/AppEnvironmentSection.tsxdiff --git a/src/routes/(main)/settings/system-tools/features/CliTestSection.tsx b/src/features/Settings/system-tools/features/CliTestSection.tsxsimilarity index 100%rename from src/routes/(main)/settings/system-tools/features/CliTestSection.tsxrename to src/features/Settings/system-tools/features/CliTestSection.tsxdiff --git a/src/routes/(main)/settings/system-tools/features/ShellSection.tsx b/src/features/Settings/system-tools/features/ShellSection.tsxsimilarity index 100%rename from src/routes/(main)/settings/system-tools/features/ShellSection.tsxrename to src/features/Settings/system-tools/features/ShellSection.tsxdiff --git a/src/routes/(main)/settings/system-tools/features/ToolDetectorSection.tsx b/src/features/Settings/system-tools/features/ToolDetectorSection.tsxsimilarity index 100%rename from src/routes/(main)/settings/system-tools/features/ToolDetectorSection.tsxrename to src/features/Settings/system-tools/features/ToolDetectorSection.tsxdiff --git a/src/routes/(main)/settings/system-tools/index.tsx b/src/features/Settings/system-tools/index.tsxsimilarity index 91%rename from src/routes/(main)/settings/system-tools/index.tsxrename to src/features/Settings/system-tools/index.tsxindex 986136d9dc6..4dd1c82de97 100644--- a/src/routes/(main)/settings/system-tools/index.tsx+++ b/src/features/Settings/system-tools/index.tsx@@ -1,6 +1,6 @@import { useTranslation } from 'react-i18next';-import SettingHeader from '@/routes/(main)/settings/features/SettingHeader';+import SettingHeader from '@/features/Settings/features/SettingHeader';import { useUserStore } from '@/store/user';import { userGeneralSettingsSelectors } from '@/store/user/slices/settings/selectors';diff --git a/src/routes/(main)/settings/tts/features/OpenAI.tsx b/src/features/Settings/tts/features/OpenAI.tsxsimilarity index 100%rename from src/routes/(main)/settings/tts/features/OpenAI.tsxrename to src/features/Settings/tts/features/OpenAI.tsxdiff --git a/src/routes/(main)/settings/tts/features/const.tsx b/src/features/Settings/tts/features/const.tsxsimilarity index 100%rename from src/routes/(main)/settings/tts/features/const.tsxrename to src/features/Settings/tts/features/const.tsxdiff --git a/src/features/SettingsSearch/useSettingsSearch.ts b/src/features/SettingsSearch/useSettingsSearch.tsindex 366589c7ad1..82efdf872b9 100644--- a/src/features/SettingsSearch/useSettingsSearch.ts+++ b/src/features/SettingsSearch/useSettingsSearch.ts@@ -4,7 +4,7 @@ import { DEFAULT_MODEL_PROVIDER_LIST } from 'model-bank/modelProviders';import { useEffect, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';-import { useCategory } from '@/routes/(main)/settings/hooks/useCategory';+import { useCategory } from '@/features/Settings/hooks/useCategory';import { SettingsTabs } from '@/store/global/initialState';import {featureFlagsSelectors,diff --git a/src/hooks/useSignOut.ts b/src/hooks/useSignOut.tsindex 6365cd67b25..ec3e7f8fb00 100644--- a/src/hooks/useSignOut.ts+++ b/src/hooks/useSignOut.ts@@ -1,8 +1,8 @@import { useCallback } from 'react';import { isDesktop } from '@/const/version';-import { navigateToDesktopOnboarding } from '@/routes/(desktop)/desktop-onboarding/navigation';-import { DesktopOnboardingScreen } from '@/routes/(desktop)/desktop-onboarding/types';+import { navigateToDesktopOnboarding } from '@/features/DesktopOnboarding/navigation';+import { DesktopOnboardingScreen } from '@/features/DesktopOnboarding/types';import { useUserStore } from '@/store/user';export const useSignOut = () => {diff --git a/src/routes/(desktop)/desktop-onboarding/index.tsx b/src/routes/(desktop)/desktop-onboarding/index.tsxindex de1ffef35f8..34bb049b768 100644--- a/src/routes/(desktop)/desktop-onboarding/index.tsx+++ b/src/routes/(desktop)/desktop-onboarding/index.tsx@@ -1,245 +1 @@-'use client';--import { APP_WINDOW_MIN_SIZE } from '@lobechat/desktop-bridge';-import { Flexbox, Skeleton } from '@lobehub/ui';-import { memo, Suspense, useCallback, useEffect, useState } from 'react';-import { useSearchParams } from 'react-router';--import Loading from '@/components/Loading/BrandTextLoading';-import { remoteServerService } from '@/services/electron/remoteServer';-import { electronSystemService } from '@/services/electron/system';--import OnboardingContainer from './_layout';-import DataModeStep from './features/DataModeStep';-import LoginStep from './features/LoginStep';-import PermissionsStep from './features/PermissionsStep';-import WelcomeStep from './features/WelcomeStep';-import { resolveNextScreen, resolvePreviousScreen } from './flow';-import { resolveInitialScreen } from './resolveInitialScreen';-import {- clearDesktopOnboardingScreen,- getDesktopOnboardingEverCompleted,- getDesktopOnboardingScreen,- setDesktopOnboardingCompleted,- setDesktopOnboardingEverCompleted,- setDesktopOnboardingScreen,-} from './storage';-import { DesktopOnboardingScreen, isDesktopOnboardingScreen } from './types';--const DesktopOnboardingPage = memo(() => {- const [searchParams, setSearchParams] = useSearchParams();- const [isMac, setIsMac] = useState(true);- const [isLoading, setIsLoading] = useState(true);- const [everCompleted] = useState(getDesktopOnboardingEverCompleted);-- const resolveScreenForPlatform = useCallback(- (screen: DesktopOnboardingScreen) =>- resolveInitialScreen({- everCompleted,- isMac,- requested: screen,- saved: null,- }),- [everCompleted, isMac],- );-- const getRequestedScreenFromUrl = useCallback((): DesktopOnboardingScreen | null => {- const screenParam = searchParams.get('screen');- if (isDesktopOnboardingScreen(screenParam)) return screenParam;-- return null;- }, [searchParams]);-- const [currentScreen, setCurrentScreen] = useState<DesktopOnboardingScreen>(- DesktopOnboardingScreen.Welcome,- );-- useEffect(() => {- electronSystemService.setDesktopOnboardingCompleted(false).catch((error) => {- console.error('[DesktopOnboarding] Failed to mark onboarding as in progress:', error);- });- }, []);-- useEffect(() => {- if (isLoading) return;-- const initial = resolveInitialScreen({- everCompleted,- isMac,- requested: getRequestedScreenFromUrl(),- saved: getDesktopOnboardingScreen(),- });-- setCurrentScreen(initial);-- // Canonicalize URL to `?screen=...`- const currentUrlScreen = searchParams.get('screen');- if (currentUrlScreen !== initial) {- setSearchParams({ screen: initial });- }- }, [everCompleted, getRequestedScreenFromUrl, isLoading, isMac, searchParams, setSearchParams]);-- // Persist current screen to localStorage.- useEffect(() => {- if (isLoading) return;- setDesktopOnboardingScreen(currentScreen);- }, [currentScreen, isLoading]);-- // Set window size and resizability- useEffect(() => {- const minimumSize = { height: 900, width: 1200 };-- const applyWindowSettings = async () => {- try {- await electronSystemService.setWindowMinimumSize(minimumSize);- } catch (error) {- console.error('[DesktopOnboarding] Failed to apply window settings:', error);- }- };-- applyWindowSettings();-- return () => {- // Restore to app-level default minimum size preset- electronSystemService.setWindowMinimumSize(APP_WINDOW_MIN_SIZE).catch((error) => {- console.error('[DesktopOnboarding] Failed to restore window settings:', error);- });- };- }, []);-- // Detect platform: skip permissions page on non-macOS- useEffect(() => {- let mounted = true;- const detectPlatform = async () => {- try {- const state = await electronSystemService.getAppState();- if (!mounted) return;- setIsMac(state.platform === 'darwin');- } catch {- // Fallback: keep default (true)- } finally {- setIsLoading(false);- }- };- void detectPlatform();- return () => {- mounted = false;- };- }, []);-- // Listen URL changes: allow deep-linking between screens.- useEffect(() => {- if (isLoading) return;- const requested = getRequestedScreenFromUrl();- if (!requested) return;- const resolved = resolveScreenForPlatform(requested);- if (resolved !== currentScreen) setCurrentScreen(resolved);- }, [currentScreen, getRequestedScreenFromUrl, isLoading, resolveScreenForPlatform]);-- const completeOnboarding = useCallback(async () => {- setDesktopOnboardingCompleted();- setDesktopOnboardingEverCompleted();- clearDesktopOnboardingScreen();-- try {- await Promise.all([- electronSystemService.setDesktopOnboardingCompleted(true),- electronSystemService.setWindowMinimumSize(APP_WINDOW_MIN_SIZE),- ]);- } catch (error) {- console.error('[DesktopOnboarding] Failed to finalize onboarding:', error);- }-- // Use hard reload instead of SPA navigation to ensure the app boots with the new desktop state.- window.location.replace('/');- }, []);-- const goToNextStep = useCallback(async () => {- let isAuthenticated = false;- try {- isAuthenticated = await remoteServerService.isRemoteServerConfigured();- } catch (error) {- console.error('[DesktopOnboarding] Failed to verify authentication:', error);- }-- const next = resolveNextScreen({- current: currentScreen,- everCompleted,- isAuthenticated,- isMac,- });-- if (!next) {- await completeOnboarding();- return;- }-- setSearchParams({ screen: next });- setCurrentScreen(next);- }, [completeOnboarding, currentScreen, everCompleted, isMac, setSearchParams]);-- const goToPreviousStep = useCallback(() => {- setCurrentScreen((prev) => {- const prevScreen = resolvePreviousScreen({ current: prev, isMac });- setSearchParams({ screen: prevScreen });- return prevScreen;- });- }, [isMac, setSearchParams]);-- if (isLoading) {- return <Loading debugId="DesktopOnboarding" />;- }-- const renderStep = () => {- switch (currentScreen) {- case DesktopOnboardingScreen.Welcome: {- return <WelcomeStep onNext={goToNextStep} />;- }- case DesktopOnboardingScreen.Permissions: {- // macOS-only screen; fallback to DataMode if platform doesn't support.- if (!isMac) {- setCurrentScreen(DesktopOnboardingScreen.DataMode);- return null;- }- return <PermissionsStep onBack={goToPreviousStep} onNext={goToNextStep} />;- }- case DesktopOnboardingScreen.DataMode: {- return <DataModeStep onBack={goToPreviousStep} onNext={goToNextStep} />;- }- case DesktopOnboardingScreen.Login: {- return <LoginStep onBack={goToPreviousStep} onNext={goToNextStep} />;- }- default: {- return null;- }- }- };-- return (- <OnboardingContainer>- <Flexbox gap={24} style={{ maxWidth: 560, minHeight: '100%', width: '100%' }}>- <Suspense- fallback={- <Flexbox gap={8}>- <Skeleton.Avatar size={48} />- <Skeleton- paragraph={{- rows: 8,- }}- title={{- fontSize: 24,- }}- />- </Flexbox>- }- >- {renderStep()}- </Suspense>- </Flexbox>- </OnboardingContainer>- );-});--DesktopOnboardingPage.displayName = 'DesktopOnboardingPage';--export default DesktopOnboardingPage;+export { default } from '@/features/DesktopOnboarding';diff --git a/src/routes/(main)/[workspaceSlug]/settings/apikey/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/apikey/index.tsxindex 0fd761d3fa9..a073f2acaf6 100644--- a/src/routes/(main)/[workspaceSlug]/settings/apikey/index.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/apikey/index.tsx@@ -1,8 +1,8 @@'use client';import WorkspaceApiKeyGuard from '@/business/client/BusinessSettingPages/WorkspaceApiKeyGuard';+import Page from '@/features/Settings/apikey';import { WorkspaceAdminOnly } from '@/features/WorkspaceSetting';-import Page from '@/routes/(main)/settings/apikey';const WorkspaceApiKeySetting = () => (<WorkspaceAdminOnly>diff --git a/src/routes/(main)/[workspaceSlug]/settings/connector/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/connector/index.tsxindex 0260288a469..35ac3ce0118 100644--- a/src/routes/(main)/[workspaceSlug]/settings/connector/index.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/connector/index.tsx@@ -1,6 +1,6 @@'use client';-import { ToolSettings } from '@/routes/(main)/settings/skill';+import { ToolSettings } from '@/features/Settings/skill';const WorkspaceConnectorSetting = () => <ToolSettings viewMode="connector" />;diff --git a/src/routes/(main)/[workspaceSlug]/settings/credential/features/PersonalCredsSection/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/credential/features/PersonalCredsSection/index.tsxindex 7954811aa05..135c28a4758 100644--- a/src/routes/(main)/[workspaceSlug]/settings/credential/features/PersonalCredsSection/index.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/credential/features/PersonalCredsSection/index.tsx@@ -8,8 +8,8 @@ import { useTranslation } from 'react-i18next';import AsyncBoundary from '@/components/AsyncBoundary';import ListSkeleton from '@/components/ListSkeleton';+import CredItem from '@/features/Settings/creds/features/CredItem';import { lambdaQuery } from '@/libs/trpc/client';-import CredItem from '@/routes/(main)/settings/creds/features/CredItem';import ShareToggle from './ShareToggle';diff --git a/src/routes/(main)/[workspaceSlug]/settings/credential/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/credential/index.tsxindex 4a54914fecb..962f3a478cd 100644--- a/src/routes/(main)/[workspaceSlug]/settings/credential/index.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/credential/index.tsx@@ -8,15 +8,12 @@ import { Plus, UserRoundIcon, UsersIcon } from 'lucide-react';import { useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';+import { createCreateCredModal } from '@/features/Settings/creds/features/CreateCredModal';+import CredsList from '@/features/Settings/creds/features/CredsList';+import { type CredsApi, CredsApiProvider } from '@/features/Settings/creds/features/useCredsApi';import { usePermission } from '@/hooks/usePermission';import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';import { lambdaClient, lambdaQuery } from '@/libs/trpc/client';-import { createCreateCredModal } from '@/routes/(main)/settings/creds/features/CreateCredModal';-import CredsList from '@/routes/(main)/settings/creds/features/CredsList';-import {- type CredsApi,- CredsApiProvider,-} from '@/routes/(main)/settings/creds/features/useCredsApi';import PersonalCredsSection from './features/PersonalCredsSection';diff --git a/src/routes/(main)/[workspaceSlug]/settings/oauth-apps/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/oauth-apps/index.tsxindex dddd6f2a751..25a50c642dc 100644--- a/src/routes/(main)/[workspaceSlug]/settings/oauth-apps/index.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/oauth-apps/index.tsx@@ -1,5 +1,5 @@'use client';-import Page from '@/routes/(main)/settings/oauth-apps';+import Page from '@/features/Settings/oauth-apps';export default Page;diff --git a/src/routes/(main)/[workspaceSlug]/settings/provider/index.test.tsx b/src/routes/(main)/[workspaceSlug]/settings/provider/index.test.tsxindex be6c82566d5..4d9f6300ca7 100644--- a/src/routes/(main)/[workspaceSlug]/settings/provider/index.test.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/provider/index.test.tsx@@ -17,16 +17,16 @@ vi.mock('@/business/client/hooks/useIsWorkspaceLoading', () => ({vi.mock('@/const/version', () => ({ isCustomBranding: false }));-vi.mock('@/routes/(main)/settings/provider/_layout/Desktop', () => ({+vi.mock('@/features/Settings/provider/_layout/Desktop', () => ({default: ({ children }: PropsWithChildren) => <>{children}</>,}));-vi.mock('@/routes/(main)/settings/provider/_layout/Mobile', () => ({+vi.mock('@/features/Settings/provider/_layout/Mobile', () => ({default: ({ children }: PropsWithChildren) => <>{children}</>,}));-vi.mock('@/routes/(main)/settings/provider/detail', async () => {- const { useSettingsContext } = await import('@/routes/(main)/settings/_layout/ContextProvider');+vi.mock('@/features/Settings/provider/detail', async () => {+ const { useSettingsContext } = await import('@/features/Settings/Layout/ContextProvider');const ProviderDetail = () => {const { showOpenAIApiKey, showOpenAIProxyUrl } = useSettingsContext();diff --git a/src/routes/(main)/[workspaceSlug]/settings/provider/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/provider/index.tsxindex 54c289767e5..dbd125fc1ae 100644--- a/src/routes/(main)/[workspaceSlug]/settings/provider/index.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/provider/index.tsx@@ -1,8 +1,8 @@'use client';+import SettingsContextProvider from '@/features/Settings/Layout/ContextProvider';+import Page from '@/features/Settings/provider/(list)';import WorkspaceAdminOnly from '@/features/WorkspaceSetting/AdminOnly';-import SettingsContextProvider from '@/routes/(main)/settings/_layout/ContextProvider';-import Page from '@/routes/(main)/settings/provider/(list)';const WorkspaceProviderSetting = () => (<WorkspaceAdminOnly>diff --git a/src/routes/(main)/[workspaceSlug]/settings/service-model/index.test.tsx b/src/routes/(main)/[workspaceSlug]/settings/service-model/index.test.tsxindex 77826787e5e..3a7dedd5c77 100644--- a/src/routes/(main)/[workspaceSlug]/settings/service-model/index.test.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/service-model/index.test.tsx@@ -13,7 +13,7 @@ vi.mock('@/business/client/hooks/useIsWorkspaceLoading', () => ({useIsWorkspaceLoading: () => false,}));-vi.mock('@/routes/(main)/settings/service-model', () => ({+vi.mock('@/features/Settings/service-model', () => ({default: () => <div data-testid="service-model-page">service model settings</div>,}));diff --git a/src/routes/(main)/[workspaceSlug]/settings/service-model/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/service-model/index.tsxindex c240698b2df..c881fcb8ab1 100644--- a/src/routes/(main)/[workspaceSlug]/settings/service-model/index.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/service-model/index.tsx@@ -1,7 +1,7 @@'use client';+import Page from '@/features/Settings/service-model';import WorkspaceAdminOnly from '@/features/WorkspaceSetting/AdminOnly';-import Page from '@/routes/(main)/settings/service-model';const WorkspaceServiceModelSetting = () => (<WorkspaceAdminOnly>diff --git a/src/routes/(main)/[workspaceSlug]/settings/skill/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/skill/index.tsxindex c66e41eebaf..ac1c9a3c518 100644--- a/src/routes/(main)/[workspaceSlug]/settings/skill/index.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/skill/index.tsx@@ -1,6 +1,6 @@'use client';-import Page from '@/routes/(main)/settings/skill';+import Page from '@/features/Settings/skill';const WorkspaceSkillSetting = () => <Page />;diff --git a/src/routes/(main)/[workspaceSlug]/settings/statistics/index.test.tsx b/src/routes/(main)/[workspaceSlug]/settings/statistics/index.test.tsxindex 6b39f302b5b..834a2e86218 100644--- a/src/routes/(main)/[workspaceSlug]/settings/statistics/index.test.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/statistics/index.test.tsx@@ -13,7 +13,7 @@ vi.mock('@/business/client/hooks/useFetchWorkspaceMembers', () => ({useFetchWorkspaceMembers: useFetchWorkspaceMembersMock,}));-vi.mock('@/routes/(main)/settings/stats/features/overview/WorkspaceWelcome', () => ({+vi.mock('@/features/Settings/stats/features/overview/WorkspaceWelcome', () => ({default: () => <div>Workspace Welcome</div>,}));@@ -24,7 +24,7 @@ vi.mock('react-i18next', () => ({}),}));-vi.mock('@/routes/(main)/settings/stats', () => ({+vi.mock('@/features/Settings/stats', () => ({default: (props: {resolveUser: (userId: string) => { avatar?: string | null; name: string };showSettingHeader?: boolean;diff --git a/src/routes/(main)/[workspaceSlug]/settings/statistics/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/statistics/index.tsxindex 5c70e728e8f..b9141d54853 100644--- a/src/routes/(main)/[workspaceSlug]/settings/statistics/index.tsx+++ b/src/routes/(main)/[workspaceSlug]/settings/statistics/index.tsx@@ -6,9 +6,9 @@ import { useTranslation } from 'react-i18next';import WorkspaceSpendInsights from '@/business/client/features/WorkspaceSpendInsights';import { useFetchWorkspaceMembers } from '@/business/client/hooks/useFetchWorkspaceMembers';-import Page from '@/routes/(main)/settings/stats';-import WorkspaceWelcome from '@/routes/(main)/settings/stats/features/overview/WorkspaceWelcome';-import { type UserDisplay } from '@/routes/(main)/settings/stats/types';+import Page from '@/features/Settings/stats';+import WorkspaceWelcome from '@/features/Settings/stats/features/overview/WorkspaceWelcome';+import { type UserDisplay } from '@/features/Settings/stats/types';interface WorkspaceStatsMemberProfile {avatar?: string | null;diff --git a/src/routes/(main)/_layout/DesktopAutoOidcOnFirstOpen.tsx b/src/routes/(main)/_layout/DesktopAutoOidcOnFirstOpen.tsxindex 7828624e0de..1a2af92c948 100644--- a/src/routes/(main)/_layout/DesktopAutoOidcOnFirstOpen.tsx+++ b/src/routes/(main)/_layout/DesktopAutoOidcOnFirstOpen.tsx@@ -2,7 +2,7 @@import { memo, useEffect } from 'react';-import { getDesktopOnboardingCompleted } from '@/routes/(desktop)/desktop-onboarding/storage';+import { getDesktopOnboardingCompleted } from '@/features/DesktopOnboarding/storage';import { useElectronStore } from '@/store/electron';import {getDesktopAutoOidcFirstOpenHandled,diff --git a/src/routes/(main)/_layout/index.desktop.tsx b/src/routes/(main)/_layout/index.desktop.tsxindex f4afeb9f458..fa47b50993f 100644--- a/src/routes/(main)/_layout/index.desktop.tsx+++ b/src/routes/(main)/_layout/index.desktop.tsx@@ -29,10 +29,10 @@ import TabCacheBridges from '@/features/Electron/titlebar/TabBar/TabCacheBridgesimport TitleBar from '@/features/Electron/titlebar/TitleBar';import HotkeyHelperPanel from '@/features/HotkeyHelperPanel';import NavPanelShell from '@/features/NavPanel/Shell';+import { DndContextWrapper } from '@/features/ResourceManager/DndContextWrapper';import { usePlatform } from '@/hooks/usePlatform';import CmdkLazy from '@/layout/GlobalProvider/CmdkLazy';import dynamic from '@/libs/next/dynamic';-import { DndContextWrapper } from '@/routes/(main)/resource/features/DndContextWrapper';import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';import DesktopAutoOidcOnFirstOpen from './DesktopAutoOidcOnFirstOpen';diff --git a/src/routes/(main)/_layout/index.tsx b/src/routes/(main)/_layout/index.tsxindex 4eefba8bada..f6c944f1ad1 100644--- a/src/routes/(main)/_layout/index.tsx+++ b/src/routes/(main)/_layout/index.tsx@@ -26,11 +26,11 @@ import TabCacheBridges from '@/features/Electron/titlebar/TabBar/TabCacheBridgesimport TitleBar from '@/features/Electron/titlebar/TitleBar';import HotkeyHelperPanel from '@/features/HotkeyHelperPanel';import NavPanelShell from '@/features/NavPanel/Shell';+import { DndContextWrapper } from '@/features/ResourceManager/DndContextWrapper';import { RouteMetaBridge } from '@/features/RouteMeta';import { usePlatform } from '@/hooks/usePlatform';import CmdkLazy from '@/layout/GlobalProvider/CmdkLazy';import dynamic from '@/libs/next/dynamic';-import { DndContextWrapper } from '@/routes/(main)/resource/features/DndContextWrapper';import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';import DesktopHome from '../home';diff --git a/src/routes/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx b/src/routes/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsxindex 68be0c8e540..03e243a4ddc 100644--- a/src/routes/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx+++ b/src/routes/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx@@ -2,10 +2,10 @@ import { Flexbox, Popover } from '@lobehub/ui';import { type PropsWithChildren } from 'react';import React, { memo, Suspense } from 'react';+import List from '@/features/HomeSidebar/Body/Agent/List';+import { AgentModalProvider } from '@/features/HomeSidebar/Body/Agent/ModalProvider';import SkeletonList from '@/features/NavPanel/components/SkeletonList';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import List from '@/routes/(main)/home/_layout/Body/Agent/List';-import { AgentModalProvider } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';const SwitchPanel = memo<PropsWithChildren>(({ children }) => {const navigate = useWorkspaceAwareNavigate();diff --git a/src/routes/(main)/home/_layout/index.tsx b/src/routes/(main)/home/_layout/index.tsxindex 019e896c649..a2b804705f9 100644--- a/src/routes/(main)/home/_layout/index.tsx+++ b/src/routes/(main)/home/_layout/index.tsx@@ -1,71 +1 @@-import { Flexbox } from '@lobehub/ui';-import { useTheme } from 'antd-style';-import { Activity, type FC, type ReactNode, useEffect, useMemo, useState } from 'react';-import { Outlet, useLocation } from 'react-router';--import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';-import { useIsDark } from '@/hooks/useIsDark';--import HomeAgentIdSync from './HomeAgentIdSync';-import RecentHydration from './RecentHydration';-import { styles } from './style';--interface LayoutProps {- children?: ReactNode;-}--const Layout: FC<LayoutProps> = ({ children }) => {- const isDarkMode = useIsDark();- const theme = useTheme(); // Keep for colorBgContainerSecondary (not in cssVar)- const { pathname } = useLocation();- const activeSlug = useActiveWorkspaceSlug();- const isHomeRoute =- pathname === '/' ||- (!!activeSlug && (pathname === `/${activeSlug}` || pathname === `/${activeSlug}/`));- const [hasActivated, setHasActivated] = useState(isHomeRoute);- const content = children ?? <Outlet />;-- useEffect(() => {- if (isHomeRoute) setHasActivated(true);- }, [isHomeRoute]);-- // CSS variable for dynamic background color (colorBgContainerSecondary is not in cssVar)- const cssVariables = useMemo<Record<string, string>>(- () => ({- '--content-bg-secondary': theme.colorBgContainerSecondary,- }),- [theme.colorBgContainerSecondary],- );-- if (!hasActivated) return null;-- // Keep the Home layout alive and render it offscreen when inactive. The nav- // panel entry is owned by `NavPanelShell`, not by this layout — see the note- // there for why it cannot be registered from inside the route tree.- return (- <Activity mode={isHomeRoute ? 'visible' : 'hidden'} name="DesktopHomeLayout">- {/* `position: absolute; inset: 0` keeps overlaying the outlet when Activity is hidden,- because Activity preserves state but doesn't visually hide the DOM. Force-hide here. */}- <Flexbox- className={styles.absoluteContainer}- height={'100%'}- style={isHomeRoute ? undefined : { display: 'none' }}- width={'100%'}- >- <Flexbox- className={isDarkMode ? styles.contentDark : styles.contentLight}- flex={1}- height={'100%'}- style={cssVariables}- >- {content}- </Flexbox>-- <HomeAgentIdSync />- <RecentHydration />- </Flexbox>- </Activity>- );-};--export default Layout;+export { default } from '@/features/HomeLayout';diff --git a/src/routes/(main)/resource/(home)/_layout/index.tsx b/src/routes/(main)/resource/(home)/_layout/index.tsxindex a45b05f274c..39bc44af140 100644--- a/src/routes/(main)/resource/(home)/_layout/index.tsx+++ b/src/routes/(main)/resource/(home)/_layout/index.tsx@@ -1,21 +1 @@-'use client';--import { Flexbox } from '@lobehub/ui';-import { type FC } from 'react';-import { Outlet } from 'react-router';--import Sidebar from './Sidebar';-import { styles } from './style';--const HomeLayout: FC = () => {- return (- <>- <Sidebar />- <Flexbox className={styles.mainContainer} flex={1} height={'100%'}>- <Outlet />- </Flexbox>- </>- );-};--export default HomeLayout;+export { default } from '@/features/ResourceHome/Layout';diff --git a/src/routes/(main)/resource/(home)/index.tsx b/src/routes/(main)/resource/(home)/index.tsxindex ccac04bd4f2..2d0131bdca7 100644--- a/src/routes/(main)/resource/(home)/index.tsx+++ b/src/routes/(main)/resource/(home)/index.tsx@@ -1,61 +1 @@-'use client';--import { memo, useLayoutEffect } from 'react';-import { useLocation, useSearchParams } from 'react-router';--import ResourceManager from '@/features/ResourceManager';-import WorkGallery from '@/features/WorkGallery';-import { parseWorkGalleryKey } from '@/features/WorkGallery/const';-import { FilesTabs } from '@/types/files';--import { useInitFileCheck } from '../features/hooks/useInitFileCheck';-import { useResourceManagerStore } from '../features/store';--const ResourceHomePage = memo(() => {- const [searchParams] = useSearchParams();- const location = useLocation();- const [setCategory, setLibraryId] = useResourceManagerStore((s) => [- s.setCategory,- s.setLibraryId,- ]);-- const categoryParam = (searchParams.get('category') as FilesTabs) || FilesTabs.All;- // `?works=<type>` switches the content area to the cross-topic Work gallery,- // independent of the file explorer (which stays keyed on `?category=`).- const worksKey = parseWorkGalleryKey(searchParams.get('works'));-- // Clear libraryId when on home route using useLayoutEffect- // useLayoutEffect runs synchronously before browser paint, ensuring state is cleared- // before child components' useEffects run, while avoiding React's setState-in-render error- // IMPORTANT: Only depend on location.pathname, NOT currentLibraryId to avoid feedback loop- // When location changes to /resource, clear libraryId- // Don't clear when location is /library/* (even if this component is still mounted)- useLayoutEffect(() => {- const isOnHomeRoute =- location.pathname === '/resource' || !location.pathname.includes('/library/');- if (isOnHomeRoute) {- setLibraryId(undefined);- }- }, [setLibraryId, location.pathname]);-- // Sync category from URL using useLayoutEffect- // IMPORTANT: Only sync if we're actually on the home route (not transitioning to library)- useLayoutEffect(() => {- const isOnHomeRoute =- location.pathname === '/resource' || !location.pathname.includes('/library/');- if (isOnHomeRoute) {- setCategory(categoryParam);- }- }, [categoryParam, setCategory, location.pathname]);-- // Sync file view mode from URL- useInitFileCheck();-- if (worksKey) return <WorkGallery galleryKey={worksKey} />;-- return <ResourceManager />;-});--ResourceHomePage.displayName = 'ResourceHomePage';--export default ResourceHomePage;+export { default } from '@/features/ResourceHome';diff --git a/src/routes/(main)/resource/_layout/index.tsx b/src/routes/(main)/resource/_layout/index.tsxindex e169f43b1f2..2da846be3de 100644--- a/src/routes/(main)/resource/_layout/index.tsx+++ b/src/routes/(main)/resource/_layout/index.tsx@@ -1,17 +1 @@-'use client';--import { type FC } from 'react';-import { Outlet } from 'react-router';--import RegisterHotkeys from './RegisterHotkeys';--const ResourceLayout: FC = () => {- return (- <>- <Outlet />- <RegisterHotkeys />- </>- );-};--export default ResourceLayout;+export { default } from '@/features/ResourceManager/Layout';diff --git a/src/routes/(main)/resource/library/[slug]/index.tsx b/src/routes/(main)/resource/library/[slug]/index.tsxindex f9cf91f3f60..a217da5ab89 100644--- a/src/routes/(main)/resource/library/[slug]/index.tsx+++ b/src/routes/(main)/resource/library/[slug]/index.tsx@@ -1 +1 @@-export { default } from '../index';+export { default } from '@/features/ResourceLibrary';diff --git a/src/routes/(main)/resource/library/_layout/index.tsx b/src/routes/(main)/resource/library/_layout/index.tsxindex 1c17970da85..4ec9008602b 100644--- a/src/routes/(main)/resource/library/_layout/index.tsx+++ b/src/routes/(main)/resource/library/_layout/index.tsx@@ -1,24 +1 @@-'use client';--import { Flexbox } from '@lobehub/ui';-import { type FC } from 'react';-import { Outlet } from 'react-router';--import RegisterHotkeys from '@/routes/(main)/resource/library/features/RegisterHotkeys';--import Sidebar from './Sidebar';-import { styles } from './style';--const LibraryLayout: FC = () => {- return (- <>- <Sidebar />- <Flexbox className={styles.mainContainer} flex={1} height={'100%'}>- <Outlet />- </Flexbox>- <RegisterHotkeys />- </>- );-};--export default LibraryLayout;+export { default } from '@/features/ResourceLibrary/Layout';diff --git a/src/routes/(main)/resource/library/index.tsx b/src/routes/(main)/resource/library/index.tsxindex 17fb30789fa..a217da5ab89 100644--- a/src/routes/(main)/resource/library/index.tsx+++ b/src/routes/(main)/resource/library/index.tsx@@ -1,63 +1 @@-'use client';--import { memo, useLayoutEffect } from 'react';-import { useLocation, useParams } from 'react-router';--import NotFound from '@/components/404';-import AsyncError from '@/components/AsyncError';-import NProgress from '@/components/NProgress';-import ResourceManager from '@/features/ResourceManager';-import Container from '@/routes/(main)/resource/library/features/Container';--import { useInitFileCheck } from '../features/hooks/useInitFileCheck';-import { useKnowledgeBaseItem } from '../features/hooks/useKnowledgeItem';-import { useResourceManagerStore } from '../features/store';--const MainContent = memo(() => {- const { id: knowledgeBaseId } = useParams<{ id: string }>();- const location = useLocation();- const setLibraryId = useResourceManagerStore((s) => s.setLibraryId);-- // Load knowledge base data- const { data, isLoading, error, mutate } = useKnowledgeBaseItem(knowledgeBaseId || '');-- // Sync libraryId from URL params using useLayoutEffect- // useLayoutEffect runs synchronously before browser paint, ensuring state is set- // before Explorer component renders and computes query parameters- // IMPORTANT: Only depend on knowledgeBaseId and location.pathname, NOT currentLibraryId to avoid feedback loop- useLayoutEffect(() => {- const isOnLibraryRoute = location.pathname.includes('/library/');- if (isOnLibraryRoute) {- setLibraryId(knowledgeBaseId);- }- }, [knowledgeBaseId, setLibraryId, location.pathname]);-- // Sync file view mode from URL- useInitFileCheck();-- // A network / 500 on the KB fetch is NOT "this library doesn't exist" (Read §1.1):- // branch a transient error to a reload state that keeps the URL, and reserve the- // terminal 404 for a genuinely resolved-null (deleted / never-existed) record.- if (error && !data) return <AsyncError error={error} variant={'page'} onRetry={() => mutate()} />;-- if (!isLoading && !data) return <NotFound />;-- return <ResourceManager />;-});--MainContent.displayName = 'LibraryMainContent';--const LibraryPage = memo(() => {- return (- <>- <NProgress />- <Container>- <MainContent />- </Container>- </>- );-});--LibraryPage.displayName = 'LibraryPage';--export default LibraryPage;+export { default } from '@/features/ResourceLibrary';diff --git a/src/routes/(main)/settings/_layout/index.tsx b/src/routes/(main)/settings/_layout/index.tsxindex 5cf328eee30..9cf35adb44e 100644--- a/src/routes/(main)/settings/_layout/index.tsx+++ b/src/routes/(main)/settings/_layout/index.tsx@@ -1,28 +1 @@-'use client';--import { Flexbox } from '@lobehub/ui';-import { type FC } from 'react';-import { Outlet } from 'react-router';--import SideBar from '@/routes/(main)/settings/_layout/SideBar';--import SettingsContextProvider from './ContextProvider';-import { styles } from './style';--const Layout: FC = () => {- return (- <SettingsContextProvider- value={{- showOpenAIApiKey: true,- showOpenAIProxyUrl: true,- }}- >- <SideBar />- <Flexbox className={styles.mainContainer} flex={1} height={'100%'}>- <Outlet />- </Flexbox>- </SettingsContextProvider>- );-};--export default Layout;+export { default } from '@/features/Settings/Layout';diff --git a/src/routes/(main)/settings/index.tsx b/src/routes/(main)/settings/index.tsxindex 0a914b353e8..fbfc54b61ab 100644--- a/src/routes/(main)/settings/index.tsx+++ b/src/routes/(main)/settings/index.tsx@@ -1,40 +1 @@-'use client';--import { memo } from 'react';-import { useMatches, useParams } from 'react-router';--import { SettingsTabs } from '@/store/global/initialState';--import { type LayoutProps } from './_layout/type';-import SettingsContent from './features/SettingsContent';--interface SettingsRouteHandle {- settingsTab?: SettingsTabs;-}--const isSettingsRouteHandle = (handle: unknown): handle is SettingsRouteHandle => {- return typeof handle === 'object' && handle !== null && 'settingsTab' in handle;-};--const getSettingsTabFromMatches = (matches: ReturnType<typeof useMatches>) => {- for (const match of [...matches].reverse()) {- const { handle } = match;- if (isSettingsRouteHandle(handle) && handle.settingsTab) return handle.settingsTab;- }-};--const Layout = memo<LayoutProps>(() => {- const params = useParams<{ tab?: string }>();- const matches = useMatches();-- const activeTab =- (params.tab as SettingsTabs | undefined) ||- getSettingsTabFromMatches(matches) ||- SettingsTabs.Profile;-- return <SettingsContent activeTab={activeTab} mobile={false} />;-});--Layout.displayName = 'DesktopSettingsLayout';--export default Layout;+export { default } from '@/features/Settings';diff --git a/src/routes/(main)/settings/provider/index.tsx b/src/routes/(main)/settings/provider/index.tsxindex 005f37ec936..be98301eb77 100644--- a/src/routes/(main)/settings/provider/index.tsx+++ b/src/routes/(main)/settings/provider/index.tsx@@ -1,72 +1 @@-'use client';--import { Flexbox } from '@lobehub/ui';-import { memo } from 'react';-import { Outlet, useParams } from 'react-router';--import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';--import DesktopLayoutContainer from './_layout/Desktop/Container';-import ProviderDetailPageComponent from './detail';-import ProviderMenu from './ProviderMenu';--// Layout component that wraps provider pages with navigation-export const ProviderLayout = memo(() => {- const navigate = useWorkspaceAwareNavigate();-- const handleProviderSelect = (providerKey: string) => {- navigate(`/settings/provider/${providerKey}`);- };-- return (- <Flexbox- horizontal- width={'100%'}- style={{- maxHeight: '100%',- }}- >- <ProviderMenu mobile={false} onProviderSelect={handleProviderSelect} />- <DesktopLayoutContainer>- <Outlet />- </DesktopLayoutContainer>- </Flexbox>- );-});--ProviderLayout.displayName = 'ProviderLayout';--// Detail page component that receives providerId from route params-export const ProviderDetailPage = memo(() => {- const params = useParams<{ providerId: string }>();- const navigate = useWorkspaceAwareNavigate();-- const handleProviderSelect = (providerKey: string) => {- navigate(`/settings/provider/${providerKey}`);- };-- return (- <ProviderDetailPageComponent- id={params.providerId ?? ''}- onProviderSelect={handleProviderSelect}- />- );-});--ProviderDetailPage.displayName = 'ProviderDetailPage';--// Default export for backward compatibility (used by SettingsContent)-type ProviderPageType = {- mobile?: boolean;-};--const ProviderPage = (props: ProviderPageType) => {- const { mobile } = props;-- // For mobile or when used via SettingsContent, use the old Page component- // This is a fallback for non-router usage- const OldPage = require('./(list)').default;- return <OldPage mobile={mobile} />;-};--export default ProviderPage;+export { default, ProviderDetailPage, ProviderLayout } from '@/features/Settings/provider';diff --git a/src/routes/(mobile)/(home)/_layout/index.tsx b/src/routes/(mobile)/(home)/_layout/index.tsxindex ef6a858c5df..f6ff92bc70f 100644--- a/src/routes/(mobile)/(home)/_layout/index.tsx+++ b/src/routes/(mobile)/(home)/_layout/index.tsx@@ -1,18 +1 @@-import { type FC } from 'react';-import { Outlet } from 'react-router';--import MobileLayout from '@/routes/(mobile)/(home)/_layout/MobileLayout';-import SessionHydration from '@/routes/(mobile)/(home)/_layout/SessionHydration';--const Layout: FC = () => {- return (- <>- <MobileLayout>- <Outlet />- </MobileLayout>- <SessionHydration />- </>- );-};--export default Layout;+export { default } from '@/features/MobileHome/Layout';diff --git a/src/routes/(mobile)/(home)/index.tsx b/src/routes/(mobile)/(home)/index.tsxindex 5e551205b72..b8d36d29dcb 100644--- a/src/routes/(mobile)/(home)/index.tsx+++ b/src/routes/(mobile)/(home)/index.tsx@@ -1,16 +1 @@-import { memo,Suspense } from 'react';--import SessionListContent from './features/SessionListContent';-import SkeletonList from './features/SkeletonList';--const Home = memo(() => {- return (- <Suspense fallback={<SkeletonList />}>- <SessionListContent />- </Suspense>- );-});--Home.displayName = 'MobileHome';--export default Home;+export { default } from '@/features/MobileHome';diff --git a/src/routes/(mobile)/settings/_layout/index.tsx b/src/routes/(mobile)/settings/_layout/index.tsxindex aab28511ea0..ce2f090aa4f 100644--- a/src/routes/(mobile)/settings/_layout/index.tsx+++ b/src/routes/(mobile)/settings/_layout/index.tsx@@ -4,8 +4,8 @@ import { memo } from 'react';import { Outlet } from 'react-router';import MobileContentLayout from '@/components/server/MobileNavLayout';+import SettingsContextProvider from '@/features/Settings/Layout/ContextProvider';-import SettingsContextProvider from '../../../(main)/settings/_layout/ContextProvider';import Header from './Header';const MobileSettingsWrapper = memo(() => {diff --git a/src/routes/(mobile)/settings/index.tsx b/src/routes/(mobile)/settings/index.tsxindex 4b254342811..65c036a06fd 100644--- a/src/routes/(mobile)/settings/index.tsx+++ b/src/routes/(mobile)/settings/index.tsx@@ -2,10 +2,10 @@import MobileContentLayout from '@/components/server/MobileNavLayout';import Footer from '@/features/Setting/Footer';+import SettingsContent from '@/features/Settings/features/SettingsContent';import { parseAsString, useQueryState } from '@/hooks/useQueryParam';import { SettingsTabs } from '@/store/global/initialState';-import SettingsContent from '../../(main)/settings/features/SettingsContent';import Header from './_layout/Header';const Layout = () => {diff --git a/src/routes/(mobile)/settings/provider/_layout/index.tsx b/src/routes/(mobile)/settings/provider/_layout/index.tsxindex 5eda0466b3f..1dbb08df01d 100644--- a/src/routes/(mobile)/settings/provider/_layout/index.tsx+++ b/src/routes/(mobile)/settings/provider/_layout/index.tsx@@ -2,10 +2,9 @@import { Outlet, useParams } from 'react-router';+import ProviderMenu from '@/features/Settings/provider/ProviderMenu';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import ProviderMenu from '../../../../(main)/settings/provider/ProviderMenu';-const Layout = () => {const params = useParams<{ providerId: string }>();const navigate = useWorkspaceAwareNavigate();diff --git a/src/routes/onboarding/index.tsx b/src/routes/onboarding/index.tsxindex 444c6cfb032..45bab47ea0b 100644--- a/src/routes/onboarding/index.tsx+++ b/src/routes/onboarding/index.tsx@@ -1,96 +1 @@-'use client';--import { Flexbox } from '@lobehub/ui';-import { memo, useCallback, useEffect, useRef } from 'react';-import { useSearchParams } from 'react-router';--import Loading from '@/components/Loading/BrandTextLoading';-import ClassicOnboardingPage from '@/features/Onboarding/Classic';-import { useOnboardingAgentTemplates } from '@/hooks/useOnboardingAgentTemplates';-import OnboardingContainer from '@/routes/onboarding/_layout';-import ResponseLanguageStep from '@/routes/onboarding/features/ResponseLanguageStep';-import TelemetryStep from '@/routes/onboarding/features/TelemetryStep';-import {- trackOnboardingStepCompleted,- trackOnboardingStepViewed,-} from '@/services/onboardingMetrics';-import { useUserStore } from '@/store/user';-import { onboardingSelectors } from '@/store/user/selectors';-import { clearStaleOnboardingCallbackUrl } from '@/utils/onboardingRedirect';--const COMMON_STEP_TRACKING = {- 1: { flow: 'common', step: 'telemetry', stepIndex: 1 },- 2: { flow: 'common', step: 'response_language', stepIndex: 2 },-} as const;--const OnboardingPage = memo(() => {- const isUserStateInit = useUserStore((s) => s.isUserStateInit);- const commonStepsCompleted = useUserStore(onboardingSelectors.commonStepsCompleted);-- const [searchParams, setSearchParams] = useSearchParams();- const step: 1 | 2 = searchParams.get('step') === '2' ? 2 : 1;- const hasStepParam = searchParams.has('step');- const viewedStepKeysRef = useRef<Set<string>>(new Set());-- useOnboardingAgentTemplates(isUserStateInit && (!commonStepsCompleted || hasStepParam));-- // This component only mounts on top-level entries to `/onboarding` (fresh- // signup landings and `?step` re-entries from the classic back button), so- // mount is the one safe point to drop a stale callback stashed by a- // previously abandoned attempt — later search changes are internal step- // navigations that must keep the stash.- useEffect(() => {- clearStaleOnboardingCallbackUrl(window.location.pathname, window.location.search);- }, []);-- useEffect(() => {- if (!isUserStateInit || (commonStepsCompleted && !hasStepParam)) return;-- const payload = COMMON_STEP_TRACKING[step];- if (viewedStepKeysRef.current.has(payload.step)) return;-- viewedStepKeysRef.current.add(payload.step);- trackOnboardingStepViewed(payload);- }, [commonStepsCompleted, hasStepParam, isUserStateInit, step]);-- const goNextFromTelemetry = useCallback(() => {- trackOnboardingStepCompleted(COMMON_STEP_TRACKING[1]);- setSearchParams({ step: '2' }, { replace: true });- }, [setSearchParams]);-- const goBackFromLanguage = useCallback(() => {- setSearchParams({ step: '1' }, { replace: true });- }, [setSearchParams]);-- const finishCommon = useCallback(() => {- trackOnboardingStepCompleted(COMMON_STEP_TRACKING[2]);- setSearchParams({}, { replace: true });- }, [setSearchParams]);-- if (!isUserStateInit) {- return <Loading debugId="Onboarding/userState" />;- }-- // With the shared prefix complete, `/onboarding` renders the classic branch- // inline — but an explicit `?step` (classic FullName back button) re-enters- // the prefix.- if (commonStepsCompleted && !hasStepParam) {- return <ClassicOnboardingPage />;- }-- return (- <OnboardingContainer>- <Flexbox gap={24} style={{ maxWidth: 600, width: '100%' }}>- {step === 1 ? (- <TelemetryStep onNext={goNextFromTelemetry} />- ) : (- <ResponseLanguageStep onBack={goBackFromLanguage} onNext={finishCommon} />- )}- </Flexbox>- </OnboardingContainer>- );-});--OnboardingPage.displayName = 'OnboardingPage';--export default OnboardingPage;+export { default } from '@/features/Onboarding';diff --git a/src/spa/router/desktopRouter.shared.tsx b/src/spa/router/desktopRouter.shared.tsxindex e583e181c62..0ce3c944b04 100644--- a/src/spa/router/desktopRouter.shared.tsx+++ b/src/spa/router/desktopRouter.shared.tsx@@ -23,6 +23,7 @@ import { agentDocumentRouteMeta } from '@/features/AgentDocumentPage/routeMeta';import { taskRouteMeta, tasksRouteMeta } from '@/features/AgentTasks/routeMeta';import { agentsRouteMeta } from '@/features/AgentViewAll/routeMeta';import { pageRouteMeta } from '@/features/Pages/routeMeta';+import { settingsRouteMeta } from '@/features/Settings/features/routeMeta';import { workspaceHomeRouteMeta } from '@/features/Workspace/routeMeta';import {agentChannelRouteMeta,@@ -33,7 +34,6 @@ import {topicsRouteMeta,} from '@/routes/(main)/agent/features/routeMeta';import { groupProfileRouteMeta, groupRouteMeta } from '@/routes/(main)/group/features/routeMeta';-import { settingsRouteMeta } from '@/routes/(main)/settings/features/routeMeta';import AppShellSkeleton, { APP_SHELL_FALLBACK_ID } from '@/spa/BootShell/AppShellSkeleton';import { loadRouteWithBuiltinToolSurfaces } from '@/spa/initialize/toolSurfaces';import { routeMeta } from '@/spa/router/routeMeta';