mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
Simplify Load button and remove skill error toast
This commit is contained in:
1 parent
3aee66b333
commit
07b0e1548b
2 files changed
+8
-13
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import { AlertCircle, Loader2, Sparkles } from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { AlertCircle, Loader2 } from 'lucide-react'
|
||||
import type { SkillFileInfo } from '@opencode-manager/shared'
|
||||
|
||||
interface RepoSkillsListProps {
|
||||
@@ -74,15 +73,13 @@ export function RepoSkillsList({
|
||||
)}
|
||||
</div>
|
||||
{onLoad && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onLoad(skill)}
|
||||
className="shrink-0"
|
||||
className="shrink-0 text-xs font-medium text-primary hover:text-foreground transition-colors"
|
||||
>
|
||||
<Sparkles className="w-4 h-4" />
|
||||
<span>Load</span>
|
||||
</Button>
|
||||
Load
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -685,17 +685,15 @@ export const useLoadSkill = (
|
||||
const response = await client.sendCommand(sessionID, { command: skillName, arguments: "" });
|
||||
return { optimisticUserID, response };
|
||||
},
|
||||
onError: (error) => {
|
||||
onError: () => {
|
||||
if (sessionID) {
|
||||
const messagesQueryKey = ["opencode", "messages", opcodeUrl, sessionID, directory];
|
||||
setSessionStatus(sessionID!, { type: "idle" });
|
||||
setSessionStatus(sessionID!, { type: "idle" });
|
||||
queryClient.setQueryData<MessageWithParts[]>(
|
||||
messagesQueryKey,
|
||||
(old) => old?.filter((m) => !m.info.id.startsWith("optimistic_")),
|
||||
);
|
||||
}
|
||||
const message = error instanceof Error ? error.message : "Failed to load skill";
|
||||
showToast.error(message);
|
||||
},
|
||||
onSuccess: (data) => {
|
||||
const { response } = data;
|
||||
|
||||
Reference in new issue
Block a user