@@ -2,8 +2,8 @@ import { AlertTriangle, FolderOpen, Link, Loader2, Trash2 } from "lucide-react";
22import { useEffect , useRef } from "react" ;
33import { useFocusTrap } from "@/hooks/use-focus-trap" ;
44import type {
5- Extension ,
65 ExtensionContent as ExtContent ,
6+ Extension ,
77 GroupedExtension ,
88} from "@/lib/types" ;
99import { agentDisplayName } from "@/lib/types" ;
@@ -114,16 +114,20 @@ export function DeleteDialog({
114114 setDeleteAgents ( new Set ( ) ) ;
115115 } , [ setDeleteAgents ] ) ;
116116
117- const displayName = group . kind === "hook"
118- ? ( ( ) => {
119- const parts = group . name . split ( ":" ) ;
120- if ( parts . length >= 3 ) {
121- const cmd = parts . slice ( 2 ) . join ( ":" ) ;
122- return cmd . split ( " " ) . map ( ( t ) => t . split ( "/" ) . pop ( ) || t ) . join ( " " ) ;
123- }
124- return group . name ;
125- } ) ( )
126- : group . name ;
117+ const displayName =
118+ group . kind === "hook"
119+ ? ( ( ) => {
120+ const parts = group . name . split ( ":" ) ;
121+ if ( parts . length >= 3 ) {
122+ const cmd = parts . slice ( 2 ) . join ( ":" ) ;
123+ return cmd
124+ . split ( " " )
125+ . map ( ( t ) => t . split ( "/" ) . pop ( ) || t )
126+ . join ( " " ) ;
127+ }
128+ return group . name ;
129+ } ) ( )
130+ : group . name ;
127131
128132 const isCli = group . kind === "cli" ;
129133
@@ -134,14 +138,17 @@ export function DeleteDialog({
134138 const childMap = new Map < string , { name : string ; kind : string } > ( ) ;
135139 for ( const child of childExtensions ?? [ ] ) {
136140 const key = `${ child . kind } :${ child . name } ` ;
137- if ( ! childMap . has ( key ) ) childMap . set ( key , { name : child . name , kind : child . kind } ) ;
141+ if ( ! childMap . has ( key ) )
142+ childMap . set ( key , { name : child . name , kind : child . kind } ) ;
138143 }
139144 const children = [ ...childMap . values ( ) ] ;
140145
141146 return (
142147 < div
143148 className = "absolute inset-0 z-50 flex items-center justify-center rounded-xl overflow-hidden"
144- onClick = { ( e ) => { if ( e . target === e . currentTarget ) onClose ( ) ; } }
149+ onClick = { ( e ) => {
150+ if ( e . target === e . currentTarget ) onClose ( ) ;
151+ } }
145152 >
146153 < div className = "absolute inset-0 bg-background/80 backdrop-blur-[2px]" />
147154 < div
@@ -174,7 +181,10 @@ export function DeleteDialog({
174181 </ p >
175182 < div className = "space-y-1 rounded-lg border border-border bg-muted/30 p-2.5" >
176183 { children . map ( ( child ) => (
177- < div key = { `${ child . kind } :${ child . name } ` } className = "flex items-center gap-2 text-xs" >
184+ < div
185+ key = { `${ child . kind } :${ child . name } ` }
186+ className = "flex items-center gap-2 text-xs"
187+ >
178188 < span className = "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground" >
179189 { child . kind }
180190 </ span >
@@ -189,7 +199,8 @@ export function DeleteDialog({
189199 < div className = "flex items-start gap-1.5 rounded-lg border border-chart-5/30 bg-chart-5/5 p-2.5 text-xs text-chart-5" >
190200 < AlertTriangle size = { 12 } className = "mt-0.5 shrink-0" />
191201 < span >
192- The binary < span className = "font-mono" > { binaryPath } </ span > will also be removed.
202+ The binary < span className = "font-mono" > { binaryPath } </ span > { " " }
203+ will also be removed.
193204 </ span >
194205 </ div >
195206 ) }
@@ -225,11 +236,12 @@ export function DeleteDialog({
225236 const usePathBased = isSkill && skillLocations && skillLocations . length > 0 ;
226237
227238 const items : DeleteItem [ ] = usePathBased
228- ? buildPathItems ( skillLocations ! )
239+ ? buildPathItems ( skillLocations )
229240 : buildAgentItems ( group . instances , instanceData , group . kind , group . name ) ;
230241
231242 const selectedKeys = deleteAgents ;
232- const allSelected = items . length > 0 && items . every ( ( i ) => selectedKeys . has ( i . key ) ) ;
243+ const allSelected =
244+ items . length > 0 && items . every ( ( i ) => selectedKeys . has ( i . key ) ) ;
233245 const isSingle = items . length === 1 ;
234246
235247 return (
@@ -333,11 +345,12 @@ export function DeleteDialog({
333345 < span className = "break-all" > { p } </ span >
334346 </ p >
335347 ) ) }
336- { ! item . description && item . mcps . map ( ( name ) => (
337- < p key = { name } className = "text-muted-foreground mt-0.5" >
338- MCP: { name }
339- </ p >
340- ) ) }
348+ { ! item . description &&
349+ item . mcps . map ( ( name ) => (
350+ < p key = { name } className = "text-muted-foreground mt-0.5" >
351+ MCP: { name }
352+ </ p >
353+ ) ) }
341354 { item . symlink && (
342355 < p className = "flex items-center gap-1 text-chart-5 mt-0.5" >
343356 < Link size = { 10 } className = "shrink-0" />
@@ -351,13 +364,18 @@ export function DeleteDialog({
351364
352365 { /* Symlink warnings */ }
353366 { ( ( ) => {
354- const selected = isSingle ? items : items . filter ( ( i ) => selectedKeys . has ( i . key ) ) ;
367+ const selected = isSingle
368+ ? items
369+ : items . filter ( ( i ) => selectedKeys . has ( i . key ) ) ;
355370 const warnings : React . ReactNode [ ] = [ ] ;
356371
357372 const symlinkItems = selected . filter ( ( i ) => i . symlink ) ;
358373 if ( symlinkItems . length > 0 ) {
359374 warnings . push (
360- < div key = "symlink" className = "flex items-start gap-1.5 rounded-lg border border-chart-5/30 bg-chart-5/5 p-2.5 text-xs text-chart-5" >
375+ < div
376+ key = "symlink"
377+ className = "flex items-start gap-1.5 rounded-lg border border-chart-5/30 bg-chart-5/5 p-2.5 text-xs text-chart-5"
378+ >
361379 < AlertTriangle size = { 12 } className = "mt-0.5 shrink-0" />
362380 < span >
363381 { symlinkItems . length === 1
@@ -377,23 +395,33 @@ export function DeleteDialog({
377395
378396 const selectedPaths = new Set ( selected . flatMap ( ( i ) => i . paths ) ) ;
379397 const affectedSymlinks = items . filter (
380- ( i ) => i . symlink && selectedPaths . has ( i . symlink ) && ! selected . includes ( i ) ,
398+ ( i ) =>
399+ i . symlink &&
400+ selectedPaths . has ( i . symlink ) &&
401+ ! selected . includes ( i ) ,
381402 ) ;
382403 if ( affectedSymlinks . length > 0 ) {
383404 const affectedAgents = affectedSymlinks . flatMap ( ( i ) => i . agents ) ;
384405 warnings . push (
385- < div key = "broken-symlink" className = "flex items-start gap-1.5 rounded-lg border border-chart-5/30 bg-chart-5/5 p-2.5 text-xs text-chart-5" >
406+ < div
407+ key = "broken-symlink"
408+ className = "flex items-start gap-1.5 rounded-lg border border-chart-5/30 bg-chart-5/5 p-2.5 text-xs text-chart-5"
409+ >
386410 < AlertTriangle size = { 12 } className = "mt-0.5 shrink-0" />
387411 < span >
388412 { affectedAgents . map ( agentDisplayName ) . join ( ", " ) } { " " }
389- { affectedAgents . length === 1 ? "has a symlink" : "have symlinks" } { " " }
390- pointing to this path — { affectedAgents . length === 1 ? "it" : "they" } will become invalid.
413+ { affectedAgents . length === 1
414+ ? "has a symlink"
415+ : "have symlinks" } { " " }
416+ pointing to this path —{ " " }
417+ { affectedAgents . length === 1 ? "it" : "they" } will become
418+ invalid.
391419 </ span >
392420 </ div > ,
393421 ) ;
394422 }
395423
396- return warnings . length > 0 ? < > { warnings } </ > : null ;
424+ return warnings . length > 0 ? warnings : null ;
397425 } ) ( ) }
398426
399427 { /* Delete button */ }
@@ -408,8 +436,7 @@ export function DeleteDialog({
408436 ) : (
409437 < Trash2 size = { 12 } />
410438 ) }
411- Delete from{ " " }
412- { items [ 0 ] . agents . map ( agentDisplayName ) . join ( ", " ) }
439+ Delete from { items [ 0 ] . agents . map ( agentDisplayName ) . join ( ", " ) }
413440 </ button >
414441 ) : (
415442 < button
@@ -430,7 +457,8 @@ export function DeleteDialog({
430457 ) : (
431458 < Trash2 size = { 12 } />
432459 ) }
433- Remove { selectedKeys . size } item{ selectedKeys . size !== 1 ? "s" : "" }
460+ Remove { selectedKeys . size } item
461+ { selectedKeys . size !== 1 ? "s" : "" }
434462 </ button >
435463 ) }
436464 </ div >
0 commit comments