Migrate ConversationList from `TreeView` to `ListBox`
Goal
ConversationList (the middle pane that lists all your email threads in the current scope) currently relies on TreeView
which is the Gtk+3 recommended widget for long lists. We should replace this with ListBox
Why
Although TreeView
is the canonical way to handle long lists in Gtk-3 it has several drawbacks. Namely, it's complicated and rows in the TreeView
cannot contain widgets---instead they use CellRenderer
s. This means Geary's rows must be drawn using cairo rather than being built out of standard GTK widgets. On its own this is fine, but it prevents improvements to the display of rows in the ConversationList (see #391). One quick example is that we want to use HdyAvatar
in the row.
Concerns
TreeView
is the preferred way to do long lists for performance (and flexibility) reasons. GTK devs say that in general, ListBox
is good up to 1,000 list items whereas TreeView
scales up to 100,000 items. It's hard to say what perf will look like until we build it, but regardless this is valuable work because it prepares us for GTK-4.
GTK-4 introduces a new widget called ListView
which scales to a list of unlimited size (see here and here for details). The interface for ListView
is modeled after ListBox
. Specifically they both use an underlying ListModel
in place of TreeView
's TreeStore
. Porting from ListBox
to ListView
should be a pretty lightweight change compared to the TreeView
-> ListBox
transition.
If ListBox
perf is unacceptable, we can still hold on to the work until we can upgrade to GTK-4 (currently blocked primarily by WebkitGtk which we need to render emails).
TODOS
-
Replace
ConversationListStore
withConversationListModel
-
Get
ListBox
rendering -
Implement proper multiselection for
ListBox
-
Build row widget
- Unread status
- Multiple sender addresses
- Account for unread status in sender list
- Message counts
- Load contact image
- Figure out what to do with avatars and multiple senders
- Lots of testing