microsoft / microsoft/vscode

Add confirmation dialog when expanding folders with an excessive number of image files

Open
#334,914 0 comments 0 reactions 1 assignee Claimed by @lramos15 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Type: Feature Request

Problem
I accidentally clicked to expand a folder in the Explorer sidebar that contained approximately 770,000 image files. VS Code became completely unresponsive and froze for an extended period while trying to scan and process the folder contents.

During this operation, there was no "Cancel" button available to abort the expansion. I was forced to kill the process via Task Manager, which resulted in the loss of my unsaved workspace state.

Proposed Solution
Add a safety mechanism for the Explorer tree view to prevent accidental UI freezes caused by expanding large media directories.

When a user clicks to expand a folder, perform a fast, lightweight count of the files inside (specifically checking for image extensions like .png, .jpg, .jpeg, .gif, .webp, .bmp, .svg, .ico, etc., or all files if a quick filter is not feasible).

If the total count exceeds a predefined or user-configurable threshold (e.g., default 10,000 files or 5,000 images), block the expansion and display a modal confirmation dialog:

"This folder contains [X] image files. Expanding it may cause significant performance lag or unresponsiveness. Do you want to continue?"

Provide "Continue" and "Cancel" buttons. Clicking "Cancel" should safely abort the expansion without freezing the UI.

Alternatives Considered
Adding a "Cancel" button to the file explorer loading/scanning process (this would help even without a pre-check).

Utilizing the existing files.exclude setting, but this doesn't help in an accidental click scenario where the user hasn't pre-configured exclusions for the specific folder.

Additional Context
VS Code version: [Insert your version, e.g., 1.93.0]

OS: [Insert your OS, e.g., Windows 11 / macOS 14]

It would be helpful to have a new setting, such as explorer.confirmOnLargeFolder or explorer.largeFolderThreshold, allowing users to disable the check if they prefer the current behavior.

VS Code version: Code 1.136.1 (a44adf7f53e00964ab890f9f8758a334f1fc15bc, 2026-09-03T05:06:41Z)
OS version: Windows_NT x64 10.0.26200
Modes:

System Info

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 9 7950X 16-Core Processor (32 x 4491)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x2487 [NVIDIA GeForce RTX 3060], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.16.1664 *ACTIVE*
GPU1: VENDOR= 0x1002, DEVICE=0x164e [AMD Radeon(TM) Graphics], DRIVER_VERSION=32.0.21043.5001
GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8972
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|63.14GB (31.90GB free)|
|Process Argv|. --crash-reporter-id 034b154e-d115-4b64-9ea7-f7c0e1441d24|
|Screen Reader|no|
|VM|44%|
Extensions (3)

Name|Identifier|Author|Version
---|---|---|---
Claude Code for VS Code|anthropic.claude-code|Anthropic|2.1.263
Chinese (Simplified) (简体中文) Language Pack for Visual Studio Code|ms-ceintl.vscode-language-pack-zh-hans|MS-CEINTL|1.131.2026090407
Codex – OpenAI’s coding agent|openai.chatgpt|openai|26.901.22334

A/B Experiments

```
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
4f60g487:31327383
envsactivate1:31551504
gh487529:31544284
cloudbuttont:31379625
3efgi100_wstrepl:31403338
55ia6109:31457054
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31466945
c3h7c220:31478652
cp_cls_c_1081:31454833
conptydll_true:31498968
core-renderer-profiling-on:31440367
e9c30283:31461165
46204921:31447328
ei9d7968:31496641
chat:31457767
ddid_t:31478206
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
db5d2638:31499441
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
a1ije391_t:31540920
jbcp_cls_pctr_t:31531130
cp_intellij_t_nes:31548657
gf14b233:31526830
ahp-both-windows:31556933
ihg5j128:31534457
7g2b5551:31542111
enable_editor_pane_layout:31569726
allow-none:31555437
ac562147:31564510
c7c27ce7:31554789
1h923230:31564177
1532g621_copy:31554320
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0d8dfbc3:31570291
a1hcc538:31559322
0c1h4866:31566224
vrbsty_fls:31561059
session-archive:31558132
5b8j3302:31564601
mangle-name-control:31572633
multiv2:31574985
2bfb8b39:31576696

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.