One channel for every notification: the notch, or a banner - #326
rafaelbarea wants to merge 1 commit into
Conversation
Notifications came from two places with no choice about either: a session
ending opened the notch, a limit event showed the notch's card with a banner
as fallback, and a threshold crossing was always a banner. Someone on a
second display, or with the notch hidden, missed the first two; someone who
chose the notch to keep Notification Center empty still got the third.
Settings › Notifications now opens with the channel: In the notch, or Mac
notifications. Which events notify stays a switch per event. On the Mac
channel a session ending becomes a banner ("… finished", "… is waiting on
you"), and limit events go straight to a banner. On the notch channel a
threshold crossing becomes a card beside the notch, with the banner kept
only for a notch that cannot show it. The notch is the default, because it
is what every earlier version did.
A Send a test button shows one on whichever channel is chosen; when banners
are switched off for Codenotch in System Settings it opens that pane, since
a test that shows nothing and says nothing reads as broken. A notification
center delegate presents banners while Codenotch is frontmost, which is
exactly when the test button is clicked. Permission is asked when the Mac
channel is chosen, not on the first event, and never of someone who keeps
to the notch.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks @rafaelbarea — one preference that decides where a notification goes is a sensible idea, and the "Send a test" button is the right affordance for it. One thing to change:
Smaller: You'll want a rebase — #327 is merged, and it changes |
What
Notifications came from two places with no choice about either: a session ending opened the notch, a limit event showed the notch's card with a banner as fallback, and a threshold crossing was always a banner. Someone on a second display, or with the notch hidden, missed the first two; someone who chose the notch to keep Notification Center empty still got the third.
Settings › Notifications now opens with Where to notify: In the notch or Mac notifications. One choice for all of them; which events notify stays a switch per event, exactly as today.
UsageAlertNotifications; threshold crossings stay banners.UsageAlertEventgains optionalnoticeTitle/Subtitle/StatussoUsageResetCardcan show words that are not a reset's). The banner remains the fallback for a notch that cannot show the card.UNUserNotificationCenterDelegatepresents banners while Codenotch is frontmost (macOS otherwise delivers an app's own notifications quietly to the list, which is why a test from the Settings window never showed).Files
Sources/Model/NotificationChannel.swift(new): the enum and the Mac side (presenter, permission, test, session banners).Preferences.notificationChannel, stored asnotificationChannel.AppDelegate: routing inannounceCompletions,announceUsageReset,announceUsageLimit; newannounceThresholdandsendTestNotification.ThresholdAlertcarries the provider glyph so the card can draw it.Tests
NotificationChannelPreferenceTests: the notch is the default, the choice survives a relaunch, every channel has a title and explanation.make test: 1737 tests, 0 failures.🤖 Generated with Claude Code