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
Added is:<flags> search predicate #2671
Added is:<flags> search predicate #2671
Conversation
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.
Looks good so far, just asking for some documentation changes for now.
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.
One thing I found while testing: if you provide multiple is:<flags>
predicates, the flags will be OR'ed over all predicates provided. Ideally, only the flags separated by commas should be OR'ed and separate predicates should be AND'ed. I believe this could be fixed by creating a separate QStringList flags
for every new is:<flags>
keyword (or by clearing the list before parsing a new predicate).
For illustration, here is an example. In the last screenshot, I would expect to only see messages that are deleted and highlighted. Instead, messages that are deleted or highlighted are shown:
@leon-richardt This is actually something I noticed and is also true for the I could fix it for all 3 like you said by creating a new predicate and appending it to the predicate list every time the keyword is parsed (instead of just once for all occurences), and that would also make the outer loop in the constructors for all predicates useless. |
I'm not convinced these are 100% comparable. Any given message can only have exactly one author and only appear in exactly one channel while it can have multiple
I think existing behavior should be changed in a separate PR. |
Right I see what you mean now, maybe it is better then to change it specifically for this predicate (and potentially others like it in the future), since there's no meaning to an AND relation for the other existing ones, and no reason to add seperate list entries for those. |
Co-authored-by: Paweł <zneix@zneix.eu>
You're right, I had it enabled - totally forgot that existed. Since it's a setting I guess it can stay this way. You don't have to change anything then I think - I just found that just a little confusing that sub messages come up when I search for highlights.
Again, you're right
Yes, I was thinking that messages having
I don't think you should change how / which flags are assigned to messages since that's just a little out of scope of this Pull Request. If anything, try to play around with the point I specified above. |
Those will be introduced in Chatterino/chatterino2#2671
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.
Tested and works as expected, looks good to me.
Thanks for your contribution!
Pull request checklist:
CHANGELOG.md
was updated, if applicableDescription
This PR adds a search predicate that allows filtering messages based on some of their flags.
Usage:
is:<flags>
where flags is a comma seperated list of one of the following currently supported options:deleted
: Checks forMessageFlag::Disabled
sub
orsubscription
: Checks forMessageFlag::Subscription
timeout
: Checks forMessageFlag::Timeout
highlighted
: Checks forMessageFlag::Highlighted
system
: Checks forMessageFlag::System
Examples:
is:deleted
would show deleted (disabled) messagesis:sub,timeout
would show messages that are either a subscription message or a timeout messageObviously if this is added I'm open to changes and additions to the current options and their naming (these are just the options that I initially thought of given the available flags), as well as changes to the phrasing of the changelog entry.
Closes #2653