Skip to content

v0.21.16.0 feat(workspace): distinguish my workspaces from PRs I'm reviewing#68

Merged
avinashjoshi merged 5 commits into
mainfrom
distinguish-my-workspaces
Jun 25, 2026
Merged

v0.21.16.0 feat(workspace): distinguish my workspaces from PRs I'm reviewing#68
avinashjoshi merged 5 commits into
mainfrom
distinguish-my-workspaces

Conversation

@avinashjoshi

Copy link
Copy Markdown
Owner

What

The Workspaces tab now tells your own work apart from workspaces you spun up to review someone else's PR. Review rows get an owner pill (@login or generic REVIEW); your own rows stay quiet.

The key insight: you never create a fresh worktree from your own PR, so canopy new --pr <n> is itself the "I'm reviewing this" signal. Built on a single Owner field with a three-state render model and no schema migration.

How it works

  • Auto-stamp: canopy new --pr <n> stamps the PR author at creation (ghx.FetchPR now requests author). No manual step.
  • Pill: @login (known author) · REVIEW (legacy pr-sourced, author not captured) · nothing (yours). Cyan; the text carries the meaning (colorblind/no-color safe).
  • Edit: o opens a modal (set / ⌃d clear / Esc cancel; empty submit rejected). canopy set-owner <ws> <login>|--clear [--on <host>] from the CLI. Remote rows dispatch over SSH, project-pinned.
  • Sort + filter: owned rows sort above review rows per section; m toggles "mine only" with an amber N reviewing hidden banner so a filtered row never reads as missing data.
  • Wire: Owner + SourceKind thread through GlobalRow, LsJSONWorkspace, host.RemoteWorkspace, and the RemoteWorkspaceRow cache, with a drift-guard test across all of them.

Data model

Owner == ""        & SourceKind != "pr"  -> mine        (no pill)
Owner == ""        & SourceKind == "pr"  -> review      (REVIEW pill, legacy)
Owner == "<login>"                        -> reviewing   (@login pill)
Owner == reserved self-marker             -> mine        (cleared; overrides pr fallback)

Additive omitempty field — existing state.json rows read back as yours (or a legacy REVIEW row if pr-sourced) with zero render-time network calls.

Reviewed

Ran through /plan-ceo-review -> /plan-eng-review -> /plan-design-review before implementation. Codex outside-voice pass caught the GlobalRow render carrier + the on-disk cache struct, both folded in. Dogfood-tested live (the m-filter banner was added in response to that testing).

Tests

Derive logic (all 4 states), owner normalization (every reject path), legacy-row compat, creation stamping, SetOwner set/clear/not-found, the 5-struct wire drift guard, sort (incl. section isolation), the m filter + hidden-count, and the pill render. go test ./... green (20 packages); go vet clean.

Deferred (TODOS.md)

Hard-refresh (re-run all detectors + re-detect owner), search-by-owner, and the skip-self gh whoami optimization.

🤖 Generated with Claude Code

avinashjoshi and others added 5 commits June 25, 2026 11:48
…reviewing

Adds a single Workspace.Owner field (omitempty, no migration) with a
three-state render model: empty derives from SourceKind (pr-sourced ->
legacy REVIEW), a foreign login -> reviewing, the reserved self-marker ->
explicitly mine. PR-sourced workspaces auto-stamp the PR author at
creation (ghx.FetchPR now requests `author`). New SetOwner mirrors SetPin;
new `canopy set-owner <ws> <login>|--clear [--on host]` CLI verb. Owner +
SourceKind thread through all wire structs (GlobalRow, LsJSONWorkspace,
host.RemoteWorkspace, RemoteWorkspaceRow), guarded by a drift test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nner

Renders an @login / REVIEW cyan pill on review rows (text is the primary
signal; own rows stay pill-less). `o` opens a modal to set/clear the owner
(remote rows dispatch set-owner over SSH); `m` toggles a mine-only filter.
Within each host/project section, owned rows sort above review rows. The
filter shows an amber "N reviewing hidden" banner so a hidden row never
reads as missing data.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@avinashjoshi avinashjoshi merged commit b1d078a into main Jun 25, 2026
2 checks passed
@avinashjoshi avinashjoshi deleted the distinguish-my-workspaces branch June 25, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant