Currently, threads that are incomplete are not drawn properly by aerc.
For example:
Sender A Re: test msg 01 Jan 01
Sender B Re: test msg 02 Jan 01
Sender C Re: test msg 03 Jan 01
Use the first message as a "dummy" root, and link the rest of the
messages to it. The above example becomes:
Sender A ┬─>Re: test msg 01 Jan 01
Sender B ├─> 02 Jan 01
Sender C └─> 03 Jan 01
Julio B (2):
notmuch: draw incomplete threads
ui: use a custom prefix for dummy root
app/msglist.go | 6 +++++-
config/aerc.conf | 14 ++++++++++++++
config/ui.go | 2 ++
doc/aerc-config.5.scd | 11 +++++++++++
worker/notmuch/lib/database.go | 17 ++++++++++++-----
worker/types/thread.go | 3 +++
6 files changed, 47 insertions(+), 6 deletions(-)
--
2.44.0
Create a "pseudo thread" with the first message as root. This is a
temporary solution, until we have a more generic implementation of dummy
messages that works for all backends.
Signed-off-by: Julio B <julio.bacel@gmail.com>
---
worker/notmuch/lib/database.go | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go
index 4d853642..beddb38d 100644
--- a/worker/notmuch/lib/database.go+++ b/worker/notmuch/lib/database.go
@@ -137,11 +137,17 @@ func (db *DB) ThreadsFromQuery(ctx context.Context, q string, entireThread bool)
thread := threads.Thread()
tlm := thread.TopLevelMessages()
root := db.makeThread(nil, &tlm, entireThread)
- // if len(root) > 1 {- // TODO make a dummy root node and link all the- // first level children to it- // }- res = append(res, root...)+ if len(root) > 1 {+ root[0].FirstChild = root[0].NextSibling+ root[0].NextSibling.PrevSibling = nil+ root[0].NextSibling = nil+ for i := 1; i < len(root); i++ {+ root[i].Parent = root[0]+ }+ res = append(res, root[0])+ } else {+ res = append(res, root...)+ } tlm.Close()
thread.Close()
}
--
2.44.0
[PATCH aerc 2/2] ui: use a custom prefix for dummy root
It works fine for level-1 siblings, but if you mix them with level-2,
you get disappearing messages (which is way worse than unthreaded
messages). As discussed over on irc, fixing the root to the first
message doesn't seem like the best solution. Probably, creating a fake
ancestor would be better.
Tested-By: inwit <inwit@sindominio.net>
On Mon Mar 25, 2024 at 7:38 PM EET, inwit wrote:
> It works fine for level-1 siblings, but if you mix them with level-2,> you get disappearing messages (which is way worse than unthreaded> messages). As discussed over on irc, fixing the root to the first> message doesn't seem like the best solution. Probably, creating a fake> ancestor would be better.>> Tested-By: inwit <inwit@sindominio.net>
Thank you inwit for testing this out! That's correct, some edge cases
are not handled properly with this patch. The solution seems to be much
more complex and requires changes deep down in the threading logic of
aerc. Unfortunately, I haven't achieved much with this yet. I'm not
familiar with the whole codebase and i couldn't fix this without
breaking the message list. This turned out to be more challenging than
I initially thought!
Applied: [PATCH aerc 0/2] Implement dummy threads for notmuch
Julio B <julio.bacel@gmail.com> wrote:
> Currently, threads that are incomplete are not drawn properly by aerc.> For example:>> Sender A Re: test msg 01 Jan 01> Sender B Re: test msg 02 Jan 01> Sender C Re: test msg 03 Jan 01>> Use the first message as a "dummy" root, and link the rest of the> messages to it. The above example becomes:>> Sender A ┬─>Re: test msg 01 Jan 01> Sender B ├─> 02 Jan 01> Sender C └─> 03 Jan 01>> Julio B (2):> notmuch: draw incomplete threads> ui: use a custom prefix for dummy root
Acked-by: Robin Jarry <robin@jarry.cc>
Applied, thanks.
To git@git.sr.ht:~rjarry/aerc
65332c233880..941e2e9e7de0 master -> master