Skip to content

feat: snooze permission events (5 / 15 min)#26

Merged
hiskudin merged 1 commit into
mainfrom
feat/snooze
May 1, 2026
Merged

feat: snooze permission events (5 / 15 min)#26
hiskudin merged 1 commit into
mainfrom
feat/snooze

Conversation

@hiskudin

@hiskudin hiskudin commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Defer a permission notification without resolving the underlying hook. The agent stays blocked on its FIFO; after the chosen duration, the banner re-fires so you get another chance to act on it.

How it works

  • Banner — the PERMISSION UNNotificationCategory now has three actions: `Allow`, `Snooze 5 min`, `Snooze 15 min`. macOS shows `Allow` as the primary button and collapses the rest into the chevron expansion automatically.
  • Panel — `S` snoozes the selected permission event for 5 min, `Shift+S` for 15. Footer hint appears when a permission event is selected.
  • Re-fire — same `NudgeEvent` is preserved across snooze cycles (so the panel doesn't accumulate duplicate rows). The fresh banner uses a new `UNNotificationRequest` UUID; the original event id stays in `userInfo` so click handlers resolve to the same event + FIFO.
  • Visual — snoozed rows render dimmed with a `moon.zzz` glyph; right-side timestamp swaps from "X min ago" to "snoozed in Xm".

Test plan

  • Trigger a permission notification → banner shows Allow + chevron, expansion reveals Snooze 5/15
  • Click Snooze 5 → banner dismisses; selected event in panel dims with moon icon and "snoozed in 5m"; agent stays blocked
  • Wait 5 min → fresh banner appears; clicking Allow on it approves the original FIFO
  • In the panel, press S on a selected permission event → same dimming behaviour
  • Shift+S → same but 15 min
  • Footer hint "Snooze S" appears only when a permission event is selected
  • Stop events ignore S (no FIFO to wait on)

🤖 Generated with Claude Code

Permission notifications can now be deferred without resolving the
underlying hook. The hook stays blocked on its FIFO; after the chosen
duration, the banner re-fires (fresh UNNotificationRequest) so the user
gets another chance to approve / deny.

- Banner: PERMISSION category gets two extra UNNotificationActions —
  "Snooze 5 min" and "Snooze 15 min". macOS surfaces the first action as
  the primary banner button and collapses the rest into the chevron
  expansion automatically.
- Panel: pressing S on a selected permission event snoozes 5 min,
  Shift+S snoozes 15 min. Footer surfaces the "Snooze S" hint when a
  permission event is selected.
- Visual: snoozed rows render dimmed with a moon.zzz glyph and the
  right-side timestamp swaps from "X min ago" to "snoozed in Xm".
- Identity: same NudgeEvent is preserved across snooze cycles. The
  re-fired UNNotificationRequest uses a fresh UUID (macOS replaces by
  identifier) but keeps the original event.id in userInfo so the click
  handler resolves to the same event + FIFO.
- Footer: FooterHint now uses .fixedSize() so the additional hint
  doesn't cause labels to wrap vertically letter-by-letter.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hiskudin hiskudin merged commit 761c349 into main May 1, 2026
4 checks passed
@hiskudin hiskudin deleted the feat/snooze branch May 1, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant