You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(source-control): open a folder repo card's Git Graph in the folder workspace - #49629
In a folder workspace, each repo card in Source Control has a Graph button. Clicking it opened the Git Graph inside a hidden child workspace, so it looked like nothing happened. Now the graph opens where you clicked, in the folder's own tabs. Diffs you open from that graph also show up in the folder.
What Changed
Before: the Graph button (repo card header) and the Graph item (scope menu) on a folder repo card called openGitGraph(childWorktreeId). The tab went into unifiedTabsByWorktree[childId], which the folder workspace never shows.
After: the tab opens in the folder workspace, one Git Graph tab per repo card. It still reads the child worktree's history.
How it works:
openGitGraph(worktreeId, resolveTargetGroupId?, placementWorkspaceId = worktreeId) passes the placement to both the reopen path (openWorkspaceEditorItem) and openFile.
panel-ready.tsx and change-scope-bar.tsx pass useSourceControlScope()?.placementWorkspaceId. The scope is null outside folder sections, so non-folder worktrees behave exactly as before.
openWorkspaceEditorItem used to treat a git-graph tab as one per workspace, with the fixed id ${workspace}::git-graph. A graph file shown outside its own worktree now reuses only a tab for that same file and gets a normal tab id. Without this, the second repo card's Graph would activate the first repo's graph.
GitGraphTab works out its workspace from its tab id (editorTabWorkspace, the same lookup EditorFileTab uses) and passes it to useGitHistoryCommitActions. Commit diffs opened from a folder-placed graph (double-click, Open diff, a file row in commit details) therefore also land in the folder. The editor pane has no source control scope provider, so before this they fell back to the child.
Why
Row and note diffs already pass placementWorkspaceId from the source control scope (use-row-opening.ts, use-note-opening.ts). Graph was the one entry point that didn't. We follow that existing pattern instead of switching the user to the child worktree, which would pull them out of the folder view they're working in.
Reported by @EvilArthas. Original fix by @TuanNancy in #49629; final version reworked during the bug bash. It now also handles several repo cards in one folder and folder-placed commit diffs.
Visual Proof
N/A. No visual capture was recorded for this fix: the local machine can't be used for Electron runs, and no capture exists from the remote runner. The change only affects which workspace's tab set receives the tab, and the store-level tests below check this against the real editor and tabs slices.
Testing
Repro: in a folder workspace with a child worktree (--parent-worktree), open Source Control and click Graph on the repo card. On main, the tab is created under unifiedTabsByWorktree[childId] and nothing visible happens.
New git-graph-tab.test.ts uses the real editor and tabs store with two child worktrees under folder:F.
It opens CHILD, then OTHER, then CHILD again. The folder gets exactly one graph tab per repo, the child's tab set stays empty, and reopening activates CHILD's tab.
A graph already open in the child, then opened from the folder, shares one OpenFile, and each tab resolves to its own workspace.
use-git-history-commit-actions.test.tsx: a folder-placed graph opens both the all-files commit diff and a single commit file with placementWorkspaceId: 'folder:F'.
Fails on main: with the source files reverted to main and the new tests kept, all 3 new tests fail. With only the openGitGraph change (and workspace-editor-item.ts reverted), the second repo's graph collapses onto the first.
Passes: vitest on git-graph-tab, use-git-history-commit-actions, change-scope-bar and git-graph-open-button passes, 28/28. Wider source-control, editor-tabs and graph consumer suites passed during review.
Static checks: oxlint (--deny-warnings, anti-slop and code-quality configs), oxfmt --check, ast-grep and the changed-code quality gate are clean on all 9 files.
Platforms: the logic is renderer-only store placement with no OS-specific paths or shortcuts. Tested with unit tests on macOS.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
There is no slowdown on any hot path. All work runs on a click, apart from one cached selector.
Graph tab selector:GitGraphTab adds one zustand selector, which is a hit in the shared WeakMap placement index plus a Map.get. It costs 0.014 us/op with 50 tabs and 0.019 us/op with 20k tabs. The index rebuilds only when unifiedTabsByWorktree changes, and EditorFileTab already builds and shares it, so this adds no rebuilds.
Graph open (click only): a graph open adds one openFiles.some scan. It costs 0.18 us with 50 open files and 60 us with 20k files (adversarial). Non-graph opens short-circuit on contentType === 'git-graph'.
There is no new I/O, subprocess, IPC, polling or subscription.
Risk
Level: Low.
Riskiest part: the crossWorkspace branch in openWorkspaceEditorItem. It applies only to git-graph content shown outside its own worktree. If it went wrong, a folder's Graph click would activate the wrong repo's graph tab.
Unchanged: non-folder worktrees, cmd-J, and SSH/WSL routing, which still comes from the child worktree through gitGraphScope(worktreeId).
Back out: a plain revert. No persisted data or settings formats change.
Review
Reviewed in two rounds during the bug bash. The second round added the folder-placed commit-diff fix and a typed test fixture.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
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)
The source-control graph actions pass the scope’s placement workspace ID to openGitGraph. The graph opener uses that ID to find, reopen, or open a Git Graph tab. The editor passes the tab’s workspace ID to commit-diff actions. The worktree ID remains in use for repository and tab operations.
Severity of issue fixed: Medium
Merge Risk: Low · up to 4033a
Git Graph now opens in the workspace that shows the Source Control panel, and each child repository gets its own graph tab there. Two minor edge cases remain: a split-open is ignored when the graph is already open in the child workspace, and a pending diff load may still open after the folder's graph tab has been closed. Neither blocks the main flow, so the change is low risk to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Linked Issues check
Issue #49597 requires that Graph in a folder-workspace repo card opens Git Graph where the user is (the folder workspace), or switches to the child worktree. Earlier review of the openGitGraph path (s…
Out of Scope Changes check
The new changes since the previous review are tied to folder-placed Git Graph tabs. The commit message and the new test in use-git-history-commit-actions.test.tsx describe this follow-on behavior. The…
Title check
The title is specific and matches the main change. It fixes folder repo cards so Git Graph opens in the folder workspace instead of a hidden child worktree. The title uses the conventional commit form…
Description check
The description follows the repository template closely. It includes ELI5, What Changed, Why, Linked Issue (Fixes #49597), Visual Proof (N/A with a reason), Testing, Performance, Risk with level, AI D…
Full details: Linked Issues check
Explanation
Issue #49597 requires that Graph in a folder-workspace repo card opens Git Graph where the user is (the folder workspace), or switches to the child worktree. Earlier review of the openGitGraph path (src/renderer/src/lib/source-control/graph/git-graph-tab.ts) found that it accepts placementWorkspaceId, uses it as the placement for the existing tab lookup and for openFile, and keeps worktreeId as the child worktree for history. panel-ready.tsx and change-scope-bar.tsx pass the scope placement. The changes since the previous review add cross-workspace graph reuse in workspace-editor-item.ts, placement of commit-diff opens through use-git-history-commit-actions.ts, and tabId-based workspace lookup in GitGraphTab. These support the same objective: a folder-placed graph keeps its commit diffs in the folder workspace. I inspected workspace-editor-item.ts directly. The core #49597 path was not re-read at head in this review, so it relies on the previous evidence. No automated test covers the UI wiring; the issue does not require one. Manual or visual verification was not performed.
Full details: Out of Scope Changes check
Explanation
The new changes since the previous review are tied to folder-placed Git Graph tabs. The commit message and the new test in use-git-history-commit-actions.test.tsx describe this follow-on behavior. The workspace-editor-item.ts change applies only when a git-graph file is already open in a different worktree (crossWorkspace). In that case it reuses a graph tab only when entityId matches and skips the fixed tab ID. In the normal same-worktree case the condition is false and the previous behavior is kept. The PR description does not describe these store and reuse changes, and its claim that non-folder workspaces behave exactly as before is not fully confirmed for this shared path. This is a documentation and verification gap, not an unrelated change.
Full details: Title check
Explanation
The title is specific and matches the main change. It fixes folder repo cards so Git Graph opens in the folder workspace instead of a hidden child worktree. The title uses the conventional commit form and follows the 'fix(scope): summary' pattern. It is 80 characters, which is long but within a typical limit for conventional titles.
Full details: Description check
Explanation
The description follows the repository template closely. It includes ELI5, What Changed, Why, Linked Issue (Fixes #49597), Visual Proof (N/A with a reason), Testing, Performance, Risk with level, AI Disclosure section left as template, Review, upstream boundary checkbox, Notes, and Checklist. The Performance section gives measured numbers and reasoning. The Risk section names the riskiest branch and back-out path. The Visual Proof N/A reason is given. The Testing section lists the new tests and platform coverage. The main gaps are that the manual testing box is unchecked and the final lint/typecheck/test/build checkbox is unchecked, which the template allows if CI covers them. The AI Disclosure section was left as template text, and the 'Level' field is filled in. Overall the description is mostly complete.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Heavy lift
Keep graph reuse specific to the requested child worktree.
If folder workspace P already contains child A's graph, clicking Graph for child B selects A's tab here. id becomes A's entityId. The existing-file branch then activates A's graph and returns, so the user still sees A's history.
Match the graph to the requested repository, not only contentType. Update openWorkspaceEditorItem as well: its repository-blind early return and workspace-only fixed tab ID also prevent distinct child graphs in P. Repeated opens for the same child must still reuse that child's graph.
…r workspace
In a folder workspace, the Graph button on a child worktree's repo card
created the Git Graph tab in the hidden child worktree's tab set, so
nothing visible happened. openGitGraph now takes the source control
scope's placement workspace, so the tab opens in the folder workspace
while still reading the child worktree's history. A folder can show one
graph tab per repo card, and commit diffs opened from a folder-placed
graph also land in the folder workspace.
Fixesstablyai#49597
Co-authored-by: VNATdev-ops <[email protected]>
nwparker
changed the title
fix(source-control): place Git Graph tab in the visible scope
fix(source-control): open a folder repo card's Git Graph in the folder workspace
Nov 26, 2026
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Check whether the requesting graph tab remains open. · git-graph-tab.tsx:107
src/renderer/src/components/editor/git-graph/git-graph-tab.tsx:107 Minor · Functional Correctness · Quick win
Check whether the requesting graph tab remains open.
If the child graph and folder graph share an OpenFile, start a folder diff load and close only the folder graph before the load completes. The child graph retains the shared file, so this predicate returns true. The pending action then opens a folder diff after its requesting view has closed.
Check the originating tabId in the unified tabs store instead. A hidden but still-open tab must continue to pass the check.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: efe1cfd8-663c-4b36-94c6-4461af7702f7
Commits
Reviewing files that changed from the base of the PR and between 72b94cf and 4033aa9.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Resolve the split target when creating a second workspace view.
If the child graph is already open but the folder graph is not, this branch creates a new folder tab without calling resolveTargetGroupId. A split-open therefore opens the graph in an existing group.
Skip the resolver only when the placement workspace already contains the matching graph tab. Otherwise, pass the resolved target group to openWorkspaceEditorItem.
The reason will be displayed to describe this comment to others. Learn more.
Addressed in follow-up PR #50017. The reuse path now passes the lazily resolved target group unless the matching graph tab is already in the placement workspace. The merged commit already addressed the companion finding about repository-specific reuse via crossWorkspace matching in openWorkspaceEditorItem.
@TuanNancy The patch in #50017 passes the target group as described. The PR is still open, and I could not read its branch source to verify the full path. I’m not marking the finding as addressed yet.
If you found this review helpful, would you consider giving us a shout-out on X?
CI note: the only failing job is test shard node 24 4/24, in src/main/runtime/rpc/methods/orchestration/structured-workers/structured-worker-slow-start.test.ts ("stops reading as starting once the ceiling fails a start whose acquire never returns"). It expected starting but observed pending. That file and its dependencies are not touched by this PR; the other 23 shards plus typecheck, ratchets, code quality and localization passed. Locally pnpm check:changed passed 32/32. I cannot rerun the failed job without repo admin rights, so a maintainer rerun would be appreciated.
Merges stablyai/orca 7030f25 (320 commits) into fork main 3e499a0.
Conflict resolutions:
- Antigravity usage (stablyai#50137): upstream stops reading agy usage for account
safety. Carried into the fork's per-account status bar: dropped the
Antigravity usage menu, accounts prop and checked-item setup flag from
AccountUsageDetailsMenu, StatusBarUsageArea, the controller and provider
visibility (and its fork-retained test); the omp slot stays, including in
the rate-limit full cycle and the usage-tracking doc.
- Lazy Zod schemas (stablyai#49897): took upstream's lazyZodSchema wrapping and kept
the fork's ProjectGroupUpdate.claudeAccountId, the omp status-bar item and
_ompStatusBarDefaultAdded, and the federated release receipt's
currentOwnerDispatchId/terminalReleaseState. Fork-only omp usage and
AccountHome schemas are now lazy too; baseline pruned. Feature-interaction schemas
stay in the fork's feature-interaction-params.ts, now lazy too.
- Git graph: openGitGraph keeps the fork's options object (afterOpen) and
takes upstream's placementWorkspaceId (stablyai#49629, stablyai#50017) as an option;
callers and upstream's test use it. The fork's branches/tags dock passes
the folder placement too (same bug as stablyai#49597), and it and the graph tab
share a new useGitGraphRefsEpoch hook (keeps git-graph-tab under 400). Source control keeps the fork's
branches/tags dock beside upstream's file-list header; fork git-graph
rendering tests pass the new tabId.
- Claude background tasks: upstream skips ambient artifact monitors; the
fork's monitored-work rows and untyped-row handling stay.
- Claude managed hook: local POSIX keeps the fork's runtime-home wrapped
command; getPosixManagedEventHook takes the command, so upstream's
PreToolUse timeout applies to both local and remote entries.
- local-worker-start: keep the fork's reminted pane handle (#29) and add
upstream's retained-chat assertStarting and launch warnings.
- Mobile web bundle fence: keep the fork's 11.25 MiB (above upstream's
11 MiB + 16 KiB).
- en.json: union of the fork's ProjectGroupSettingsDialog and upstream's
AutoNameFailed keys.
- Skills: regenerate bundled guides (upstream's shared CLI paragraph), union
the add-only digest ledger, regenerate manifest and sources.
- tracked-upstream-cache test: fixed far-future expiry instead of
Date.now() for upstream's new wall-clock ratchet.
Claude-Session: https://claude.ai/code/session_01BPjp5wba1X5fDbTK4YStHM
dluxhu
pushed a commit
to dluxhu/orca
that referenced
this pull request
Nov 27, 2026
…r workspace (stablyai#49629)
In a folder workspace, the Graph button on a child worktree's repo card
created the Git Graph tab in the hidden child worktree's tab set, so
nothing visible happened. openGitGraph now takes the source control
scope's placement workspace, so the tab opens in the folder workspace
while still reading the child worktree's history. A folder can show one
graph tab per repo card, and commit diffs opened from a folder-placed
graph also land in the folder workspace.
Fixesstablyai#49597
Co-authored-by: Neil <[email protected]>
(cherry picked from commit 3e22725)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
In a folder workspace, each repo card in Source Control has a Graph button. Clicking it opened the Git Graph inside a hidden child workspace, so it looked like nothing happened. Now the graph opens where you clicked, in the folder's own tabs. Diffs you open from that graph also show up in the folder.
What Changed
openGitGraph(childWorktreeId). The tab went intounifiedTabsByWorktree[childId], which the folder workspace never shows.openGitGraph(worktreeId, resolveTargetGroupId?, placementWorkspaceId = worktreeId)passes the placement to both the reopen path (openWorkspaceEditorItem) andopenFile.panel-ready.tsxandchange-scope-bar.tsxpassuseSourceControlScope()?.placementWorkspaceId. The scope is null outside folder sections, so non-folder worktrees behave exactly as before.openWorkspaceEditorItemused to treat a git-graph tab as one per workspace, with the fixed id${workspace}::git-graph. A graph file shown outside its own worktree now reuses only a tab for that same file and gets a normal tab id. Without this, the second repo card's Graph would activate the first repo's graph.GitGraphTabworks out its workspace from its tab id (editorTabWorkspace, the same lookupEditorFileTabuses) and passes it touseGitHistoryCommitActions. Commit diffs opened from a folder-placed graph (double-click, Open diff, a file row in commit details) therefore also land in the folder. The editor pane has no source control scope provider, so before this they fell back to the child.Why
Row and note diffs already pass
placementWorkspaceIdfrom the source control scope (use-row-opening.ts,use-note-opening.ts). Graph was the one entry point that didn't. We follow that existing pattern instead of switching the user to the child worktree, which would pull them out of the folder view they're working in.Linked Issue
Fixes #49597
Reported by @EvilArthas. Original fix by @TuanNancy in #49629; final version reworked during the bug bash. It now also handles several repo cards in one folder and folder-placed commit diffs.
Visual Proof
N/A. No visual capture was recorded for this fix: the local machine can't be used for Electron runs, and no capture exists from the remote runner. The change only affects which workspace's tab set receives the tab, and the store-level tests below check this against the real editor and tabs slices.
Testing
Repro: in a folder workspace with a child worktree (
--parent-worktree), open Source Control and click Graph on the repo card. On main, the tab is created underunifiedTabsByWorktree[childId]and nothing visible happens.New
git-graph-tab.test.tsuses the real editor and tabs store with two child worktrees underfolder:F.use-git-history-commit-actions.test.tsx: a folder-placed graph opens both the all-files commit diff and a single commit file withplacementWorkspaceId: 'folder:F'.Fails on main: with the source files reverted to main and the new tests kept, all 3 new tests fail. With only the
openGitGraphchange (andworkspace-editor-item.tsreverted), the second repo's graph collapses onto the first.Passes: vitest on
git-graph-tab,use-git-history-commit-actions,change-scope-barandgit-graph-open-buttonpasses, 28/28. Wider source-control, editor-tabs and graph consumer suites passed during review.Static checks: oxlint (
--deny-warnings, anti-slop and code-quality configs),oxfmt --check, ast-grep and the changed-code quality gate are clean on all 9 files.Platforms: the logic is renderer-only store placement with no OS-specific paths or shortcuts. Tested with unit tests on macOS.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
There is no slowdown on any hot path. All work runs on a click, apart from one cached selector.
GitGraphTabadds one zustand selector, which is a hit in the shared WeakMap placement index plus aMap.get. It costs 0.014 us/op with 50 tabs and 0.019 us/op with 20k tabs. The index rebuilds only whenunifiedTabsByWorktreechanges, andEditorFileTabalready builds and shares it, so this adds no rebuilds.openFiles.somescan. It costs 0.18 us with 50 open files and 60 us with 20k files (adversarial). Non-graph opens short-circuit oncontentType === 'git-graph'.Risk
Level: Low.
crossWorkspacebranch inopenWorkspaceEditorItem. It applies only to git-graph content shown outside its own worktree. If it went wrong, a folder's Graph click would activate the wrong repo's graph tab.gitGraphScope(worktreeId).Review
Reviewed in two rounds during the bug bash. The second round added the folder-placed commit-diff fix and a typed test fixture.
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)