RealRaven2000 / quickFilters

Thunderbird Add-on: quickFilters
http://quickfilters.quickfolders.org/
Other
49 stars 11 forks source link

Query: example request (workaround for missing combined AND / OR (all and any condition) #61

Open MichaelTiernan opened 3 years ago

MichaelTiernan commented 3 years ago

I looked but might have missed it. Is there a better support channel than opening an 'issue'? (I always feel like it's a complaint.)

The reason for that question is I'm looking to see if I can figure out or find examples to implement a bit of logic to do compound decisions sort of like:
(condition) and (condition OR condition) then [action(s)]
or (condition) and NOT (condition) and (condition OR condition) then [action(s)]

I've considered using a "remove tag" option to prepare the choices but that doesn't exist. So, I thought I'd ask.

Of course, I may be asking too much from the tool. However, asking is the first step. :)

Thanks for your time and software!

RealRaven2000 commented 3 years ago

Thanks for the question. yeah the problem of combining AND + OR in the logic is something that has been long requested from the Thunderbird Core developers, unfortunately it is devilishly difficult. Fun fact: the underlying engine supports it, but building a UI for it (that a mere mortal can use and understand) turns out to be the biggest problem here.

If you're interested in the nitty gritty, check out:

https://bugzilla.mozilla.org/show_bug.cgi?id=297852

As one workaround I suggested "nesting filters" in which you would build a "subcondition" with AND and then use that as a search term with the other operator (OR): https://bugzilla.mozilla.org/attachment.cgi?id=720376

(or the other way around)

This one wouldn't be as difficult to build in a UI. But I think your workaround with tags (first tag based on a number of conditions with OR), then build a filter that uses the tag as a condition for combining other search terms with AND. The "not" condition is pretty much already supported by the existing operands.

MichaelTiernan commented 3 years ago

I understand and thanks for the response.

I'll keep experimenting but just to continue the discussion for clarification and enlightenment of those who are curious (and in an effort to make sure I understand the problem fully.

My problem has always been (using the subcondition approach) was that the test conditions usually read like (conditionA or conditionB or conditionC) AND conditionD where conditionD is the results of the previous test and now marked by a tag.

The problem is the initial set of "ORs" combined with the initial "AND".

Example: (Not real world cases.)

Filter 1:

if (from:github.com OR from:gitlab.com OR from:github.mycompany.com)
then
 tag:'Software Projects'
end if

Filter 2:

if (tag:'Software Projects'
  AND
    (from:'github.com' OR subject:'*bug report*' OR subject:'*suggestion*')
  )
 then
    tag:'Pubic Project Related'
    move:'Personal/Projects/Inbox'
end if

Filter 8:

if (tag:'Software Projects'
  AND
    (from:'github.mycompany.com' 
       OR subject:'*field report*' 
       OR subject:'*patch applied*'
       OR subject:'*checkin*')
  )
 then
    tag:'Private Project Related'
    tag:'Attention'
    move:'Project gumby traffic'
end if
RealRaven2000 commented 2 years ago

@MichaelTiernan There is currently development work done on this area in the Thunderbird Clone Betterbird:

https://github.com/Betterbird/thunderbird-patches/issues/35

it is very likely that they might ship this with their next version BB102. It might also end upstream (in Thunderbird), but also likely that it's not going to be shipped this year there but only next year! We should definitely install Betterbird and see if might actually be superior in this and other areas; it is the most up-to-date fork for Thunderbird that I know of!

Betterbird commented 2 years ago

We'll ship it in BB 91 soon, hopefully next month in BB 91.9.0.

RealRaven2000 commented 2 years ago

We'll ship it in BB 91 soon, hopefully next month in BB 91.9.0.

I seriously need to get back into videos, so I will definitely shout that one out when I do my next quickFilters video!

RealRaven2000 commented 2 years ago

I am already testing a Betterbird beta from @Betterbird :

https://bugzilla.mozilla.org/show_bug.cgi?id=297852#c67

attachment