Skip to content

Commit 0da351b

Browse files
committed
refactor(web): drop dead skill toggle and redundant delete guard
Remove the unused OrgSkillFlagToggle export (and its now-unused Switch import), which had no consumers after the shared-skills admin table redesign. Simplify the delete button's onClick, which is already disabled while a flag mutation is pending.
1 parent 8550993 commit 0da351b

2 files changed

Lines changed: 1 addition & 30 deletions

File tree

packages/web/src/ee/features/chat/skills/components/workspaceSharedSkillsManager.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,7 @@ export function WorkspaceSharedSkillsManager({
243243
size="icon"
244244
className="h-8 w-8 text-muted-foreground hover:text-destructive"
245245
disabled={isDeleting || isFlagPending}
246-
onClick={() => {
247-
if (flagPendingSkills[skill.id] === undefined) {
248-
setSkillToDelete(skill);
249-
}
250-
}}
246+
onClick={() => setSkillToDelete(skill)}
251247
aria-label={`Delete ${skill.name}`}
252248
>
253249
{isDeleting ? (

packages/web/src/ee/features/chat/skills/components/workspaceSkillShared.tsx

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle,
88
} from "@/components/ui/alert-dialog";
99
import { Card, CardContent } from "@/components/ui/card";
10-
import { Switch } from "@/components/ui/switch";
1110
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
1211
import { cn } from "@/lib/utils";
1312

@@ -87,30 +86,6 @@ export function WorkspaceSkillsEmptyState({
8786
);
8887
}
8988

90-
export function OrgSkillFlagToggle({
91-
label,
92-
checked,
93-
disabled,
94-
onCheckedChange,
95-
}: {
96-
label: string;
97-
checked: boolean;
98-
disabled: boolean;
99-
onCheckedChange: (checked: boolean) => void;
100-
}) {
101-
return (
102-
<label className="flex items-center gap-2 text-xs font-medium text-muted-foreground">
103-
<span>{label}</span>
104-
<Switch
105-
checked={checked}
106-
disabled={disabled}
107-
onCheckedChange={onCheckedChange}
108-
className="scale-75"
109-
/>
110-
</label>
111-
);
112-
}
113-
11489
export function DeleteWorkspaceSkillDialog({
11590
skill,
11691
isDeleting,

0 commit comments

Comments
 (0)