-
Notifications
You must be signed in to change notification settings - Fork 341
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
Skip display rule option #590
Skip display rule option #590
Conversation
On my mobile, but some thoughts:
But I definitele appreciate your new PR! |
f6a883e
to
6e87503
Compare
@bebehei Ah, good point! I've updated the PR to address those points. |
👍 As I mentioned in the previous issue, perhaps making this happen implicitly if the timeout is really short could save us adding another knob. @bebehei what do you think? |
Yeah I'd be fine with Certainly can understand the desire to reduce the number of knobs. On the other hand, that would increase the number of particularly distinguished values on one of the knobs - maybe that's preferred? |
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.
Sorry, this review was lying around for a few days. I obviously forgot to click the submit button.
+1 As I mentioned in the previous issue, perhaps making this happen implicitly if the timeout is really short could save us adding another knob. @bebehei what do you think?
Well, I'd rather choose complexity over weird behavior. But actually I'd appreciate none of both 😁
The functionality is implemented as a rule and I think this just supports our main feature, the rules.
But a no merger will be: missing tests.
@bebehei Thanks for reviewing. I believe I've addressed your feedback in subsequent commits. I think it's easier to review with incremental commits, but let me know if I should squash it into one (though I think it's best to keep the revert separate). |
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.
Ok, we're getting into the corner cases now: What shall we do with notifications having a stack_tag, or qualify for stack_duplicates or have a replacement id. Skip_display behaves inconsistent.
|
||
queues_init(); | ||
queues_notification_insert(n); | ||
QUEUE_LEN_ALL(0, 0, 1); |
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.
Honestly, I'm missing another check for the signal.
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.
How do we check for the signal? Note that this code is exercising the queues, not end-to-end dbus functionality (the signal is done in dbus.c
not queues.c
). I don't see any end-to-end tests that also involve rules.
Good question. I considered this, but at the time thought it was reasonable that if a notification is being displayed, then stacking a skip_display notification atop it should continue being displayed. However, I can see it being confusing if a notification that has a skip_display rule ends up being displayed in this case. I don't think there is necessarily a right answer here, but I also don't think it's worth making the knob more complicated to allow both semantics. I can certainly try adding a commit that implements latter semantics, but I don't see a way to implement it without making the code a fair bit more complicated. |
@bebehei Ping! As far as I can tell the next steps here are:
|
This would be my turn master...bebehei:pr590. You can take the code fully. Every replacement case is covered by: Just replace it as usual, but vanish the notification right with the next update. see the docs from Lines 126 to 127 in 711b11c
Sorry, I've sent you into the wrong direction. The basics are actually testable. But in conjunction together, it's too tricky to get tested right now. |
52a1f8e
to
977a7a7
Compare
@bebehei LGTM, thanks for making those changes. They seem to work well. I've rebased atop master and pushed to my branch. I think this is ready for merge, right? |
@tsipinakis Ping! Looks like @bebehei is requesting that you review this. Thanks! |
Opps, I completely missed the notification for this, sorry for the delay! I did a review and realised halfway through that when pulling @bebehei 's tests you accidentally rolled back the commit fixing the initial mistakes. |
The signal is there. But there are no tests for it. Right now the signals aren't feasible to test. |
With 977a7a7 I don't see a NotificationClosed signal when |
Ouch, |
@tsipinakis @bebehei Ah, good catch! I've pushed a commit that fixes the problem, and have verified via |
3b409b0
to
802b1ab
Compare
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.
LGTM
My perfectionist side wants to somehow merge this setting and format = ""
into a single value but I can't come up with a reasonable way to do that.
Will merge after that small nitpick is resolved/answered (not a blocker, just curious about why it's there).
@@ -133,6 +133,9 @@ static bool queues_notification_is_finished(struct notification *n, struct dunst | |||
{ | |||
assert(n); | |||
|
|||
if (n->skip_display && !n->redisplayed) | |||
return true; |
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.
This hunk seems redundant, the notifications never see the displayed queue but skip directly from waiting to history. Was there a reason for adding this?
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.
Hmm, would need to ask @bebehei as he wrote this. It does seem redundant for the current use of queues_notification_is_finished
, but if there are future usages of it, it might be good to have this check.
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.
It may seem redundant, but actually it isn't. For the case, that an already displayed notification gets replaced, this would trigger the immediate removal.
@tsipinakis Ping! (No rush, just wanted to check if this had fallen off your radar) |
It hasn't, was just waiting for @bebehei to respond but it looks like he's busy. I'll go ahead and merge this as it's not an actual issue and as you said some redundancy is a good thing. |
Great, thanks a bunch for reviewing, y'all! |
Yeah, I had been a few days off. Thanks for merging and caring here. |
The hack described in #588 - setting
timeout = "1ms"
in a rule to skip display - doesn't always work. Sometimes I see the notification for a brief flash.There could potentially be a different workaround for this, say, skipping enqueue to the waiting list if the timeout is sufficiently low.
I've gone ahead and implemented an explicit option. This will also make things work better in the case that
sticky_history
is set tofalse
. It also means that ifDUNST_COMMAND_PAUSE
has been used, when it gets unpaused it won't need to work its way through a queue of waiting notifications with tiny timeout.