feat: add confirmation dialog to instance disconnect#33
Open
michumichifu wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reviewer's GuideAdds a confirmation dialog flow around the instance disconnect/logout action on the dashboard, reusing the shared Dialog component and wiring it to i18n, while keeping the underlying logout behavior unchanged. Sequence diagram for new instance disconnect confirmation flowsequenceDiagram
actor User
participant DashboardInstance
participant Dialog
User->>DashboardInstance: clickDisconnectButton
DashboardInstance->>DashboardInstance: setLogoutConfirmation(true)
DashboardInstance->>Dialog: render Dialog open=true
User->>Dialog: clickCancel
Dialog->>DashboardInstance: setLogoutConfirmation(false)
User->>Dialog: clickConfirmDisconnect
Dialog->>DashboardInstance: setLogoutConfirmation(false)
Dialog->>DashboardInstance: handleLogout(instance.name)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Description
Adds a confirmation dialog to the instance Disconnect (logout) action on the instance dashboard.
Today, clicking Disconnect logs the instance out immediately, with no confirmation. Because this unlinks the WhatsApp session and requires re-scanning the QR code to reconnect, an accidental click is disruptive — in a multi-instance setup it can knock a live client instance offline in one click. This PR adds a simple yes/no confirmation before the logout runs.
The implementation reuses the existing confirmation-dialog pattern already used for the user-session logout in
src/components/header.tsx(RadixDialog), so it introduces no new dependencies or components and stays consistent with the project's conventions.🔗 Related Issues
🧪 Type of Change
🧪 Testing
Test Environment
Test Cases
Test Instructions
connectionStatus === "open").Also verified locally:
npm run type-check,eslint, andprettier --checkall pass.📸 Screenshots
After
Confirmation dialog shown before the logout runs (screenshot in PR discussion).
Notes
instance.dashboard.disconnectConfirm.title/descriptionadded to all four locales (pt-BR,en-US,es-ES,fr-FR).instance.dashboard.button.disconnectlabel; the cancel button reusesbutton.cancel.Summary by Sourcery
Add a confirmation dialog before disconnecting an instance from the dashboard to prevent accidental logouts.
New Features:
Enhancements: