feat(dashboard): add an Unlink action to session cards - #1002
Merged
Conversation
The Sessions page had no way to reach POST /sessions/:id/logout, the only lifecycle operation that tells WhatsApp anything: stop and delete release the session locally but leave the device listed under the account holder's Linked Devices on the phone. The button is labelled Unlink rather than Logout so it cannot be confused with the sidebar's own authentication logout, and it appears for exactly the states that have a live engine — the same visibility as Stop. The confirmation dialog spells out both consequences: a fresh QR scan or pairing code is needed to reconnect, and local data only goes away with a separate Delete. A 502 — session stopped locally but the unlink unconfirmed by WhatsApp — surfaces as a warning toast with retry guidance instead of a plain error. Visibility and error classification live in a pure util so they are unit-testable under the dashboard's test conventions; labels and dialog copy are localized across all twelve locales.
rmyndharis
force-pushed
the
feat/dashboard-unlink-button
branch
from
July 29, 2026 11:12
f86a430 to
f21ed55
Compare
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
Completes the logout work from #984 on the dashboard side: the Sessions page had no way to reach
POST /sessions/:id/logout, the only lifecycle operation that tells WhatsApp anything —stopanddeleterelease the session locally but leave the device listed under the account holder's Linked Devices on the phone.Unlinklucide icon, styled as a danger action. It renders for exactly the states that have a live engine (ready,initializing,connecting,qr_ready) — the same visibility as Stop, since the API rejects a logout for a session that is not started.canUnlinkSession) and error classification (classifyUnlinkError) live in a pure util (dashboard/src/utils/sessionUnlink.ts) with colocated unit tests, following the dashboard's utils-only test convention.sessions.actions.unlinkand thesessions.unlinkdialog/toast copy.docs/17session-card mock-up (which sketched this button as[Logout]) is updated, plus a CHANGELOG entry.Type of Change
Checklist
Related Issues
Relates to #984