mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-02 10:21:16 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cfe3343f6c |
@@ -353,13 +353,11 @@ impl SkillService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 去重技能列表
|
/// 去重技能列表
|
||||||
/// 使用完整的 key (owner/name:directory) 来区分不同仓库的同名技能
|
|
||||||
fn deduplicate_skills(skills: &mut Vec<Skill>) {
|
fn deduplicate_skills(skills: &mut Vec<Skill>) {
|
||||||
let mut seen = HashMap::new();
|
let mut seen = HashMap::new();
|
||||||
skills.retain(|skill| {
|
skills.retain(|skill| {
|
||||||
// 使用完整 key 而非仅 directory,允许不同仓库的同名技能共存
|
let key = skill.directory.to_lowercase();
|
||||||
let unique_key = skill.key.to_lowercase();
|
if let std::collections::hash_map::Entry::Vacant(e) = seen.entry(key) {
|
||||||
if let std::collections::hash_map::Entry::Vacant(e) = seen.entry(unique_key) {
|
|
||||||
e.insert(true);
|
e.insert(true);
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+26
-29
@@ -6,7 +6,7 @@ import {
|
|||||||
Plus,
|
Plus,
|
||||||
Settings,
|
Settings,
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
// Bot, // TODO: Agents 功能开发中,暂时不需要
|
Bot,
|
||||||
Book,
|
Book,
|
||||||
Wrench,
|
Wrench,
|
||||||
Server,
|
Server,
|
||||||
@@ -24,7 +24,6 @@ import {
|
|||||||
import { checkAllEnvConflicts, checkEnvConflicts } from "@/lib/api/env";
|
import { checkAllEnvConflicts, checkEnvConflicts } from "@/lib/api/env";
|
||||||
import { useProviderActions } from "@/hooks/useProviderActions";
|
import { useProviderActions } from "@/hooks/useProviderActions";
|
||||||
import { extractErrorMessage } from "@/utils/errorUtils";
|
import { extractErrorMessage } from "@/utils/errorUtils";
|
||||||
import { cn } from "@/lib/utils";
|
|
||||||
import { AppSwitcher } from "@/components/AppSwitcher";
|
import { AppSwitcher } from "@/components/AppSwitcher";
|
||||||
import { ProviderList } from "@/components/providers/ProviderList";
|
import { ProviderList } from "@/components/providers/ProviderList";
|
||||||
import { AddProviderDialog } from "@/components/providers/AddProviderDialog";
|
import { AddProviderDialog } from "@/components/providers/AddProviderDialog";
|
||||||
@@ -405,6 +404,7 @@ function App() {
|
|||||||
>
|
>
|
||||||
CC Switch
|
CC Switch
|
||||||
</a>
|
</a>
|
||||||
|
<div className="h-5 w-[1px] bg-black/10 dark:bg-white/15" />
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
@@ -470,34 +470,9 @@ function App() {
|
|||||||
<>
|
<>
|
||||||
<AppSwitcher activeApp={activeApp} onSwitch={setActiveApp} />
|
<AppSwitcher activeApp={activeApp} onSwitch={setActiveApp} />
|
||||||
|
|
||||||
|
<div className="h-8 w-[1px] bg-black/10 dark:bg-white/10 mx-1" />
|
||||||
|
|
||||||
<div className="glass p-1 rounded-xl flex items-center gap-1">
|
<div className="glass p-1 rounded-xl flex items-center gap-1">
|
||||||
<Button
|
|
||||||
variant="ghost"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setCurrentView("skills")}
|
|
||||||
className={cn(
|
|
||||||
"text-muted-foreground hover:text-foreground hover:bg-black/5 dark:hover:bg-white/5",
|
|
||||||
"transition-all duration-200 ease-in-out overflow-hidden",
|
|
||||||
isClaudeApp
|
|
||||||
? "opacity-100 w-8 scale-100 px-2"
|
|
||||||
: "opacity-0 w-0 scale-75 pointer-events-none px-0 -ml-1",
|
|
||||||
)}
|
|
||||||
title={t("skills.manage")}
|
|
||||||
>
|
|
||||||
<Wrench className="h-4 w-4 flex-shrink-0" />
|
|
||||||
</Button>
|
|
||||||
{/* TODO: Agents 功能开发中,暂时隐藏入口 */}
|
|
||||||
{/* {isClaudeApp && (
|
|
||||||
<Button
|
|
||||||
variant="ghost"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setCurrentView("agents")}
|
|
||||||
className="text-muted-foreground hover:text-foreground hover:bg-black/5 dark:hover:bg-white/5"
|
|
||||||
title="Agents"
|
|
||||||
>
|
|
||||||
<Bot className="h-4 w-4" />
|
|
||||||
</Button>
|
|
||||||
)} */}
|
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -507,6 +482,17 @@ function App() {
|
|||||||
>
|
>
|
||||||
<Book className="h-4 w-4" />
|
<Book className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
|
{isClaudeApp && (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => setCurrentView("skills")}
|
||||||
|
className="text-muted-foreground hover:text-foreground hover:bg-black/5 dark:hover:bg-white/5"
|
||||||
|
title={t("skills.manage")}
|
||||||
|
>
|
||||||
|
<Wrench className="h-4 w-4" />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -516,6 +502,17 @@ function App() {
|
|||||||
>
|
>
|
||||||
<Server className="h-4 w-4" />
|
<Server className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
|
{isClaudeApp && (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => setCurrentView("agents")}
|
||||||
|
className="text-muted-foreground hover:text-foreground hover:bg-black/5 dark:hover:bg-white/5"
|
||||||
|
title="Agents"
|
||||||
|
>
|
||||||
|
<Bot className="h-4 w-4" />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user