Skip to content
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

Proposal: More consistent filter/setter rule names #1333

Open
bynect opened this issue Apr 10, 2024 · 8 comments
Open

Proposal: More consistent filter/setter rule names #1333

bynect opened this issue Apr 10, 2024 · 8 comments
Milestone

Comments

@bynect
Copy link
Member

bynect commented Apr 10, 2024

I propose a more consistent syntax for filters and rules following the good example of match_transient/set_transient.
We can add for every notification property a match_* and a set_* value for filtering and modifying respectively.
This is much more consistent than the currently somewhat confusing names (msg_urgency/urgency, etc).

Obviously for backwards compatibility the current name will still work (as an alias for the appropriate new name).

If I get to implement this I will also probably change the rules internal representation (see #607).

If you have any ideas about this let me know 👍🏻

@bynect bynect added this to the v2.0 milestone Apr 10, 2024
@bynect
Copy link
Member Author

bynect commented Apr 10, 2024

For reference

msg_urgency & msg_urgency -> set_urgency & match_urgency
override_dbus_timeout -> set_dbus_timeout
new_icon & icon -> set_icon & match_icon
...etc

Ideally this new names can be parsed automatically as "set_"/"match_" + prop_name

@fwsmit
Copy link
Member

fwsmit commented Apr 10, 2024

Yeah, sounds good. I think it would also be good to write some documentation about this. Rules are added one by one and it might go wrong again in the future

@fwsmit
Copy link
Member

fwsmit commented Apr 10, 2024

Making it work programmatically would also be a solution to force it to be consistent

@bynect
Copy link
Member Author

bynect commented Apr 10, 2024

Making it work programmatically would also be a solution to force it to be consistent

That was the idea, like creating an enum with the rule property (urgency, color, ...) and one with actions (set, match, ...maybe we'll add more...) and programmatically parse them.

This seems like a nice qol goal for v2

@bynect
Copy link
Member Author

bynect commented Apr 11, 2024

I found that an old issue proposed the same thing #349 🤦🏻

@bynect
Copy link
Member Author

bynect commented Apr 19, 2024

I am undecided about using match_property or has_property like it was proposed in #349. Mostly for brevity and symmetry (3 letters like set).

@fwsmit @zappolowski what do you think about this ^^^^

If I could I would make a poll, but I don't think it is possible.

@fwsmit
Copy link
Member

fwsmit commented Apr 19, 2024

I'm not sure either. Making a poll is a good idea

@bynect
Copy link
Member Author

bynect commented Apr 19, 2024

I'm not sure either. Making a poll is a good idea

I made it in discussions. I don't know how much reach it will have unfortunately.
Maybe I can add a link to the poll to the website??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants