Index v2 📜 #3796
Replies: 11 comments 6 replies
-
The Actual Index DataAbove, you see who's holding all the data.
Opening the MailboxFirst, the user opens a mailbox. First, the backend creates a In this mailbox, there are 22 emails, 'a' to 'v' and the array has a few empty entries at the end. Enabling threadingNext, the user enables threading: The Index creates a This mailbox has two email threads, rooted at 'b' and 'o' and three individual emails, 'a', 'n' and 'v'. Limiting to one threadNext, the user does In the Menu viewThe Menu is an abstract view of some data, usually emails. In this case, the window for the Menu is only five lines high, so only emails 'd', 'g', 'h', 'i' and 'j' are visible. Note: The index numbers are the indexes in the |
Beta Was this translation helpful? Give feedback.
-
@sassmann @vuori @navi-desu @rayfordshire @whitney-cumber @auouymous You all seem keen to help improve NeoMutt (Thanks!), and the Index is the next step. Above, is the current layout of the Index -- where the data is, who owns it, etc. |
Beta Was this translation helpful? Give feedback.
-
So I thought about the I suggested a hash table on IRC to replace the current This makes indexes to |
Beta Was this translation helpful? Give feedback.
-
This ugly diagram shows the main objects and their members.
|
Beta Was this translation helpful? Give feedback.
-
#3845 - Refactor A big step towards moving |
Beta Was this translation helpful? Give feedback.
-
I've pushed my work branch to [flatcap/views]. I'm currently looking at some problem config usage:
|
Beta Was this translation helpful? Give feedback.
-
**** me! It works! In branch [flatcap/views] I've managed to move The branch is a mess of overlapping changes, but the important points are: Big Changes
Problems
Other Changes
MailboxViewsWhen the
|
Beta Was this translation helpful? Give feedback.
-
I've merged a ton of non-functional changes that passed This leaves four much-simpler commits:
36 files changed, 295 insertions(+), 197 deletions(-) |
Beta Was this translation helpful? Give feedback.
-
Work is ongoing... #3877 imap: factor out tagged emails |
Beta Was this translation helpful? Give feedback.
-
Meanwhile, I realised something about When updating int msg_deleted; ///< Number of deleted messages
int msg_flagged; ///< Number of flagged messages
int msg_new; ///< Number of new messages
int msg_unread; ///< Number of unread messages These fields only matter to the user, so it should be the front-end's responsibility to own and update them. |
Beta Was this translation helpful? Give feedback.
-
This is a breakdown of how the Index works, what problems it has and what we need to do to fix it.
Everyone's invited to ask questions and make suggestions.
I really need as many people as possible to understand the problem with me.
Introduction
NeoMutt's code has changed a LOT since its split from Mutt.
We've refactored to create APIs and libraries to reduce the dependencies and the complexity of the code.
One stubborn area is the Index.
The Index displays a list of
Email
s contained in aMailbox
.The Index can sort this list by
$sort
, etc.When new mail arrives, the backend, e.g. Maildir, needs to update this list.
Maildir is the worst offender.
It sorts the
Email
s so that when it scans the directories it can work out if any files are new.If it finds some new files, it creates new
Email
s and adds them to the list.Then, it tries to restore the Index's sorting order.
If that sounds terrifying, then you're beginning to understand.
The backends can change the order of the
Email
list and the Index has to deal with it.Not only that, the user doesn't want to see the focus jump around -- sound familiar?
Data
There are sets of data to consider: mail data and gui data.
We've made some big advances in separating the gui data out of the mail objects, but some still remains.
The plan is that we would have a shadow set of View objects, e.g.
Email
- data about the email: headers, etcEmailView
- display data, such as its colourMail Data
The mail data is rooted at the
NeoMutt
object.NeoMutt
holds a list ofAccount
s, each of which holds a list ofMailbox
s, which hold a list ofEmail
s.GUI Data
The gui data is rooted at the
RootWindow
object.The screen is divided into a nested hierarchy of
MuttWindow
s.Each window can have some data associated with it.
Here are the windows that make up the Index Dialog:
This shows the names of the components and some of the data associated with them.
IndexSharedData
IndexPrivateData
Index Shared Data
The
IndexSharedData
is available to all of the associated windows.For example, the Index has a selected Email in a particular Mailbox in an Account.
The Sidebar uses this information to highlight the current Mailbox.
There is one circumstance where there is more than one Index: attaching an Email from Compose.
This new Index Dialog has its own data and is independent of the original one.
e.g. Applying a limit won't affect the original Index.
Index Private Data
Much of the data required to work the Index is local to
mutt_index_menu()
.Some state data is required by other Index functions and that is stored in
IndexPrivateData
.Beta Was this translation helpful? Give feedback.
All reactions