Subfolders don't nest in the left sidebar unless a parent folder or label with the base path is present

Subfolders of designated folders like Trash or Archive are not shown as subfolders in the first part of the folder list, but as usual folders in the second part, all having the prefix “[Parent Folder]/”.

archives subfolders

I would expect that those “special” folders can also be expanded to show their subfolders.

Does this feature exist in another mail client or tool you use?

Yes, Thunderbird:

subfolders thunderbird


(Originally posted by jGleitz on GitHub.)

Hey! This should work in Mailspring if you create a folder just called “Archives”. The problem is that right now it looks for a parent folder, and your mail provider isn’t returning one.

We should definitely see if we can make the algorithm in the sidebar a little more flexible.

For anyone interested in taking a look at this, there’s a function in the sidebar code that takes a flat array of Folder / Label objects and produces a hierarchical representation. Right now it puts the items in alphabetical order and nests items in a single pass. We probably need to do something more sophisticated, where an (unclickable) parent item can be inferred by the presence of a path prefix on a folder / label.


(Originally posted by bengotow on GitHub.)

thanks for replying! Unfortunately, I think you misunderstood my issue. I do have a folder called “Archives”.

In the default configuration, Mailspring shows the subfolders of it as expected:

without special role

But if I make the “Archives” folder the folder with the special role “Archive”, like this:

select special role

The subfolders of the “Archives” folder are not displayed as subfolders of the special folder, but as a flat list:

with special role

I don’t know if what you are saying is also a valid work item (are there mail providers, that allow subfolders without having the parent folder as mail folder?), but for me, this issue is about something else.

Excerpt from the IMAP LIST command to verify there is an “Archives” folder:

a LIST "" *
[…]
* LIST (\HasChildren) "/" Archives
* LIST (\HasNoChildren) "/" "Archives/JUnit KIT"
* LIST (\HasNoChildren) "/" Archives/Kursverwaltung
* LIST (\HasNoChildren) "/" Archives/come2.help
* LIST (\HasNoChildren) "/" Archives/2016
* LIST (\HasNoChildren) "/" Archives/2017
[…]
a OK List completed (0.000 + 0.000 secs).

(Originally posted by jGleitz on GitHub.)

Hey folks!, one question, just to clarify:

This:

screen shot 2017-11-12 at 4 31 42 pm

Should be shown as:

screen shot 2017-11-12 at 4 37 04 pm

?

Are we nesting infinite levels of folders? As far as I can see the sidebar tree now shows up to 2 levels of folders. E.g. If I have a folder Archive/Test1/SubTest1, the tree will become Archive -> Test1/SubTest1 (Instead of Archive -> Test1 -> SubTest1).


(Originally posted by agurodriguez on GitHub.)