mirror of
https://github.com/Foundry376/Mailspring.git
synced 2026-01-17 14:25:26 +08:00
* Add implementation plan for enhanced notification system Plan covers migrating from Web Notification API to Electron's main process Notification module to enable macOS inline reply, action buttons, and Windows rich toast notifications. * Implement enhanced notification system with main process IPC Migrate from Web Notification API to Electron's main process Notification module to enable platform-specific features: - macOS: inline reply support via hasReply, action buttons - Windows: rich toast notifications via toastXml - Linux: urgency levels, persistent notifications Key changes: - Add notification-ipc.ts: Main process handlers following quickpreview-ipc.ts pattern - Update native-notifications.ts: IPC bridge with callback management for notification events - Update unread-notifications: Add "Mark as Read" and "Archive" action buttons, implement _handleNotificationAction method - Register IPC handlers in application.ts The notification system now properly forwards reply, action, click, and close events from main process back to renderer via windowManager.sendToAllWindows(). * Improve Windows toast notifications following Microsoft best practices - Add hint-maxLines="1" to sender name to prevent wrapping - Add hint-style="captionSubtle" to message snippet for visual hierarchy - Add group attribute for notification stacking per thread - Add reply text input with Send button for Windows toast - Add activationType="background" for action buttons - Create dedicated buildWindowsSummaryToastXml for multi-message notifications - Add displaySummaryNotification method for summary notifications - Update _notifyAll to use summary notification with sender names References: - https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/adaptive-interactive-toasts - https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/toast-ux-guidance * Address PR feedback: improve XML escaping, add types, consolidate helpers - Replace manual XML escaping with browser DOM APIs (XMLSerializer) to properly handle full UTF-8 range including international text - Add IIPCNotificationOptions interface for type safety in IPC calls - Consolidate sender list formatting into formatSenderList helper with proper English formatting ("X", "X and Y", "X, Y, and Z") - Remove implementation plan document (now complete) * Add icon path validation to prevent arbitrary file access Validate that notification icon paths are within allowed directories before passing them to nativeImage.createFromPath(). This prevents the renderer from potentially specifying arbitrary file paths. Allowed paths: - Application's static resources (resourcePath/static/) - System icon directories on Linux (/usr/share/icons/, etc.) - System temp directory (for converted PNG icons on Linux) Uses path.resolve() to prevent directory traversal attacks, following the same pattern as quickpreview-ipc.ts. * Remove unused notification code - Remove _macNotificationsByTag: legacy field from old node-mac-notifier implementation, never used in new IPC-based approach - Remove closeNotificationsForThread: never called; the renderer already handles notification dismissal via individual NotificationHandle.close() calls when threads are marked as read --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| account-sidebar | ||
| activity | ||
| attachments | ||
| category-mapper | ||
| category-picker | ||
| composer | ||
| composer-signature | ||
| composer-templates | ||
| contacts | ||
| custom-fonts | ||
| custom-sounds | ||
| draft-list | ||
| events | ||
| github-contact-card | ||
| link-tracking | ||
| list-unsubscribe | ||
| main-calendar | ||
| message-autoload-images | ||
| message-list | ||
| message-view-on-github | ||
| mode-switch | ||
| notifications | ||
| onboarding | ||
| open-tracking | ||
| participant-profile | ||
| personal-level-indicators | ||
| phishing-detection | ||
| preferences | ||
| remove-tracking-pixels | ||
| screenshot-mode | ||
| send-and-archive | ||
| send-later | ||
| send-reminders | ||
| system-tray | ||
| theme-picker | ||
| thread-list | ||
| thread-search | ||
| thread-sharing | ||
| thread-snooze | ||
| translation | ||
| ui-dark | ||
| ui-darkside | ||
| ui-less-is-more | ||
| ui-light | ||
| ui-taiga | ||
| ui-ubuntu | ||
| undo-redo | ||
| unread-notifications | ||