typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

Feature Request: Custom ordering of files and folders in Files sidebar

Open rezanid opened this issue 4 years ago • 10 comments

When the number of files and folder structure grows over time, the default alphabetic ordering of files and folders in the Files sidebar is not enough. Some times a different order would be more suitable. For example the order that content needs to be read. Although this can be done by prefixing file and folder names with numbers, but doing that would hinder readability.

I have seen some other tools that have an interesting approach to address this issue. In AzureDevOps for example, files and folders are sorted alphabetically by default, but if it finds a file with the name ".order" in any folder (including the root), it will first display the items listed in that file. You can use this technique to customize the ordering of files and sub-folders under any folder.

Example: Imagine you have a folder that contains some files and folders like the following.

+ Getting Started
+ Resiliency
+ Security
- Data Synchronization.md
- Resiliency.md
- Welcome.md

If you add a ".order" file with the following content

Welcome

The structure will be displayed like so:

- Welcome.md
+ How to get started
+ Resiliency
+ Security
- Data Synchronization.md
- Resiliency.md

It means that all the files (and folders) mentioned in the ".order" file are listed first and then whatever that is not mentioned in the ".order" file would come after in alphabetic order. To show another example, given the following ".order" file:

Welcome
Resiliency

Would result to showing the structure like so:

- Welcome.md
- Resiliency.md
+ How to get started
+ Resiliency
+ Security
- Data Synchronization.md

Ideally users should be able to change the display order by dragging files or folders up / down and the result would be reflected in the .order file.

rezanid avatar Jul 02 '20 09:07 rezanid