files-community / Files

A modern file manager that helps users organize their files and folders.
https://files.community
MIT License
34.94k stars 2.22k forks source link

Feature: Hide empty drives without attached media #16426

Open Lamparter opened 1 month ago

Lamparter commented 1 month ago

Description

Recently I plugged in an SD card reader extension in to my computer. It comes with multiple SD card slots (MMC, microSD, SDHC, xD etc.) and so plugging it in creates a new disk interface in Disk Management.

diskmgmt.mmc

These drives (F:, H:, I:, J:) are hidden in File Explorer automatically, which makes sense considering there is no data inside them and the SD card reader extension has nothing plugged into it.

explorer.exe

However, in Files they display on the homepage and in the sidebar.

Files.App.exe

Trying to open these drives results in an access denied error. This error is not logged.

Image

Steps To Reproduce

  1. Plug in a drive with no media attached
  2. See the drive appear in Files

Requirements

Files Version

3.7.11.0

Windows Version

10.0.22631.4391

User ID

0b679509-8cd1-45cb-8f30-b5fd16be82cc

Log File

View full log contents ```b 2024-11-02 17:30:30.2403|Information|App launched. Launch args type: LaunchActivatedEventArgs 2024-11-02 17:30:30.8119|Information|Adding cloud provider "Creative Cloud" mapped to {0} 2024-11-02 17:30:31.1306|Information|Drive added: C:\, Fixed 2024-11-02 17:30:31.1731|Information|Drive added: D:\, Fixed 2024-11-02 17:30:31.3555|Information|Drive added: E:\, Fixed 2024-11-02 17:30:31.3734|Warning|Unauthorized: Attempting to add the device, F:\, failed at the StorageFolder initialization step. This device will be ignored. 2024-11-02 17:30:31.4069|Information|Drive added: G:\, Removable 2024-11-02 17:30:31.4267|Warning|Unauthorized: Attempting to add the device, H:\, failed at the StorageFolder initialization step. This device will be ignored. 2024-11-02 17:30:31.4356|Warning|Unauthorized: Attempting to add the device, I:\, failed at the StorageFolder initialization step. This device will be ignored. 2024-11-02 17:30:31.4664|Warning|Unauthorized: Attempting to add the device, J:\, failed at the StorageFolder initialization step. This device will be ignored. 2024-11-02 17:30:31.4884|Information|Adding cloud provider "OneDrive" mapped to D:\OneDrive 2024-11-02 17:30:31.4932|Information|Drive added: Z:\, Network 2024-11-02 17:30:31.5580|Information|Drive added: G:\ 2024-11-02 17:30:31.5670|Information|Drive added: J:\ 2024-11-02 17:30:31.5787|Information|Drive added: I:\ 2024-11-02 17:30:31.5908|Information|Drive added: F:\ 2024-11-02 17:30:31.6022|Information|Drive added: H:\ 2024-11-02 17:30:31.6069|Information|Adding cloud provider "OneDrive - {0}" mapped to D:\OneDrive - {0} ```
2024-11-02 17:30:31.3734 | Warning | Unauthorized: Attempting to add the device, "F:\", failed at the StorageFolder initialization step; this device will be ignored.
2024-11-02 17:30:31.4267 | Warning | Unauthorized: Attempting to add the device, "H:\", failed at the StorageFolder initialization step; this device will be ignored.
2024-11-02 17:30:31.4356 | Warning | Unauthorized: Attempting to add the device, "I:\", failed at the StorageFolder initialization step; this device will be ignored.
2024-11-02 17:30:31.4664 | Warning | Unauthorized: Attempting to add the device, "J:\", failed at the StorageFolder initialization step; the device will be ignored.

There is a high chance that this issue has already been reported, though I couldn't find anything similar while searching.

Josh65-2201 commented 1 month ago

It was decided a while ago to not hide them https://github.com/files-community/Files/issues/9170#issuecomment-1247521970

Lamparter commented 1 month ago

That's a ridiculous choice since they see essentially useless being there as they lead to an error. Perhaps making the tile appear disabled would useful in this case.

0x5bfa commented 1 month ago

In fact, it's confusing while these removable media don't have physical storage space (it's not the case for DVD drive). @Lamparter Can you access these hidden drives from address bar in File Explorer?

yaira2 commented 1 month ago

If there is enough interest in changing the behavior, I'm not against making this change.

Lamparter commented 4 days ago

@yaira2 would you like to move forward with this? Perhaps you could create a poll in the server if it isn't going too far.

Lamparter commented 4 days ago

Can you access these hidden drives from address bar in File Explorer?

@0x5bfa sorry, I didn't see your question!

This little dialogue appears when typing in the drive letter. Image

Perhaps it might be good if a smaller drive widget appears in the drive section with an "insert media" label and a similar dialogue appearing when clicked.

yaira2 commented 4 days ago

@yaira2 would you like to move forward with this? Perhaps you could create a poll in the server if it isn't going too far.

Let's move forward with this.