feat(desktop): add dismissible model download toast#1164
Conversation
This change adds a dismissible toast notification for model downloads in the desktop application. The toast is displayed when a model download is required, and the user can dismiss the toast to prevent it from showing again during the current session. The key changes are: - Add a state variable to track whether the toast has been dismissed - Check the dismissed state before showing the toast - Add a "Dismiss" button to the toast that saves the dismissed state in session storage and dismisses the toast
📝 WalkthroughWalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ModelDownloadNotification
participant sessionStorage
participant Toast
User->>ModelDownloadNotification: Component mounts
ModelDownloadNotification->>sessionStorage: Check dismissal state
alt Not dismissed
ModelDownloadNotification->>Toast: Show model download toast
end
User->>Toast: Click "Dismiss" button
Toast->>ModelDownloadNotification: onDismiss handler
ModelDownloadNotification->>sessionStorage: Set dismissal state
ModelDownloadNotification->>Toast: Dismiss toast
ModelDownloadNotification->>ModelDownloadNotification: Update isDismissed state
ModelDownloadNotification-->>Toast: Prevent future toasts this session
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{js,ts,tsx,rs}Instructions used from: Sources: 🔇 Additional comments (7)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
This change adds a dismissible toast notification for model downloads in the desktop application. The toast is displayed when a model download is required, and the user can dismiss the toast to prevent it from showing again during the current session.
The key changes are: