Skip to content

Close one notification per click on the ✕, and hold it to keep closing - #21149

Open
TripleU613 wants to merge 3 commits into
omacom:quattrofrom
TripleU613:notification-close-clicks
Open

TripleU613 wants to merge 3 commits into
omacom:quattrofrom
TripleU613:notification-close-clicks

Conversation

@TripleU613

Copy link
Copy Markdown
Contributor

What changes

Bug: clicking a notification's ✕ several times in a row opens notifications instead of closing them. It's at its worst with a pile of crash reports: each stray click runs "diagnose with AI" and opens an agent window.

Here's why:

  • A closing card stops taking clicks while it animates out, and the card behind slides up under the still pointer.
  • That card's ✕ only takes clicks once the card counts as hovered, which waits for the pointer to move or the deck to settle.
  • Cards differ in height (titles that wrap, icons), so the ✕ often isn't under the pointer at all.
  • So the next click lands on the card's body and runs its default action.

Fix (first commit): the deck now takes presses on a ✕ itself, so a close never depends on which card has caught up with the pointer. Closing a card by hand also starts a short run, 1.5 s from the last close, in which any press on the deck closes the card under it and none opens one. Outside a run, a click on a card's body opens it as before.

Enhancement (second commit):

  • Hold to close: holding the ✕ down keeps closing cards. The first close repeats after a 350 ms pause, so a click stays a single close, then each comes a little faster until you let go.
  • Bigger ✕: the ✕ grows under the pointer so it's an easier target.

The 1.5 s run is the one behaviour change outside the ✕: right after a close, a click on a card closes it rather than opening it. That's deliberate, because those clicks are almost always a burst of closes. The two commits are independent, and I'm happy to split the enhancement into its own PR.

Verification

  • test/shell.d/notifications-test.sh passes.
  • Recorded headless, rebased on quattro: a scratch copy of the shell ran in a private nested Hyprland, parked off-screen, with its own D-Bus session. A virtual pointer (zwlr_virtual_pointer_v1) clicked in it.
    • Each of 10 notifications used notify-send -A default --wait, and invoking the default action opened a terminal window. Both runs got the same input: six clicks on the top card's ✕, 140 ms apart, then a 2.6 s press-and-hold.
    • Before (quattro): 5 of 10 opened a window, and 5 closed.
    • After (this branch): 0 opened. All 10 closed during the clicks and the hold.
    • Also on this branch: with no recent close, clicking a card's body still runs its default action, and its ✕ still closes it.
    • With clicks 60 ms and 300 ms apart, the branch opened nothing either.
  • By hand: the same behaviour as a user clone on Omarchy 4.5.0, mashing the ✕ on a stack of about 20 crash notifications, plus press-and-hold. That was the 4.5.0 code, not this exact branch; this branch is the port of it to quattro, verified only by the headless runs above.

Screenshots

Same input in both. Click a card's body and it opens a terminal titled after the notification.

Before (quattro): the clicks meant for ✕ open five windows.

before

After: six clicks close six cards, then the hold clears the rest. Nothing opens.

after

MP4s: before · after

🤖 Generated with Claude Code

https://claude.ai/code/session_01H3rUWsUNFG2yjZkawc3k6X

TripleU613 and others added 2 commits December 1, 2026 11:50
Clicking the close mark several times in a row opened notifications
instead of closing them. A closing card stops taking clicks while it
animates out, and the card behind slides up under the still pointer. Its
close mark only took clicks once the card counted as hovered, and cards
of different heights put it somewhere else, so the next click landed on
the card's body and ran its default action: a crash report's "diagnose
with AI", a chat, a browser tab.

The deck now takes presses on a close mark itself, so they never depend
on which card has caught up with the pointer. Closing a card by hand
also starts a short run, 1.5 seconds from the last close, in which any
press on the deck closes the card under it and none opens one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H3rUWsUNFG2yjZkawc3k6X
Clearing a pile of notifications took a click each. Held down, the close
mark now keeps closing cards, the first after a pause so a click stays a
single close, then a little faster each time until the button comes up.
The mark also grows under the pointer, so it is an easier target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H3rUWsUNFG2yjZkawc3k6X
@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge, with a non-blocking gap in automated hold/release coverage.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking gap in automated hold/release coverage.

Findings

  1. P2 Close behavior lacks regression coverage ▶

Summary

The PR moves close presses to the notification deck, adds hold-to-close, and enlarges the close mark on hover.

  • The notification deck closes cards on repeated or held close presses.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Left press on deck] --> B{Close mark or recent close?}
  B -->|No| C[Pass press to card]
  B -->|Yes| D[Close one card]
  D --> E{Still held after 350 ms?}
  E -->|Yes| F[Keep closing faster]
  F --> G[Release or cancel stops repeats]
Loading

Reviews (2) · Last reviewed commit: "Test what a press on the notification de..." · Reviewed by Greptile

Comment thread shell/plugins/notifications/Service.qml Resolved
Greptile asked for regression coverage of the close routing and the hold
repeat. The decisions move out of the deck's MouseArea into service
functions, closeTargetFor and nextHoldInterval, which the notification
logic suite now runs: a body press opens outside a run and closes inside
one, a press between cards mid-run closes the newest live card, cards on
their way out are skipped, and a held mark speeds up to 25 ms. With the
run check removed, the suite fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H3rUWsUNFG2yjZkawc3k6X
@chessing234

Copy link
Copy Markdown
Contributor

thanks. one click on the close mark still closes that notification and does not open the card behind it. holding the mark keeps closing, and the mark grows under the pointer, in #21235. Please close this PR as superseded by #21235.

@omarchybot omarchybot added the enhancement New feature or request label Dec 2, 2026
@TripleU613

Copy link
Copy Markdown
Contributor Author

Close what?

@TripleU613

Copy link
Copy Markdown
Contributor Author

@chessing234 #21235 was closed without merging (the maintainers asked for each change on its own instead of in a bundle), so this PR stays open as the individual change for the close mark. It's mergeable on quattro and CI passes.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants