ReviewOS

also looking at this

craft-native/craft

feat(notifications): make the banner answerable — clicks, buttons, and a crash

#74
Merged glennmichael123 wants to merge feat/notification-actions into main
8 files +942 -17

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

packages/zig/src/bridge_notification.zigmodified+10-1
Changes to packages/zig/src/bridge_notification.zig
@@ -950,13 +950,22 @@ fn ensureCategory(actions: []const notification_actions.Action, id_buf: []u8) ?[
950950 *const fn (objc.id, objc.SEL, objc.id, objc.id, objc.id, c_ulong) callconv(.c) objc.id,
951951 @ptrCast(&objc.objc_msgSend),
952952 );
953 // UNNotificationCategoryOptionCustomDismissAction.
954 //
955 // Without it macOS handles a swipe-away itself and never delivers
956 // `UNNotificationDismissActionIdentifier` to the delegate, which makes the
957 // `.dismissed` arm of `handleNotificationResponse` unreachable — the
958 // notification would simply vanish and the page would hear nothing. An app
959 // waiting on Approve/Deny has to be told the banner was dismissed, or it
960 // waits for an answer that is never coming.
961 const options: c_ulong = 1 << 0;
953962 const category = makeCategory(
954963 UNNotificationCategory,
955964 macos_mod.sel("categoryWithIdentifier:actions:intentIdentifiers:options:"),
956965 ns_category_id,
957966 action_array,
958967 empty,
959 0,
968 options,
960969 );
961970 if (@intFromPtr(category) == 0) return null;
962971