Please save the state of the mailboxes treeview, i.e. whether nested mailboxes and namespaces are expanded or not. I have dozens of mailboxes and multiple namespaces containing nested mailboxes up to three levels deep and it very tediuos to expand them as needed each time trojita is started or when it goes from offline to online or after editing preferences. This problem is compounded by the fact that there is no indication in the parent mailbox whether a child mailbox has unseen messages. Reproducible: Always
This makes sense. However, due to the asynchronous nature of IMAP and its implementation in Trojita (the folders are loaded on demand, as you expand them), solving this will take some time.
Pardon my ignorance on trojita internals, but could you not store a list of expanded folders and traverse it when you initialize the treeview and expand them if they exist by taking the same code paths as if a user expanded those mailboxes manually? Or would that be too hackish or visually disruptive?
By the time Trojita starts, there are no mailboxes in the view. These are filed in moments later from the on-disk cache, and at the same time a request for mailbox listing is sent to the server. When this listing arrives later, the cache mailboxes are destroyed and replaced by new instances as returned by the server. This happens for each level of nesting hierarchy. I do not think that simply expanding these items in the view would do the right thing when this asynchronity enters the picture, but I might be wrong -- please feel free to create patch. What I think is actually required is some way of baing able to "wait" (asynchronously) for a given mailbox to become "available", and code for doing this (and working correctly with the cache, which will probably involve replacing the code which simply replaces entries obtained from cache with smarter code which will only do what is actually required) is not going to be trivial.
*** Bug 349655 has been marked as a duplicate of this bug. ***
This has actually been fixed in a release for some time (v0.7).