#19

OS notifications

Open1byeopened 6d ago

Problem

Rake apps can't show system notifications, such as "export finished" or "update ready". GPUI Kit's notification component is an in-app toast, not an OS notification.

Existing pieces

gpui-pre already has show_system_notification, dismiss_system_notification and on_system_notification_response. It has implementations for macOS (UNUserNotificationCenter), Windows and Linux, but not for Web. Rake's part is to integrate these, not to write platform code.

Proposal

Add a platform service that wraps the GPUI API:

  • Clicking a notification activates the app and delivers a payload the app chose, through the same path as URL activation, so routing and commands handle it.
  • Permission state is visible to the app, and denial is a normal result, not an error.
  • On Web, add an implementation using the browser Notification API, requested from a user event. Web is the one platform gpui-pre doesn't cover.
  • Document packaging requirements. macOS needs a signed bundle with an identifier, and Windows needs the app identity the installers set up. Rake's distribution pipeline already produces both.

Out of scope

  • Push notifications from a server.
  • Rich actions and inline replies. These could come later.

Done when

  • A packaged example posts a notification on macOS, Windows, Linux and Web, and clicking it reaches the app with its payload.
  • Tests cover running without permission and running unpackaged, where macOS can't show notifications.
  • Docs list each platform's requirements and limits.

Depends on

The move from GPUI CE to gpui-pre.

Activity

0

No activity yet.