Repository navigation
fix: Showing notifications when downloads were cancelled - #3145
Conversation
…nhance notification handling - Removed the notification creation logic from the `done` event handler in the download process to streamline user experience. - Updated the notification handling in `preload.ts` to dispatch a new action for sidebar downloads when the 'Downloads' title is clicked, improving user interaction and feedback.
WalkthroughRemoved automatic creation of a user notification on download completion and changed notification click routing: clicks on "Downloads" notifications dispatch SIDE_BAR_DOWNLOADS_BUTTON_CLICKED; other clicks dispatch WEBVIEW_FOCUS_REQUESTED with the server URL and 'server' view. Changes
Sequence Diagram(s)sequenceDiagram
participant Downloader as Downloads Handler
participant Store as Redux Store
participant Notifier as Notification System
rect rgb(240,240,255)
Note over Downloader,Notifier: Previous download completion (before)
Downloader->>Notifier: create notification(title="Downloads", body=filename, subtitle=...)
Notifier->>User: show notification
Downloader->>Store: dispatch DOWNLOAD_UPDATED (state, payload)
end
rect rgb(240,255,240)
Note over Downloader,Store: New download completion (now)
Downloader->>Store: dispatch DOWNLOAD_UPDATED (item.getState(), timing/bytes/url fields)
%% no notification created
end
sequenceDiagram
participant User
participant Notifier as Notification Preload
participant Store as Redux Store
rect rgb(255,245,240)
Note over User,Notifier: Notification click handling (new)
User->>Notifier: click notification(title)
alt title == "Downloads"
Notifier->>Store: dispatch SIDE_BAR_DOWNLOADS_BUTTON_CLICKED
else
Notifier->>Store: dispatch WEBVIEW_FOCUS_REQUESTED(serverUrl, view='server')
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Changed the parameter names in the 'done' event handler from `state` to `_state` to indicate that the parameter is unused, improving code readability and consistency.
…3145) * refactor(downloads): Remove notification on download completion and enhance notification handling - Removed the notification creation logic from the `done` event handler in the download process to streamline user experience. - Updated the notification handling in `preload.ts` to dispatch a new action for sidebar downloads when the 'Downloads' title is clicked, improving user interaction and feedback. * fix(downloads): Update event handler parameters for clarity - Changed the parameter names in the 'done' event handler from `state` to `_state` to indicate that the parameter is unused, improving code readability and consistency.
…3145) * refactor(downloads): Remove notification on download completion and enhance notification handling - Removed the notification creation logic from the `done` event handler in the download process to streamline user experience. - Updated the notification handling in `preload.ts` to dispatch a new action for sidebar downloads when the 'Downloads' title is clicked, improving user interaction and feedback. * fix(downloads): Update event handler parameters for clarity - Changed the parameter names in the 'done' event handler from `state` to `_state` to indicate that the parameter is unused, improving code readability and consistency.
…3145) * refactor(downloads): Remove notification on download completion and enhance notification handling - Removed the notification creation logic from the `done` event handler in the download process to streamline user experience. - Updated the notification handling in `preload.ts` to dispatch a new action for sidebar downloads when the 'Downloads' title is clicked, improving user interaction and feedback. * fix(downloads): Update event handler parameters for clarity - Changed the parameter names in the 'done' event handler from `state` to `_state` to indicate that the parameter is unused, improving code readability and consistency.
…3145) * refactor(downloads): Remove notification on download completion and enhance notification handling - Removed the notification creation logic from the `done` event handler in the download process to streamline user experience. - Updated the notification handling in `preload.ts` to dispatch a new action for sidebar downloads when the 'Downloads' title is clicked, improving user interaction and feedback. * fix(downloads): Update event handler parameters for clarity - Changed the parameter names in the 'done' event handler from `state` to `_state` to indicate that the parameter is unused, improving code readability and consistency.
…3145) * refactor(downloads): Remove notification on download completion and enhance notification handling - Removed the notification creation logic from the `done` event handler in the download process to streamline user experience. - Updated the notification handling in `preload.ts` to dispatch a new action for sidebar downloads when the 'Downloads' title is clicked, improving user interaction and feedback. * fix(downloads): Update event handler parameters for clarity - Changed the parameter names in the 'done' event handler from `state` to `_state` to indicate that the parameter is unused, improving code readability and consistency.
…3145) * refactor(downloads): Remove notification on download completion and enhance notification handling - Removed the notification creation logic from the `done` event handler in the download process to streamline user experience. - Updated the notification handling in `preload.ts` to dispatch a new action for sidebar downloads when the 'Downloads' title is clicked, improving user interaction and feedback. * fix(downloads): Update event handler parameters for clarity - Changed the parameter names in the 'done' event handler from `state` to `_state` to indicate that the parameter is unused, improving code readability and consistency.
Remove Download Cancellation Notifications and Improve Downloads Interaction
Summary
This change removes the system notification that was displayed when downloads were cancelled, providing a cleaner user experience. Downloads that complete successfully still show a notification via the
onCompletedcallback, but cancelled downloads no longer trigger an automatic notification.The change also improves how the Downloads button in the sidebar integrates with the notification system, ensuring that clicking on any Downloads-related notification dispatches the
SIDE_BAR_DOWNLOADS_BUTTON_CLICKEDaction for consistent interaction patterns.Context/Background
Previously, the application displayed system notifications for both completed and cancelled downloads in the
doneevent handler. Completed downloads also trigger a separate notification via theonCompletedcallback inelectronDl, resulting in duplicate notifications for successful downloads.By removing the notification from the
doneevent handler, cancelled downloads no longer show an automatic notification, while completed downloads still receive user feedback through theonCompletednotification. This provides a more intentional experience—users are alerted when files successfully complete but are not interrupted by notifications for user-cancelled downloads.Changes Made
Remove Download Cancellation Notification
createNotificationcall from the downloaddoneevent handler insrc/downloads/main.tsonCompletedinelectronDl)DOWNLOAD_UPDATED) continues to be dispatched, keeping the downloads list in the UI currentEnhance Download Access Through Sidebar Button
src/notifications/preload.tsto dispatch theSIDE_BAR_DOWNLOADS_BUTTON_CLICKEDaction when a notification with the title "Downloads" is clickedState Management Improvements
SIDE_BAR_DOWNLOADS_BUTTON_CLICKEDwhich navigates to the Downloads viewWEBVIEW_FOCUS_REQUESTEDbehavior is maintained, preserving compatibility with server notificationsTesting
Verify Completed Downloads Still Show Notifications
Verify Cancelled Downloads No Longer Show Notifications
Verify Downloads List Remains Updated
Verify Sidebar Downloads Button Interaction
Verify Other Notifications Still Work
References
src/ui/components/SideBar/index.tsxsrc/downloads/actions.tssrc/ui/actions.tssrc/notifications/preload.tshttps://rocketchat.atlassian.net/browse/SUP-923
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.