Skip to content

feat(space): add a Space layer above projects - #1

Merged
EgoSay merged 43 commits into
feat-uifrom
feat-workspace
Sep 22, 2026
Merged

EgoSay merged 43 commits into
feat-uifrom
feat-workspace

Conversation

@EgoSay

@EgoSay EgoSay commented Sep 22, 2026

Copy link
Copy Markdown
Owner

ELI5

Orca already has projects and worktrees. This adds one level above them: a Space (空间) is a named selection of projects, like "writing" or "work". Switching a Space narrows the sidebar to that set of projects and takes you to the worktree you last used there. A project can belong to several Spaces, and Spaces never move or own anything.

What Changed

Hierarchy becomes Space → Project → Worktree → Tab. Spaces are client-only; nothing new crosses the remote wire except the optional activeSpaceId UI field.

  • Data + persistence: Space { id, name, icon, color, memberIds, sortOrder } with SpaceMemberId = project:<id> | repo:<id>; PersistedState.spaces, PersistedUIState.activeSpaceId; load-time repair (normalize, no member pruning), main-side SpacePersistenceOperations, spaces:* IPC and preload SpacesApi. Removing a repo strips exactly its member id from every Space.
  • Store: spaces slice with activateSpace (persists activeSpaceId, lands on the most-recently-visited member worktree, host-qualified), memoized selectors (selectActiveSpaceRepoIds, undefined ≡ all), spacesHydrated as the capability flag so the web client's fallback API never mounts Space chrome.
  • Sidebar visibility: worktree and folder-workspace rows filter by the active Space; the current worktree stays visible as a guest row when it is outside the Space; empty state with "Manage projects…" / "Show all".
  • Surfaces: bottom-left SpaceSwitcher with create/manage sheets; drag a project header onto the switcher to add it; project context menu "Remove from space"; titlebar path bar (Space › Project › Worktree) with sibling pickers; keybindings space.picker (DoubleTap+Ctrl) and space.selectByIndex (macOS Mod+Alt+digit) with hints derived from the keybinding table; two-finger horizontal swipe on the sidebar (yields to horizontally scrollable descendants, honors reduced motion).
  • Cmd+J: opens scoped to the active Space (seed collapses into one "Space: X" chip), empty-query rows group by project only inside a Space, a typed query searches every Space.
  • New-workspace composer: project combobox sections by Space (<space> / Other projects / Folders); a project added while a Space is active auto-joins it.
  • Docs: ## Spaces in docs/site/content/docs/model/worktrees.mdx, quick-open.mdx note, plus directory CLAUDE.md maps and file headers for the touched modules.

Not in this PR (recorded in the design doc): Space › Project two-level grouping under "All" in Cmd+J, per-row Space chip, "unassigned · N" sidebar fold, undo toasts. Folder-only project groups cannot join a Space yet.

Why

Users who work across several unrelated areas (writing, several client codebases) currently see every project in one sidebar. A Space is a view over projects, not a container, so switching is cheap, membership is many-to-many, and nothing about worktrees, tabs, sessions, or the host wire changes. Deriving visibility from activeSpaceId at render time keeps a single source of truth and makes "All" the zero-cost default.

Linked Issue

No tracking issue. Design and plan live in docs/superpowers/specs/2026-09-06-orca-space-design.md and docs/superpowers/plans/2026-09-06-orca-space.md (local, git-ignored under docs/**).

Fixes #

Visual Proof

Not attached yet. Surfaces to capture before/after: bottom-left sidebar toolbar (switcher), titlebar path bar, sidebar filtered to a Space with a guest row, Cmd+J "Space: X" chip, composer sections, empty-Space state.

Testing

Verified on macOS (dev instance, manual walkthrough of create/switch/drag/remove/Cmd+J/swipe/keybindings; Relay pairing checked separately). Automated checks run locally without pnpm (launcher broken on this machine):

node config/scripts/run-typecheck-projects-in-parallel.mjs          # exit 0 (node, cli, web)
node config/scripts/check-changed-code-quality.mjs                  # 0 findings / 138 changed files
npx vitest run --config config/vitest.config.ts src/shared src/main/persistence src/main/ipc/repos \
  src/renderer/src/store src/renderer/src/components/sidebar src/renderer/src/components/cmd-j \
  src/renderer/src/components/new-workspace src/renderer/src/app-shell src/renderer/src/hooks
                                                                    # 1597 files / 15462 tests passed
npx vitest run --config config/vitest.config.ts                     # 8040 files; 15 files fail, all environmental
                                                                    # (release tags, build-relay, sqlite lock, git reftable),
                                                                    # none in areas this branch touches

Linux and Windows not exercised locally; keybinding defaults are platform-gated (space.selectByIndex is darwin-only) and no metaKey is hardcoded. SSH: worktree ids are host-qualified in landing, titlebar crumb, and Cmd+J. pnpm build not run locally.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Implemented with Claude Code (Claude Fable 5.1) driving per-task implementer and reviewer subagents; design decisions and manual testing by the author.

Review

Each task had a spec-compliance and code-quality review; a whole-branch review followed by one fix wave and a scoped re-review closed all Critical/Important findings.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: no new network surface; IPC is local-only.
  • Cross-platform: shortcuts use platformBindings; swipe uses wheel deltas only.
  • Remote SSH: member ids and landing use host-qualified worktree keys; multi-host projects keep membership while any host copy survives.
  • Mobile/web: spacesHydrated gates every Space surface; the fallback proxy API is tolerated.
  • Backwards compatibility: old profiles load with spaces: []; older builds ignore the new keys; en-runtime-required.json untouched.
  • Performance: Space repo-id sets are memoized on input identity; row renderers receive plain data.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

https://claude.ai/code/session_018yQbRprAAUdma1opG2N1Ru

resolveEndDragOutcome checked externalTargetId for truthiness, so
releasing over the trigger ('' is falsy) fell through to the stale
latestDropIndex and committed a reorder instead of doing nothing.

Claude-Session: https://claude.ai/code/session_018yQbRprAAUdma1opG2N1Ru
@EgoSay
EgoSay merged commit 47876ba into feat-ui Sep 22, 2026
EgoSay pushed a commit that referenced this pull request Sep 22, 2026
…eeds You" (stablyai#21389)

* fix(agent-status): stop an auto-reviewed Codex approval reading as "Needs You"

Codex runs its PermissionRequest hook as decider #1, ahead of both its own
review agent and the user, so the event means "a decision is being made", not
"a human is blocked". Under the "Approve for me" posture the review agent
resolves it seconds later, so every gated tool call drove the pane from Working
to Needs You and back, plus a desktop notification each time.

The execution host now reads the turn's approvals_reviewer off the rollout it
already tails for subagent reconciliation, and keeps a reviewer-owned approval
as working. Positive evidence only: an absent field, an older rollout, or an
unreadable file all still raise the wait, so this can never hide a real prompt.

Splits the incremental rollout JSONL cursor out of the subagent transcript
module, which the new reader pushed over the file-length cap.

* fix(agent-status): avoid stale Codex approval ownership

* fix(agent-status): reconcile Codex child approval ownership

* perf(agent-status): avoid reads for Codex child activity

* fix(agent-status): scope Codex reviewer ownership by transcript
EgoSay pushed a commit that referenced this pull request Sep 22, 2026
…ds (stablyai#21844)

* refactor(agent-status): drop two superseded Codex attention workarounds

Codex fires its PermissionRequest hook as decider #1, before its own
auto-reviewer and before the user, so the event never meant "a human is
blocked". stablyai#21389 fixed that at the source: the execution host reads the
turn's approvals_reviewer from the rollout at write time and keeps a
reviewer-owned approval in `working`.

Two older reader-side workarounds for the same bug are now redundant.

The launch-argument suppressor guessed auto-approve mode by string-matching
the launch args, then dropped the status row in the reader. It only matched
Codex's bypass flag, and under that flag Codex's approval policy is `Never`,
which takes the Skip path and fires no PermissionRequest at all. When the
user turns on "Approve for me" inside a live session the args never change,
so it never fired for the actually-reported case either.

The Codex-only 1.5s notification quiet window could not do its job: measured
auto-reviews take 3-20s and a human can answer in under a second, so no
fixed constant separates them. Its deferred callback also re-checked
liveness and returned without notifying, so a genuine prompt whose pane went
non-live inside the window was dropped rather than delayed. Codex now
notifies synchronously like every other agent.

Also types the coordinator's completion state from the controller's exported
CompletionState instead of asserting each field, which the changed-lines
casting gate required once those lines moved.

* fix(agent-status): settle transient process-exit evidence
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