Skip to content

Unified disconnect/remove connection experience across all views #566

@tnaum-ms

Description

@tnaum-ms

Problem

When a connection is removed via removeConnection, several surfaces are left in a stale state:

  • Playground: UI still shows "connected" status; next execution throws a confusing "No credentials found" error instead of transitioning to the disconnected state
  • Interactive Shell: Shell PTY remains open with a stale connection
  • Collection View: Open collection views may reference the removed connection
  • Document View: Open document views may reference the removed connection
  • Running Tasks: Any active tasks (e.g., export, schema scan) on that connection are not canceled

Currently, removeConnection clears CredentialCache and SchemaStore, but does not notify any of these surfaces.

Proposed Solution

Design a unified disconnect experience that:

  1. Notifies all active views when a connection is removed
  2. Transitions each surface to an appropriate disconnected state (not silently stale)
  3. Optionally cancels running tasks on the removed connection
  4. Considers adding an explicit "Disconnect" command separate from "Remove Connection"

This could be implemented via an event-driven approach (e.g., CredentialCache or a connection manager emitting events) or explicit cleanup calls from removeConnection.

Context

Identified during PR #508 review (Finding H1). The playground specifically has a first-class disconnected state (PlaygroundService.clearConnection()), but it is not called when the connection is removed externally.

Scope

This affects the playground, interactive shell, collection view, document view, and any other surface that holds a reference to a connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions