Skip to content

fix(app): confirm before disconnecting providers or removing accounts in settings - #64212

Merged
arvsrn merged 1 commit into
devfrom
settings-disconnect-confirm
Nov 16, 2026
Merged

arvsrn merged 1 commit into
devfrom
settings-disconnect-confirm

Conversation

@arvsrn

@arvsrn arvsrn commented Nov 16, 2026

Copy link
Copy Markdown
Member

Summary

Disconnect and Remove account in Settings › Providers ran on one click. Disconnect deletes every credential for the integration, and on the OpenCode Console row it drops every provider in the workspace. Both now ask first, in a dialog, the same way deleting a session does.

 Disconnect click
-  dispatch disconnect.requested
+  push DialogConfirmProviderRemoval
+    "Disconnect {provider}?"
+    Console root: "…{count} providers from {workspace} will no longer be available."
+    Cancel  → nothing
+    Disconnect → dispatch disconnect.requested

 Account menu › Remove
-  dispatch account.remove.requested
+  push DialogConfirmProviderRemoval
+    "Remove {account}?"
+    last account: "…so {provider} will be disconnected."
+    Remove → dispatch account.remove.requested (final read on confirm)

The connect dialog's own account removal already asks inline, so the two surfaces now match. No feature flag: it's a fix to a destructive action.

Evidence

  • Before: clicking Disconnect or Remove deleted the credentials straight away.
    After: a confirm dialog opens with Cancel focused; Cancel keeps the credentials, confirming removes them.
  • settings.spec.ts › "the account options rename and remove the active account" now cancels once (account stays, no DELETE /api/credential) then confirms (cred_work removed). "a disconnect that finds no stored credentials…" confirms through the dialog. Both pass locally.
  • Checked by hand in the desktop app.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none" stroke="currentColor" font-family="sans-serif" font-size="9">
  <style>
    .d{animation:d 3s ease-in-out infinite}
    @keyframes d{0%,25%{opacity:0}35%,85%{opacity:1}100%{opacity:0}}
    @media (prefers-reduced-motion:reduce){.d{animation:none;opacity:1}}
  </style>
  <rect x="8" y="10" width="110" height="20" rx="4"/>
  <text x="14" y="23" fill="currentColor" stroke="none">OpenRouter</text>
  <rect x="78" y="14" width="34" height="12" rx="3"/>
  <text x="81" y="23" fill="currentColor" stroke="none" font-size="7">Disconnect</text>
  <g class="d">
    <rect x="128" y="8" width="104" height="56" rx="6"/>
    <text x="134" y="22" fill="currentColor" stroke="none">Disconnect OpenRouter?</text>
    <rect x="152" y="44" width="32" height="13" rx="3"/>
    <text x="157" y="53" fill="currentColor" stroke="none" font-size="7">Cancel</text>
    <rect x="188" y="44" width="38" height="13" rx="3" fill="currentColor" fill-opacity="0.25"/>
    <text x="191" y="53" fill="currentColor" stroke="none" font-size="7">Disconnect</text>
  </g>
</svg>

Merge Danger

Door: two-way

Only adds a step before existing actions; reverting restores one-click behavior.

Blast Radius: small

Settings › Providers only. Any automation clicking Disconnect or Remove there now needs to confirm the dialog.

@arvsrn
arvsrn merged commit c5f18d1 into dev Nov 16, 2026
11 checks passed
@arvsrn
arvsrn deleted the settings-disconnect-confirm branch November 16, 2026 12:07

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I checked it with the app's Playwright fixtures. On the base, Disconnect runs straight away. With this PR, a Disconnect OpenRouter? dialog with Cancel/Disconnect opens first. On the PR, both updated tests in settings.spec.ts pass, along with 15 of the other 16 providers: e2e tests. The other one ('a fresh install offers the Console sign-in') failed a focus check on the first run; the base hit the same cold-start failure on its first run. Against the base app code, both updated tests fail waiting for the dialog, so they catch the old one-click behaviour. tsc -b for packages/app is clean.

Public API: unchanged (only app UI and English strings).

No blocking concerns.

Before

After

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant