Repository navigation
Native macOS notifications, readable text, one alert per condition - #52
Merged
Merged
Conversation
Driga.app now posts notifications itself through UserNotifications (purego, still cgo-free), so they show Driga's name and icon and a click jumps to the item. The terminal-notifier and AppleScript paths are gone; AppleScript notifications belonged to Script Editor, which is why Show opened it. Only `driga collect` starts the Cocoa run loop; other commands and hooks are unaffected. Unbundled builds report in doctor that notifications need the app. Machine-health alerts were exempt from the seen-item guard, so an unresolved low-disk episode re-alerted every repeat interval. Health alerts now fire once per episode, coalesce per machine, and re-arm only after recovery (migration 0003). Low disk reads "Low disk space · 12.2 GB free, below 20 GB"; the inbox keeps the detail and the current `driga cleanup list --sizes` hint. Claude-Session: https://claude.ai/code/session_01T2vtcW6ihn1ywy9vxUq9a4
doctor now reads Driga's macOS notification permission without prompting and warns when it is off, pointing at System Settings. After a refusal the collector re-checks permission on the next notification, so allowing Driga later takes effect without restarting the service. Claude-Session: https://claude.ai/code/session_01T2vtcW6ihn1ywy9vxUq9a4
- Startup no longer fails when notifications are denied: only the bundle identity is required, so allowing Driga later works without a restart. - Low disk ends an episode only at 10% above the limit, and memory pressure only on a return to normal, so hovering or flapping cannot raise an alert on every crossing. - A viewer without the service no longer consumes alerts it cannot show. - Alerts queued during the permission prompt coalesce per destination. - Free space is truncated, never rounded up to the limit. - `collect` is detected after global flags; doctor's install hint uses the tap (`brew install --cask labstack/tap/driga`). Claude-Session: https://claude.ai/code/session_01T2vtcW6ihn1ywy9vxUq9a4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes three problems with desktop notifications on macOS.
1. They came from Script Editor. Notifications went out through
terminal-notifieror, when it wasn't found, AppleScript'sdisplay notification. macOS treats Script Editor as the sender of AppleScript notifications, so "Show" opened Script Editor.Driga.app now posts notifications itself through
UNUserNotificationCenter:github.com/ebitengine/puregoand itsobjcpackage. It was already in go.sum and is now a direct dependency.driga inbox jump <id>as separate arguments, with no shell. Remote items and multi-item summaries have no click target.driga collectis the only command that starts the Cocoa run loop. Every other command and hook skips AppKit; a bundleddriga --versiontakes about 9 ms.terminal-notifierand AppleScript notification paths are deleted. AppleScript remains only for terminal jumps.doctorsays notifications need Driga.app.notify-sendare unchanged.2. Raw text. Low disk now reads Low disk space · 12.2 GB free, below 20 GB. The inbox keeps the explanation, with the current
driga cleanup list --sizeshint.3. Repeats. Machine-health items skipped the seen-item guard, so an unresolved episode alerted again at every repeat interval. The 3-in-a-row case is reproduced by a regression test, which failed before the fix. Now:
Migration
0003_health_alert_once.sqlupdates the partial index without resetting delivery state.Checks:
just checkandjust racepass, and Windows and Linux vet are clean.doctor.Still to verify by hand on a Mac after release with the signed app:
https://claude.ai/code/session_01T2vtcW6ihn1ywy9vxUq9a4