Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom sort functionality - Community#470 #2424

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

glenn2223
Copy link
Contributor

@glenn2223 glenn2223 commented Aug 28, 2022

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?

The update brings some basic sort functionality to the thread.
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")
@foundry376-bot
Copy link

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

Prepare for localisation on the subject drop down
Adjusted attribute/query so that sorting can be case insensitive
Applied a fix that makes the draggable region in the thread toolbar work again
@bengotow
Copy link
Collaborator

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.

@glenn2223
Copy link
Contributor Author

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.

image

I then created the below index

CREATE INDEX "ThreadSubjectIndex" ON "Thread" ( "subject" DESC );

And this was the result.

image

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

image

@bengotow bengotow force-pushed the master branch 2 times, most recently from e0bdee2 to de5e87e Compare November 14, 2022 15:07
@glenn2223
Copy link
Contributor Author

glenn2223 commented Apr 12, 2023

Any update/thoughts @bengotow? Thanks for the other merge BTW

@bengotow bengotow force-pushed the master branch 5 times, most recently from 77d1cc7 to e2e0f88 Compare November 21, 2023 18:05
@alucryd
Copy link

alucryd commented Dec 2, 2023

Merging this would go a long way to make mailspring usable as a daily driver. Please consider making it high priority.

@foundry376-bot
Copy link

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

@luapfr
Copy link

luapfr commented May 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants