sessions: use generic sign out confirmation copy#307727
Conversation
Allow the shared account sign-out action to accept dialog copy overrides so the Agents app can show a generic confirmation instead of listing extension usage. Adds a focused test for the override path while preserving the default workbench confirmation behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @TylerLeonhardtMatched files:
|
There was a problem hiding this comment.
Pull request overview
Updates the Agents (sessions) sign-out confirmation flow to use generic, Agents-specific dialog copy by routing through the shared _signOutOfAccount command and allowing that command to accept optional dialog message/detail overrides.
Changes:
- Adds optional
dialogMessage/dialogDetailoverrides to the shared workbench sign-out action’s confirmation dialog. - Updates the Agents account menu “Sign Out” action to invoke
_signOutOfAccountwith Agents-specific confirmation copy. - Adds a unit test covering both the override path and the default (extension-usage) confirmation behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/workbench/contrib/authentication/test/browser/signOutOfAccountAction.test.ts | Adds unit coverage for custom dialog override copy and default fallback copy. |
| src/vs/workbench/contrib/authentication/browser/actions/signOutOfAccountAction.ts | Extends command args to accept optional confirmation dialog message/detail overrides. |
| src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts | Routes Agents sign-out through _signOutOfAccount with Agents-specific confirmation strings. |
src/vs/workbench/contrib/authentication/browser/actions/signOutOfAccountAction.ts
Outdated
Show resolved
Hide resolved
Keep the Agents-specific sign-out confirmation flow inside the sessions account menu instead of extending the shared authentication sign-out action. This restores the core workbench auth dialog behavior and limits the copy change to the sessions app surface. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR was reimplemented so they no longer touch these lower level workbench auth implementation files. |
| const allSessions = await authenticationService.getSessions(providerId); | ||
| const sessions = allSessions.filter(session => session.account.label === accountLabel); | ||
| await Promise.all(sessions.map(session => authenticationService.removeSession(providerId, session.id))); | ||
| authenticationUsageService.removeAccountUsage(providerId, accountLabel); | ||
| authenticationAccessService.removeAllowedExtensions(providerId, accountLabel); |
There was a problem hiding this comment.
The sign-out implementation here duplicates the session-removal and cleanup logic from SignOutOfAccountAction (workbench). This increases the risk of behavior drift if the shared sign-out logic changes (e.g., additional per-account cleanup). Consider extracting the shared “remove all sessions for account + clear usage/access” logic into a common helper/command that both call, keeping only the confirmation dialog copy different in Sessions.
There was a problem hiding this comment.
cc @osortega @joshspicer @TylerLeonhardt –– would love any thoughts/opinions on this. The original PR did update workbench level logic, but I got a bit concerned about doing that (I've been generally trying to avoid touching non session files while working on updates for the app) and updated the implementation to be scoped to sessions app at the cost of some duplicated logic.
If any of you feel I should update workbench files though please let me know and I'll revert
Summary
Fixes #307465.
Updates the Agents app sign-out flow to show a generic confirmation dialog instead of referencing the GitHub Copilot Chat extension.
What Changed
Validation
npm run compile-check-ts-nativenpm run valid-layers-checknode --experimental-strip-types build/hygiene.ts src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts src/vs/workbench/contrib/authentication/browser/actions/signOutOfAccountAction.tsNotes
This will sign out '{0}' from the Agents app.