Skip to content

Add “Disconnect PR Context” action (without closing PR on GitHub) #57

@knightedcodemonkey

Description

@knightedcodemonkey

Summary
Today, leaving an active PR context appears tied to closing the PR on GitHub. This creates friction when a user only wants to stop using PR-context mode in the IDE while keeping the PR open upstream.

Problem
When a repository has active PR context:

  1. The close flow focuses on closing the PR on GitHub.
  2. There is no clear first-class action to simply detach local PR context.
  3. Users can unintentionally close real PRs when they only intended to exit local context mode.

Proposed UX
Provide an explicit “disconnect local context” path in one of two ways:

Option A: New “Disconnect” button (preferred)

  1. Add a dedicated button near “Close” and “Push”.
  2. Action clears local active PR context only.
  3. PR on GitHub remains unchanged.

Option B: Extend existing close dialog

  1. Keep current close dialog.
  2. Add two explicit actions:
  • Disconnect only
  • Close PR on GitHub
  1. Include clear copy describing side effects.

Recommendation
Start with Option B for minimal UI surface change:

  1. Reuse existing confirmation dialog.
  2. Add a secondary “Disconnect only” action.
  3. Keep existing destructive action for “Close PR on GitHub”.

Expected behavior

  1. Disconnect only:
  • Clears active PR context for selected repo in local storage.
  • Returns UI to Open PR mode.
  • Hides PR-context indicators/state.
  • Does not call GitHub close PR API.
  1. Close PR on GitHub:
  • Preserves current behavior.
  • Closes PR via API and clears local context.

Technical notes

  1. Local-only disconnect should reuse the current context-clearing logic used by the existing clear path.
  2. Ensure no accidental API call to close PR in disconnect path.
  3. Maintain current token/repo visibility behavior.

Acceptance criteria

  1. User can disconnect local PR context without closing the GitHub PR.
  2. GitHub PR remains open after disconnect-only action.
  3. UI exits Push/active-context mode and returns to Open PR mode.
  4. Existing “Close PR on GitHub” still works unchanged.
  5. E2E tests cover:
  • Disconnect-only path
  • Close-on-GitHub path
  • Correct API call expectations for each

Test ideas

  1. Start with active PR context; trigger disconnect-only; assert no PATCH/close PR request.
  2. Trigger close-on-GitHub; assert PR close API request occurs.
  3. Reload app after disconnect-only; assert no active PR context is restored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions