-
Notifications
You must be signed in to change notification settings - Fork 163
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
Message summary subjects #1589
base: master
Are you sure you want to change the base?
Message summary subjects #1589
Conversation
47df9e4
to
99f1b2f
Compare
Just discovered: |
I'm not sure which implementation of "get_subject" is better; perhaps @mjg has an opinion. I am actually surprised that this isn't already there (is that patch you mention not in master?). Ideally, the message summary would be configurable in the theme just like threadline is in search mode. |
I'm not running master yet, still on 0.9.1 as I couldn't (yet) figure out how to get the notmuch2 bindnigs to work. That said, no @mjg 's patch isn't on master, probably for the same reasons you've highlighted above ;-) (the get_subject and summary line is all in one patch currently.). Once I'm on master, I'll see about sending a PR for just the get_subject() as that is likely to be useful on it's own anyway, and then tackle the configuration file parts. |
I use alot with a couple of private additions, and I don't think matching for But then I don't know why anyone would want to hide subjects, unless it's on a narrow screen or with deeply nested threads. In other words: I'm the wrong person to ask ;) Maybe a config which can be bound to a key? BTW: Some of my old PRs might be stale, i.e. would possibly need rework, especially everything related to "full thread", "requery". Whenever there are recent rebases it means that I'm at least still using them, such as |
... and now I noticed the real content of the question... So, deferring |
More or less the same thing yes. But I think it's important (to me) as otherwise the screen is just too busy in review conversations: Is much cleaner/more readable than I think I'd like to figure out how to change the colour/highlight of the subject too, like it does on the main search view so that we can quickly differentiate between the sender/datestamp/subject on the summary line. More for me to experiment and play with I guess. pazz, do you still use the IRC channel? or just lurk - I've asked a question there about trying to run on master, so I can't rebase these to latest yet. |
alot/widgets/thread.py
Outdated
# Hide Subjects which are replies to the parent message. | ||
# This allows threads containing multiple messages with distinct | ||
# subjects to be displayed without adding noise to the replies. | ||
if not subject.startswith(('Re:')): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And already I've hit RE: which fails on this filter of course.
Any ideas on a good way to detect that this is an actual reply (and not a separate conversation posted as an in-reply-to) are welcome.
The thing is that Just for fun: A bank which I sent an e-mail "Re: some topic" to apparantly translated "Re" into "Reklamation" (complaint) automatically and redirected the e-mail to that department... So, I think your best option to check whether e-mail 2 is a "real reply" to e-mail 1 is by checking whether e-mail 1's subject is contained in that of e-mail 2 (plus maybe a safety check on difference of length being smallish). This catches all kinds of "Re/RE/AW", and forwards typically do not set the headers, so they're not in the mix anyways. For an extra safety measure, replace the matched subject by Or let the user define a hook or regex for the match. |
Oh, I really like the 'replace' with '...' and that solves a lot of the concerns anyway, and provides the same end goal. |
99f1b2f
to
5172115
Compare
@mjg The '...' looks nice and seems to solve it so far. I still need some help getting the master branch to run before I can base this on top of 0.10 though. |
@mjg Thanks for that suggestion, it's working really well so far, and helps highlight differences in the subject from the parent quite nicely. There are a few 'exceptions' I might want to look into (mostly so far between case sensitivity of Re: vs RE: ) - but it's handling the main use cases really well. |
5172115
to
5a9ac04
Compare
Interesting. I think what I meant was slightly different, but both works. The differece is in whether you replace a match for the original subject (if it matches) or for the previous subject, or in other words: When does the meaning of
you translate this (if I'm not mistaken) into
and I was more thinking along the lines of:
I.e. keep the meaning of |
The difficulty is that I can /only/ match against a single parent. I can't match that 'all the way up'. But more or less, I'm simply replacing the parent subject in the current subject ..
To keep all prefixes we'd have to be able to know that we could selectively remove 'standard' prefixes from the match criteria, which might be reasonable to do. We could 'strip' the list of prefixes (https://en.wikipedia.org/wiki/List_of_email_subject_abbreviations) before making the match/compares? |
If I always match only the top level message summary - It would always try to replace "[PATCH 00/11] Document all the IPU3 IPA classes" which isn't actually replied to at all in the entire thread. Here's the raw subjects for the first few lines of the image above:
Which currently generates:
Note how the [libcamera-devel] is only present on patches that I received through the list, and differs to the subject of the mail that I may receive if the mail comes directly to me. It might be a race or specific to whether I was on direct CC/To as to which one gets used. I usually interpret mails that don't have the list on as being sent 'specifically' to me. |
Sure, what I meant is: Starting at root, set
As I wrote, it depends on how you actually interpret |
Aha, ok that makes it clearer what you were intending actually, thanks. I'm not yet sure how easy it would be to implement that in the widget, I'm referencing 'up' by checking the parent of each summary, rather than iterating down ... (Well, the iteration down happens when creating the Messages, but I don't think we should be trailing other message's subjects around with a Message object). |
5a9ac04
to
dc14b15
Compare
Now that I've fixed alot to run on master with my config, I've rebased this. Probably still a bit more refinement needed, but this really helps my work-load a lot. |
dc14b15
to
c4967e4
Compare
c4967e4
to
1d0f918
Compare
Provide a method to get the subject of a given message. The subject is cached by not-much in the database, and is efficient to access directly through the notmuch2.msg object. Store the subject in our Message representation so it can be used efficiently when parsing and displaying mail threads. Signed-off-by: Kieran Bingham <[email protected]> --- Fix no subject mails
Allow Message instances to be created with a reference to their parent Message object. Add a get_parent() helper to return the parent of a message, or None if it is a top level message. Signed-off-by: Kieran Bingham <[email protected]>
Provide a reference to the parent of any Message when it is initialised. Signed-off-by: Kieran Bingham <[email protected]>
Replies to a parent message are not shown to avoid filling the buffer with noisy repeating content. Signed-off-by: Kieran Bingham <[email protected]>
1d0f918
to
317f6b3
Compare
Threads that do not have a subject will cause a LookupError() when retrieving the header. Catch this exception and set the subject to a null string. Signed-off-by: Kieran Bingham <[email protected]>
317f6b3
to
f7bb7b6
Compare
Small updates here. The method of getting the subject has been simplified, as the subject headers are indexed by not-much - so from my understanding it's more efficient to simply get it when constructing the Message object, and retain it at that point. I've also picked up a fix in this series, while testing as I sent myself a mail with no subject to validate this. And that hit a failure in existing code paths. So that's included as the last patch. Open questions are, if this implementation for stripping the parent subject is satisfactory to all, and if this should be any kind of a config option... or if this should be default behaviour. |
This series tackles presenting threads where a multi-patch series is sent with a cover letter, for instance when sent with git-send-mail.
The default presentation in the thread view hides the details required to identify the patch titles:
With this development the individual patches can be seen to show their titles on the summary.
To prevent adding a lot of noise, replies do not further repeat the message title. The implemenation here so far is just to check if 'subject.startswith(('Re:')) and ignore those ones which does not seem fool-proof (and may be entirely locale dependant based upon the senders) so I'm looking for advice on a better way to implement that.
I had wondered if comparing the Subject against a parent subject, and only printing if they differ would be better, but the prefixes that get added by replies would still affect that too.