Skip to content

feat(notifications): add actionable native alerts - #3491

Draft
setchy wants to merge 9 commits into
mainfrom
feat/actionable-native-alerts
Draft

setchy wants to merge 9 commits into
mainfrom
feat/actionable-native-alerts

Conversation

@setchy

@setchy setchy commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Move OS notification creation from the sandboxed preload to a main-process service behind typed IPC.
  • Publish one notification per new filtered notification, each with a single Mark as read action.
  • Clicking a notification body opens its target in the browser. A click that cannot be resolved, and the batch summary, show the app instead.
  • When more than five notifications arrive in one poll, publish one summary notification instead of individual ones.
  • Remove a published notification when it is read, removed with its account, or cleared by an app reset.
  • Prepare the development Electron bundle automatically so pnpm dev can exercise native notifications without a certificate.

Behavior

  • Mark as read uses the same mutation and recovery pipeline as the in-app row action.
  • There is no separate Open action: the notification body is the open affordance.
  • No grouping, style, click-behavior, or keep-visible settings in this first iteration.
  • Windows actions and clicks are delivered through the notification instance events.

Testing

  • pnpm test: 209 files, 2,049 tests passed
  • pnpm check: no lint or type errors
  • scripts/visual.sh: 12 files passed against the committed baselines
  • Signed macOS build verified manually: the single action renders inline, not behind the Options menu.

Deferred

  • Mark as done and Unsubscribe actions. Only GitHub supports them today, and a larger action set pushes the buttons behind the macOS Options menu.
  • Grouping by repository, the individual/summary style setting, the click-behavior setting, and the keep-visible setting.
  • Restoring delivered notifications after a restart, and Windows cold-start activation.
  • Click-to-reveal positioning in the notification list.

@github-actions github-actions Bot added the enhancement New feature or enhancement to existing functionality label Oct 24, 2026
@setchy
setchy force-pushed the feat/actionable-native-alerts branch from 9e98192 to 1d9bff5 Compare October 24, 2026 17:55
@setchy
setchy changed the base branch from main to refactor/settings-inbox-alerts October 24, 2026 17:55
@setchy
setchy force-pushed the feat/actionable-native-alerts branch 2 times, most recently from 71713bf to 43e64db Compare October 24, 2026 19:40
Base automatically changed from refactor/settings-inbox-alerts to main October 24, 2026 19:43
@setchy
setchy force-pushed the feat/actionable-native-alerts branch 2 times, most recently from 23adf0f to f133fb0 Compare October 24, 2026 21:31
@setchy
setchy force-pushed the feat/actionable-native-alerts branch from f133fb0 to 211f7ae Compare October 25, 2026 02:36
@setchy
setchy changed the base branch from main to refactor/settings-controls-primer October 25, 2026 02:36
@setchy
setchy force-pushed the feat/actionable-native-alerts branch 3 times, most recently from 34c218b to f698481 Compare October 25, 2026 03:32
Base automatically changed from refactor/settings-controls-primer to main October 25, 2026 03:33
@setchy
setchy force-pushed the feat/actionable-native-alerts branch 3 times, most recently from b865812 to a32756f Compare October 25, 2026 11:49
Move OS notifications into a main-process service behind typed IPC, with native actions, grouping, and list anchoring.

Keep focus scrolling animated and make the browser tests wait for the scroll to settle. Address the Sonar findings on identifier validation, optional chaining, stable string sorting, and the intentionally sequential native publish loop.
@setchy
setchy force-pushed the feat/actionable-native-alerts branch from a32756f to 0448183 Compare October 25, 2026 11:49
Resolve conflicts from the settings-controls and visual-regression refactors:

- Keep main's shared createGitifyBridgeApi helper and move the native
  notifications bridge mock into it
- Keep both NotificationRow attributes: focus tracking and exit animation
- Merge AlertSettings tests: main's control conventions plus the native
  notification style, actions, and click coverage
- Take the native notification test suite; main's tests covered the
  removed preload API
- Accept main's deletion of the Settings route snapshot
- Refresh the notification-volume visual baselines for the new Alerts rows
…e-alerts

Resolve conflicts with #3449 (drop the retired auth callback from preload),
#3523 (i18n) and #3530 (TSDoc): translate the new Alerts settings and the
native summary notification, keep the native-notification contributor notes
alongside the Translations guide, and document the new preload/shared APIs.
@setchy
setchy marked this pull request as ready for review October 29, 2026 01:53
@setchy
setchy requested a review from afonsojramos as a code owner October 29, 2026 01:53
- Use short hashed identities (max 12 chars) so Windows toasts stay within
  the 64-character tag/group limit; resolve interactions by hashing the cache.
- Windows: deliver clicks and actions only via handleActivation, which also
  fires for live notifications, so each interaction is handled once.
- Keep the summary notification until no unread notifications remain.
- Translate action button labels in the renderer and send them over IPC;
  validate label and identity lengths in the main process.
- Hide 'Keep notifications on screen' on macOS, where it has no effect.
- Keep delivered notifications on quit; handle actions on restored macOS
  notifications by opening the notification.
- Rename the INDIVIDUAL style value to 'individual'.
- Use the singular summary text for one notification.
- Read actionIndex from the event details (the positional arg is deprecated).
- Keep the click-fallback URL in the renderer instead of sending it over IPC.
- Queue interactions again while the renderer reloads.
@setchy
setchy force-pushed the feat/actionable-native-alerts branch from b4eefae to 3de7b5f Compare October 29, 2026 02:10
- Narrow NativeNotificationActionId to 'show' | 'read'
- Drop done and unsubscribe from the main-process allowlist, the renderer
  payload builder, and the OS action routing
- Update the Alerts tooltip and en locale copy to describe one action
- Update payload, main-service, and action-routing tests
Windows exposes activations as `type=action&action=<index>&tag=<identity>`,
not as the bare identity. Parse the tag, deliver live clicks and actions
through the notification instance events, and reserve handleActivation for
activations with no live notification so cold starts are revealed without
replaying the action or delivering twice.
Resolve conflicts from the zoom shortcut and notification list changes:

- Keep both the native notification events/contracts and the new ZOOM event
- Expose onZoom alongside the structured nativeNotifications bridge; the
  removed raiseNativeNotification path stays out
- Keep main's keyExtractor in the notification list mock while retaining the
  ref and onReady spies used by the positioning tests
- Assert the startup prefix for userData/ozone/whenReady and keep the native
  notification handler registration check
`pnpm dev` now prepares the development Electron bundle for native
notifications through a `predev` step. It prefers a Developer ID or Apple
Development identity when one is available, falls back to ad-hoc signing
(no certificate needed), sets NSUserNotificationAlertStyle, and skips when
the bundle is already prepared.

Replaces the manual `pnpm sign:dev` command and updates CONTRIBUTING.
- Publish one OS notification per new item with a single Mark as read action
- Keep the summary fallback above the batch cap, without action buttons
- Remove grouping, notification settings, click-behavior and focus navigation,
  restart history, and Windows cold-start activation
- Drop the list positioning and focus-intent code
- Simplify the IPC payload to id/title/subtitle/body/actionLabel
@sonarqubecloud

Copy link
Copy Markdown

@setchy setchy added this to the Release 8.0.0 milestone Oct 31, 2026
@setchy
setchy marked this pull request as draft October 31, 2026 21:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or enhancement to existing functionality

Development

Successfully merging this pull request may close these issues.

1 participant