Skip to content

Commit 07b0e15

Browse files
Simplify Load button and remove skill error toast
1 parent 3aee66b commit 07b0e15

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

frontend/src/components/repo/RepoSkillsList.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { AlertCircle, Loader2, Sparkles } from 'lucide-react'
2-
import { Button } from '@/components/ui/button'
1+
import { AlertCircle, Loader2 } from 'lucide-react'
32
import type { SkillFileInfo } from '@opencode-manager/shared'
43

54
interface RepoSkillsListProps {
@@ -74,15 +73,13 @@ export function RepoSkillsList({
7473
)}
7574
</div>
7675
{onLoad && (
77-
<Button
78-
variant="ghost"
79-
size="sm"
76+
<button
77+
type="button"
8078
onClick={() => onLoad(skill)}
81-
className="shrink-0"
79+
className="shrink-0 text-xs font-medium text-primary hover:text-foreground transition-colors"
8280
>
83-
<Sparkles className="w-4 h-4" />
84-
<span>Load</span>
85-
</Button>
81+
Load
82+
</button>
8683
)}
8784
</div>
8885
))}

frontend/src/hooks/useOpenCode.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,17 +685,15 @@ export const useLoadSkill = (
685685
const response = await client.sendCommand(sessionID, { command: skillName, arguments: "" });
686686
return { optimisticUserID, response };
687687
},
688-
onError: (error) => {
688+
onError: () => {
689689
if (sessionID) {
690690
const messagesQueryKey = ["opencode", "messages", opcodeUrl, sessionID, directory];
691-
setSessionStatus(sessionID!, { type: "idle" });
691+
setSessionStatus(sessionID!, { type: "idle" });
692692
queryClient.setQueryData<MessageWithParts[]>(
693693
messagesQueryKey,
694694
(old) => old?.filter((m) => !m.info.id.startsWith("optimistic_")),
695695
);
696696
}
697-
const message = error instanceof Error ? error.message : "Failed to load skill";
698-
showToast.error(message);
699697
},
700698
onSuccess: (data) => {
701699
const { response } = data;

0 commit comments

Comments
 (0)