Mailspring
Mailspring copied to clipboard
Custom sort functionality - Community#470
This update is a big step towards resolving https://community.getmailspring.com/t/custom-email-sorting/470
The update brings some basic sort functionality to the thread (including search results).
As I'm limited by the DB, you only have date
and subject
, from
and size
would require some extra fields (unread
is possible, though we already have the unread "folder")
Currently the feature remembers the order
and implements it when you switch folders or restart the app.
Q. This seems almost redundant as, after the first sort swap, it will never be triggered again. Maybe have the new setting set by default? Then this can be removed
https://github.com/glenn2223/Mailspring/blob/5b9493f87cef86c573593455844d330472d49e70/app/src/mailbox-perspective.ts#L412-L414
Q. Not sure about the naming of the new "setting"
Q. Where do we stand on increasing the sort by options?
This pull request has been mentioned on Mailspring Community. There might be relevant details there:
https://community.getmailspring.com/t/custom-email-sorting/470/7
Hey @glenn2223 thanks for your work on this! I've been holding off on merging this one because I think it'd be cool to enable those other sort options too, but it looks like you're right that it'd require a pretty big database change that may not be worth the lift.
Have you had a chance to test this on a really large mailbox? The only other thing is making sure changing away from the default sort (to subject in this case) still uses an index in SQLite. It probably won't be noticeable with less than <10k messages.
I have tried it on my main mailbox where the trash folder has over 71k messages. As you can see from the below, we'd definitely need an index.
I then created the below index
CREATE INDEX "ThreadSubjectIndex" ON "Thread" ( "subject" DESC );
And this was the result.
As we'd need to add an index it may be worth adding a size to the DB too. Then new messages can get the size from the IMAP server. Then, if a NULL
value is found, a message could pop up saying "The results are incomplete. Fetch the missing information now?". What do you think?
I also considered the below:
CREATE INDEX "ThreadIsSearchIndexedSubjectIndex" ON "Thread" ( "isSearchIndexed", "subject")
but I didn't do a benchmark before the first index, above the line is before and below is after - as you can see there's almost no difference
Any update/thoughts @bengotow? Thanks for the other merge BTW
Merging this would go a long way to make mailspring usable as a daily driver. Please consider making it high priority.
This pull request has been mentioned on Mailspring Community. There might be relevant details there:
https://community.getmailspring.com/t/sort-order-for-messags/7848/2
Any news about this?
Sorting by date is extremely important and should be treated as a priority.
Without this I can't abandon Mozilla Thunderbird