From 0fecaf60ebbd3b979d554ef7f09c0dc435ebe07e Mon Sep 17 00:00:00 2001 From: zhangmo8 Date: Thu, 27 Aug 2026 10:52:15 +0800 Subject: [PATCH 1/3] fix(skills): restore manual import entry --- .../src/pages/plugins/SkillsPluginsPage.vue | 53 +- .../plugins/skills/InstallFromGitDialog.vue | 332 ++++++++++++ .../plugins/skills/SkillInstallDialog.vue | 491 ++++++++++++++++++ .../components/SkillsPluginsPage.test.ts | 65 ++- 4 files changed, 931 insertions(+), 10 deletions(-) create mode 100644 src/renderer/src/pages/plugins/skills/InstallFromGitDialog.vue create mode 100644 src/renderer/src/pages/plugins/skills/SkillInstallDialog.vue diff --git a/src/renderer/src/pages/plugins/SkillsPluginsPage.vue b/src/renderer/src/pages/plugins/SkillsPluginsPage.vue index a408faf91..20984159b 100644 --- a/src/renderer/src/pages/plugins/SkillsPluginsPage.vue +++ b/src/renderer/src/pages/plugins/SkillsPluginsPage.vue @@ -8,8 +8,14 @@ import { Separator } from '@shadcn/components/ui/separator' import { Skeleton } from '@shadcn/components/ui/skeleton' import { ScrollArea } from '@shadcn/components/ui/scroll-area' import { Switch } from '@shadcn/components/ui/switch' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuTrigger +} from '@shadcn/components/ui/dropdown-menu' import { DcButton } from '@dc-ui/components/button' import { DcEmpty } from '@dc-ui/components/empty' +import { DcDropdownActionItem } from '@dc-ui/components/dropdown-action-item' import { createConfigClient } from '@api/ConfigClient' import { createSkillClient } from '@api/SkillClient' import type { Agent } from '@shared/types/agent-interface' @@ -24,9 +30,11 @@ import { import { resolveGuidedOnboardingStepTarget } from '@shared/guidedOnboarding' import GuidedOnboardingOverlay from '@/components/onboarding/GuidedOnboardingOverlay.vue' import ImportSkillsFromAgentDialog from './skills/ImportSkillsFromAgentDialog.vue' +import InstallFromGitDialog from './skills/InstallFromGitDialog.vue' import SkillCard from './skills/SkillCard.vue' import SkillDetailDialog from './skills/SkillDetailDialog.vue' import SkillImportExportTab from './skills/SkillImportExportTab.vue' +import SkillInstallDialog from './skills/SkillInstallDialog.vue' type SkillsView = 'skills' | 'syncDirectory' @@ -45,6 +53,8 @@ const agentUpdatePendingId = ref(null) const activeView = ref('skills') const searchQuery = ref('') const externalImportOpen = ref(false) +const installDialogOpen = ref(false) +const gitDialogOpen = ref(false) const detailDialogOpen = ref(false) const selectedSkill = ref(null) const skillDetail = ref(null) @@ -366,15 +376,38 @@ onUnmounted(() => { {{ t('settings.skills.syncDirectory.action') }} - - - {{ t('settings.skills.agentImport.menuItem') }} - + + + + + {{ t('settings.skills.addSkill') }} + + + + + + + + @@ -453,6 +486,8 @@ onUnmounted(() => { :agents="agents" @imported="loadPage(true)" /> + + + + + + {{ t('settings.skills.git.title') }} + + {{ t('settings.skills.git.description') }} + + + +
+
+ + + + + {{ t('settings.skills.git.scan') }} + +
+ +
+
{{ t('settings.skills.git.failed') }}
+
+ {{ t('common.error.requestFailed') }} +
+
+ + + +
+
+
+ {{ t('settings.skills.git.detectedFormat') }} + {{ + t(`settings.skills.git.format.${scanResult.repoFormat}`) + }} +
+
+ {{ t('settings.skills.git.selectedCount', { count: selectedNames.size }) }} +
+
+ +
+
+ {{ t('settings.skills.git.empty') }} +
+ +
+ +
+
{{ t('settings.skills.git.strategy') }}
+ + + + + +
+
+
+ + + + +
+
+ + + diff --git a/src/renderer/src/pages/plugins/skills/SkillInstallDialog.vue b/src/renderer/src/pages/plugins/skills/SkillInstallDialog.vue new file mode 100644 index 000000000..65c1c93d4 --- /dev/null +++ b/src/renderer/src/pages/plugins/skills/SkillInstallDialog.vue @@ -0,0 +1,491 @@ + + + diff --git a/test/renderer/components/SkillsPluginsPage.test.ts b/test/renderer/components/SkillsPluginsPage.test.ts index a40a1eb82..c2c994a4b 100644 --- a/test/renderer/components/SkillsPluginsPage.test.ts +++ b/test/renderer/components/SkillsPluginsPage.test.ts @@ -60,6 +60,36 @@ const passthrough = (name: string) => template: '
' }) +const DropdownActionItemStub = defineComponent({ + name: 'DcDropdownActionItem', + inheritAttrs: false, + props: { icon: String, label: String, disabled: Boolean }, + emits: ['select'], + template: + '' +}) + +const ImportSkillsFromAgentDialogStub = defineComponent({ + name: 'ImportSkillsFromAgentDialog', + props: { open: Boolean }, + emits: ['update:open', 'imported'], + template: '
' +}) + +const SkillInstallDialogStub = defineComponent({ + name: 'SkillInstallDialog', + props: { open: Boolean }, + emits: ['update:open'], + template: '
' +}) + +const InstallFromGitDialogStub = defineComponent({ + name: 'InstallFromGitDialog', + props: { open: Boolean }, + emits: ['update:open'], + template: '
' +}) + const deferred = () => { let resolve!: (value: T) => void const promise = new Promise((nextResolve) => { @@ -164,7 +194,13 @@ const mountSkillsPluginsPage = async () => { template: '