Commit 09f4d8c
Fix delete action in AI Customizations editor (microsoft#301630)
* Fix delete action visibility for read-only customizations
- Add context key overlays (type, storage, URI) when rendering list
items and context menus so when-clauses are properly evaluated
- Add when-clause to delete menu items: hide for extension, plugin,
and built-in storage types
- Update delete action handler to also block BUILTIN_STORAGE items
- Move item context key constants to shared aiCustomizationManagement.ts
- Fixes Run Prompt and Reveal in OS actions that were also broken
because the context keys were never set on the scoped service
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix delete failing when telemetry throws and trash is unsupported
Two issues caused the delete action to silently fail:
1. The telemetry call (publicLog2) was throwing an exception that
propagated uncaught, preventing the fileService.del() call from
ever executing. Wrap telemetry in try/catch so it cannot block
deletion.
2. fileService.del() was called with useTrash: true unconditionally,
but some file system providers don't support trash, causing an
error. Check hasCapability() before choosing useTrash.
Fixes both the management editor and sessions tree view delete actions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 970a8d3 commit 09f4d8c
4 files changed
Lines changed: 65 additions & 18 deletions
File tree
- src/vs
- sessions/contrib/aiCustomizationTreeView/browser
- workbench/contrib/chat/browser/aiCustomization
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
356 | 363 | | |
357 | | - | |
| 364 | + | |
358 | 365 | | |
359 | 366 | | |
360 | 367 | | |
| |||
615 | 622 | | |
616 | 623 | | |
617 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
618 | 632 | | |
619 | | - | |
| 633 | + | |
620 | 634 | | |
621 | 635 | | |
622 | 636 | | |
| |||
Lines changed: 30 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
36 | | - | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
230 | | - | |
231 | | - | |
| 234 | + | |
| 235 | + | |
232 | 236 | | |
233 | 237 | | |
234 | 238 | | |
| |||
248 | 252 | | |
249 | 253 | | |
250 | 254 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
256 | 264 | | |
257 | 265 | | |
258 | 266 | | |
259 | 267 | | |
260 | | - | |
| 268 | + | |
| 269 | + | |
261 | 270 | | |
262 | 271 | | |
263 | 272 | | |
| |||
289 | 298 | | |
290 | 299 | | |
291 | 300 | | |
292 | | - | |
293 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
294 | 309 | | |
295 | 310 | | |
296 | 311 | | |
| |||
305 | 320 | | |
306 | 321 | | |
307 | 322 | | |
| 323 | + | |
308 | 324 | | |
309 | 325 | | |
310 | 326 | | |
| |||
326 | 342 | | |
327 | 343 | | |
328 | 344 | | |
329 | | - | |
330 | | - | |
| 345 | + | |
| 346 | + | |
331 | 347 | | |
332 | 348 | | |
333 | 349 | | |
334 | 350 | | |
335 | 351 | | |
336 | 352 | | |
337 | 353 | | |
| 354 | + | |
338 | 355 | | |
339 | 356 | | |
340 | 357 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
75 | 90 | | |
76 | 91 | | |
77 | 92 | | |
| |||
0 commit comments