Skip to content

Enable Workspaces drawer without GitHub PAT for Local-only workflow #107

@knightedcodemonkey

Description

@knightedcodemonkey

Problem

Today the Workspaces entry point is effectively tied to GitHub PAT setup. This blocks a valid offline/local workflow where users want to create and switch multiple Local-only workspaces without connecting GitHub.

We want users to be able to use Workspaces immediately, even with no token, while preserving current guarantees around workspace isolation and deterministic writes.

Goal

Allow Workspaces button/drawer usage with no GitHub PAT, limited to Local scope only.

Desired behavior

  1. Workspaces button is available without PAT.
  2. Opening Workspaces with no PAT shows Local-only mode.
  3. Repository selector contains only Local option in no-PAT mode.
  4. Users can create, switch, open, and remove Local workspaces normally.
  5. No PR/repository actions become available without PAT.
  6. Local-only actions do not mutate repository-scoped fields unexpectedly.
  7. Startup/restore in no-PAT mode should select only Local candidates.
  8. Deterministic write and isolation rules remain intact.

Key constraints

  1. Keep PR metadata writes bound to successful workflow outcomes (Open PR, Push Commit, Close/verify), not form editing.
  2. Do not reintroduce cross-workspace overwrite/delete behavior.
  3. Do not use localStorage for PR context ownership.
  4. Preserve existing repository-scoped behavior once PAT is connected.

Implementation guidance

  1. Decouple Workspaces drawer enablement from PAT gating.
  2. Add an explicit no-PAT Local-only runtime mode for Workspaces logic.
  3. In no-PAT mode:
    • force repository filter to Local
    • prevent repository-scoped restore candidate selection
    • hide or disable repo-scoped actions
  4. Verify no code path in Local-only mode writes repo/base/head/pr fields unless explicitly intended for Local records.
  5. Keep identity key generation and record ordering deterministic.

Acceptance criteria

  1. With no PAT:
    • Workspaces button is visible and clickable.
    • Drawer opens and functions for Local workspaces.
    • No repository options beyond Local are shown.
  2. Creating multiple Local workspaces works and each remains isolated.
  3. Reload with no PAT restores from Local records only.
  4. Connecting PAT later restores repository-scoped UX without corrupting Local data.
  5. Full lint passes.
  6. Targeted Playwright coverage added/updated for no-PAT Local-only scenarios.

Test coverage requested

  1. No-PAT startup with mixed stored records loads Local candidate only.
  2. No-PAT create/switch/remove multiple Local workspaces.
  3. No-PAT reload preserves Local active selection deterministically.
  4. No-PAT mode does not expose PR actions or mutate repo PR fields.
  5. PAT connect after Local-only session preserves existing Local records and enables repo workflows.

Non-goals

  1. Changing PR workflow semantics.
  2. Adding legacy-browser compatibility behavior.
  3. Introducing new storage ownership outside existing IDB/localStorage boundaries.

Notes for implementation agent

Prioritize small, isolated changes in workspace gating and restore selection first, then add tests. Avoid broad refactors unless required by failing tests.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions