Problem
Our current PR context model includes disconnected plus a dedicated Disconnect button. This creates extra transition paths and persistence branches that increase complexity and contribute to state/race bugs during workspace switching.
At the same time, we now have a stricter Workspaces UX:
- Select repository scope
- Select stored/starter context
- Click Open to apply state
Given this model, Disconnect is redundant with existing local actions.
Proposal
Remove the Disconnect action and eliminate prContextState = disconnected.
Use only:
Local lifecycle behavior should be:
- Start a new context from Workspaces for repo/local initialization.
- Remove workspace from Workspaces for local deletion.
- Close PR for remote lifecycle change on GitHub.
Why
- Reduces state-machine surface area.
- Removes ambiguous local-only “disconnect” semantics.
- Aligns UI with explicit Open-driven state application.
- De-risks overwrite/merge issues caused by extra transition branches.
Scope
- Remove Disconnect button and handler wiring in PR context UI/workflows.
- Remove
disconnectActivePrContext public action path.
- Remove
disconnected from supported PR state enum/normalization.
- Remove restore/hydration conditions that special-case disconnected.
- Keep Close PR on GitHub behavior unchanged.
- Keep Workspaces “Start new context for ” behavior as explicit local initialization path.
Data migration
On load/normalize:
- Map persisted
prContextState: disconnected to inactive.
- Preserve other metadata fields as-is (
repo, head, prNumber, prTitle, tabs).
Optional follow-up:
- One-time rewrite to persist migrated state back to IDB.
Acceptance criteria
- No Disconnect control is rendered anywhere.
- No runtime path writes
prContextState = disconnected.
- Existing
disconnected records are treated as inactive on restore.
- Switching/opening workspaces works with only
active|inactive|closed.
- First-time repo init still works via Workspaces starter option + Open.
- Lint/typecheck pass.
- Playwright suite updated and green after removing disconnected scenarios.
Test updates
- Delete/replace tests for:
- “Active PR context disconnect uses local-only confirmation flow”
- “Reopening a disconnected workspace…”
- all “targetState: disconnected” integrity scenarios
- Add/adjust tests for:
- starter-context Open flow (no stored contexts)
- remove-workspace local lifecycle
- close PR + reopen behavior without disconnected branch
- cross-repo active/inactive/closed integrity
Docs updates
Update docs to remove disconnected references:
- pr-context-storage-matrix.md
- idb-workspace-state.md
Risks
- Legacy persisted records containing disconnected state.
- Assumptions in tests/helpers expecting disconnected->active restore behavior.
Rollout plan
- Implement disconnected->inactive normalization and keep backward compatibility.
- Remove Disconnect UI/action.
- Remove disconnected branches in runtime/persistence.
- Update tests/docs.
- Run full lint/build/Playwright validation.
Problem
Our current PR context model includes
disconnectedplus a dedicated Disconnect button. This creates extra transition paths and persistence branches that increase complexity and contribute to state/race bugs during workspace switching.At the same time, we now have a stricter Workspaces UX:
Given this model, Disconnect is redundant with existing local actions.
Proposal
Remove the Disconnect action and eliminate
prContextState = disconnected.Use only:
activeinactiveclosedLocal lifecycle behavior should be:
Why
Scope
disconnectActivePrContextpublic action path.disconnectedfrom supported PR state enum/normalization.Data migration
On load/normalize:
prContextState: disconnectedtoinactive.repo,head,prNumber,prTitle, tabs).Optional follow-up:
Acceptance criteria
prContextState = disconnected.disconnectedrecords are treated asinactiveon restore.active|inactive|closed.Test updates
Docs updates
Update docs to remove disconnected references:
Risks
Rollout plan