Files
Files copied to clipboard
Feature: Improve support for flattening folders
What feature or improvement do you think would benefit Files?
Would love an option to dissolve or flatten a folder. Placing all the content in the parent folder. Simply said, it's the opposite of "Create folder with selection" and placing it above or below this entry would make the most sense. Example:
- 📁 Parent folder
- 📄 File A
- 📁 Sub-folder (target this folder)
- 📄 File B
- 🖼 File C
Would give:
- 📁 Parent folder
- 📄 File A
- 📄 File B
- 🖼 File C
Requirements
- [x] Add action to command palette for flattening folders when a single folder is selected
- [ ] Conflict prompt should show for conflicting/duplicate files
- [ ] Display progress in status center
- [ ] Enable option when multiple folders are selected
Files Version
2.4.71
Windows Version
Windows 10
Comments
I've seen many, many requests for this in the PowerToys repo, so I know it's something people want.
- https://github.com/microsoft/PowerToys/issues/9269
We originally discussed this in #10619 but I think it's worth bringing back the discussion again.
I updated the requirements to only include one selected folder. Based on the reception and usage of this feature, we'll consider adding support for additional options.
I would like to be more clear on the requirements.
- Should we also recursively flatten subfolders of the target folder?
- Should the target folder be deleted after the flattening is complete?
Should we also recursively flatten subfolders of the target folder?
I can see scenarios where both would make sense, perhaps we can add a modal to let the user choose.
Should the target folder be deleted after the flattening is complete?
That's my understanding.
perhaps we can add a modal to let the user choose.
How about having each as a separate command?
If we add additional options, we're going to want a modal either way. An added benefit is that it allows the user to confirm what would otherwise be a destructive action.
Fyi @Tundra
From a translator POV, is this really what "Flatten" means? I don't have a concrete wording but I think "Flatten" is not the best approach ... https://dictionary.cambridge.org/dictionary/english/flatten
It combines the folder structure into a single folder.
My only issue is about language. Flatten makes me think of unfolding a cardboard box, but I know its about creating a "flat" folder structure.
Some wording closer to "Gather files from subfolders and remove folders" but its a concept that is not easy to explain in a short way - and how you would localise the wording?
We're limited in space, but we can display a more detailed description in the confirmation prompt.
I've seen "Dissolve (a) folder(s)" being used and that isn't all too weird to me...
Personally "Dissolve" sounds like it deletes the folder.
Flattening is the term commonly used in data processing for transforming nested data structures (e.g. file trees) to a one-dimentional list. I feel like it is indeed the correct term. "Expand folder" might be another possibility in reference to how you uncompress certain structures. Regardless of this, this features would be greatly appreciated. Currently I flatten folders through PowerShell scripts, which works, but an integrated solution would be great. Both doing it permanently as well as only in view (see https://github.com/files-community/Files/issues/14319) would be great too.
@drandarov-io we ended up using the term 'Flatten' and the feature is already available in Files 🙂