Skip to content

🤯 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.

refactor: skill list

rdmclin2a8582b0b37f9
diff --git a/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx b/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx
index c2bfa70d886..a5362848f2a 100644
--- a/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx
+++ b/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx
@@ -18,7 +18,7 @@ import { BlocksIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import AddSkillButton from '@/features/SkillStore/AddSkillButton';
+import AddSkillButton from '@/features/SkillStore/SkillList/AddSkillButton';
import { useFetchInstalledPlugins } from '@/hooks/useFetchInstalledPlugins';
import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
import { useToolStore } from '@/store/tool';
diff --git a/src/app/[variants]/(main)/settings/skill/index.tsx b/src/app/[variants]/(main)/settings/skill/index.tsx
index 14ad807683d..d2279bc796d 100644
--- a/src/app/[variants]/(main)/settings/skill/index.tsx
+++ b/src/app/[variants]/(main)/settings/skill/index.tsx
@@ -21,7 +21,7 @@ const Page = () => {
<>
<SettingHeader
extra={
- <Button icon={<Icon icon={Store} />} onClick={handleOpenStore}>
+ <Button icon={<Icon icon={Store} />} onClick={handleOpenStore} size="large">
{t('skillStore.button')}
</Button>
}
diff --git a/src/features/SkillStore/SkillDetail/Header.tsx b/src/features/SkillStore/SkillDetail/Header.tsx
index 805a06bc1a4..9c350738e4c 100644
--- a/src/features/SkillStore/SkillDetail/Header.tsx
+++ b/src/features/SkillStore/SkillDetail/Header.tsx
@@ -7,7 +7,7 @@ import { Loader2, SquareArrowOutUpRight } from 'lucide-react';
import { memo, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
-import { useSkillConnect } from '@/features/SkillStore/LobeHubList/useSkillConnect';
+import { useSkillConnect } from '@/features/SkillStore/SkillList/LobeHub/useSkillConnect';
import { useDetailContext } from './DetailContext';
import { ICON_SIZE, styles } from './styles';
diff --git a/src/features/SkillStore/AddSkillButton.tsx b/src/features/SkillStore/SkillList/AddSkillButton.tsx
similarity index 100%
rename from src/features/SkillStore/AddSkillButton.tsx
rename to src/features/SkillStore/SkillList/AddSkillButton.tsx
diff --git a/src/features/SkillStore/CommunityList/Item.tsx b/src/features/SkillStore/SkillList/Community/Item.tsx
similarity index 100%
rename from src/features/SkillStore/CommunityList/Item.tsx
rename to src/features/SkillStore/SkillList/Community/Item.tsx
diff --git a/src/features/SkillStore/CommunityList/index.tsx b/src/features/SkillStore/SkillList/Community/index.tsx
similarity index 100%
rename from src/features/SkillStore/CommunityList/index.tsx
rename to src/features/SkillStore/SkillList/Community/index.tsx
diff --git a/src/features/SkillStore/CustomList/Item.tsx b/src/features/SkillStore/SkillList/Custom/Item.tsx
similarity index 100%
rename from src/features/SkillStore/CustomList/Item.tsx
rename to src/features/SkillStore/SkillList/Custom/Item.tsx
diff --git a/src/features/SkillStore/CustomList/index.tsx b/src/features/SkillStore/SkillList/Custom/index.tsx
similarity index 100%
rename from src/features/SkillStore/CustomList/index.tsx
rename to src/features/SkillStore/SkillList/Custom/index.tsx
diff --git a/src/features/SkillStore/Empty.tsx b/src/features/SkillStore/SkillList/Empty.tsx
similarity index 100%
rename from src/features/SkillStore/Empty.tsx
rename to src/features/SkillStore/SkillList/Empty.tsx
diff --git a/src/features/SkillStore/Loading.tsx b/src/features/SkillStore/SkillList/Loading.tsx
similarity index 100%
rename from src/features/SkillStore/Loading.tsx
rename to src/features/SkillStore/SkillList/Loading.tsx
diff --git a/src/features/SkillStore/LobeHubList/Item.tsx b/src/features/SkillStore/SkillList/LobeHub/Item.tsx
similarity index 100%
rename from src/features/SkillStore/LobeHubList/Item.tsx
rename to src/features/SkillStore/SkillList/LobeHub/Item.tsx
diff --git a/src/features/SkillStore/LobeHubList/index.tsx b/src/features/SkillStore/SkillList/LobeHub/index.tsx
similarity index 97%
rename from src/features/SkillStore/LobeHubList/index.tsx
rename to src/features/SkillStore/SkillList/LobeHub/index.tsx
index 3ccd4597c59..38b4b5e4fe6 100644
--- a/src/features/SkillStore/LobeHubList/index.tsx
+++ b/src/features/SkillStore/SkillList/LobeHub/index.tsx
@@ -4,6 +4,10 @@ import { KLAVIS_SERVER_TYPES, LOBEHUB_SKILL_PROVIDERS } from '@lobechat/const';
import isEqual from 'fast-deep-equal';
import { memo, useCallback, useMemo } from 'react';
+import {
+ createKlavisSkillDetailModal,
+ createLobehubSkillDetailModal,
+} from '@/features/SkillStore/SkillDetail';
import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
import { useToolStore } from '@/store/tool';
import { klavisStoreSelectors, lobehubSkillStoreSelectors } from '@/store/tool/selectors';
@@ -11,7 +15,6 @@ import { KlavisServerStatus } from '@/store/tool/slices/klavisStore';
import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types';
import Empty from '../Empty';
-import { createKlavisSkillDetailModal, createLobehubSkillDetailModal } from '../SkillDetail';
import { gridStyles } from '../style';
import Item from './Item';
diff --git a/src/features/SkillStore/LobeHubList/useSkillConnect.ts b/src/features/SkillStore/SkillList/LobeHub/useSkillConnect.ts
similarity index 98%
rename from src/features/SkillStore/LobeHubList/useSkillConnect.ts
rename to src/features/SkillStore/SkillList/LobeHub/useSkillConnect.ts
index d891d9f932d..691b3db0427 100644
--- a/src/features/SkillStore/LobeHubList/useSkillConnect.ts
+++ b/src/features/SkillStore/SkillList/LobeHub/useSkillConnect.ts
@@ -213,7 +213,15 @@ export const useSkillConnect = ({ identifier, serverName, type }: UseSkillConnec
} finally {
setIsConnecting(false);
}
- }, [userId, serverName, klavisServer, identifier, createKlavisServer, refreshKlavisServerTools, openOAuthWindow]);
+ }, [
+ userId,
+ serverName,
+ klavisServer,
+ identifier,
+ createKlavisServer,
+ refreshKlavisServerTools,
+ openOAuthWindow,
+ ]);
const handleConnect = type === 'lobehub' ? handleLobehubConnect : handleKlavisConnect;
diff --git a/src/features/SkillStore/VirtuosoLoading.tsx b/src/features/SkillStore/SkillList/VirtuosoLoading.tsx
similarity index 100%
rename from src/features/SkillStore/VirtuosoLoading.tsx
rename to src/features/SkillStore/SkillList/VirtuosoLoading.tsx
diff --git a/src/features/SkillStore/style.ts b/src/features/SkillStore/SkillList/style.ts
similarity index 100%
rename from src/features/SkillStore/style.ts
rename to src/features/SkillStore/SkillList/style.ts
diff --git a/src/features/SkillStore/SkillStoreContent.tsx b/src/features/SkillStore/SkillStoreContent.tsx
index c98536e7210..c33f87f8718 100644
--- a/src/features/SkillStore/SkillStoreContent.tsx
+++ b/src/features/SkillStore/SkillStoreContent.tsx
@@ -5,11 +5,11 @@ import { type SegmentedOptions } from 'antd/es/segmented';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
-import AddSkillButton from './AddSkillButton';
-import CommunityList from './CommunityList';
-import CustomList from './CustomList';
-import LobeHubList from './LobeHubList';
import Search from './Search';
+import AddSkillButton from './SkillList/AddSkillButton';
+import CommunityList from './SkillList/Community';
+import CustomList from './SkillList/Custom';
+import LobeHubList from './SkillList/LobeHub';
export enum SkillStoreTab {
Community = 'community',