Repository navigation
fix(source-control): open reused Git graph in the split target when the workspace does not show it yet - #50017
Conversation
|
CI note: only CodeRabbit has completed on this PR; the required workflows appear not to have started yet, which matches the first-time-contributor |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…he workspace does not show it yet When a child repo's Git graph file was already open but the placement workspace (e.g. a folder workspace) had no tab for it, openGitGraph's reuse branch never ran the lazy split resolver, so a modifier-click opened the graph in the active group instead of a new split. Run the resolver only when the placement workspace lacks a matching graph tab, and pass a fresh store snapshot since the resolver may create the group. Refs stablyai#49597 Co-authored-by: VNATdev-ops <[email protected]>
a5ada19 to
45ac4b1
Compare
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
ELI5
If you hold Cmd (or Ctrl) and click the Graph button on a repo card in a folder workspace, Orca should open the Git graph in a new side-by-side pane. But if that repo's graph was already open somewhere else (for example in the repo's own worktree), Orca ignored the request and put the graph in the pane you were already using. Now it opens in the new side pane as asked. If the graph is already showing in the current workspace, Orca just jumps to it, as before.
What Changed
openGitGraph(src/renderer/src/lib/source-control/graph/git-graph-tab.ts), the branch for a graph whose file is already inopenFilescalledopenWorkspaceEditorItem(...)without a target group. The lazy split resolver (resolveTargetGroupId, passed by the repo card's modifier-click) never ran, so the tab landed in the active group.entityId.openWorkspaceEditorItemactivates the existing tab and no empty split is created.targetGroupId, so the new tab lands in the split.openWorkspaceEditorItemnow getsuseAppStore.getState()read after the resolver runs. The resolver can create the split group throughcreateEmptySplitGroup, and theORCA_LAYOUT_OWNER=mainpath checks the target group against the state it is given.git-graph-tab.test.ts: open a child repo's graph in the child worktree, then split-open it from the folder. The folder tab must land in the split group, and opening it again must not call the resolver a second time, so no extra empty split appears.Why
A split-open should always put the reused graph in the group the caller asked for. Skipping the resolver on the reuse path was left over from the two-argument API in #49629. Running the resolver only when a new tab will actually be drawn keeps the existing "jump to the open tab" behavior and avoids leaving empty splits.
Linked Issue
Refs #49597 (follow-up to #49629; that issue's main bug was already fixed there)
Visual Proof
N/A: this changes which pane an existing tab is placed in. It is covered by a store-level test that fails on
main("expected vi.fn() to be called 1 times, but got 0 times") and passes with this change. No visual design changes.Testing
main: withmain'sgit-graph-tab.tsrestored, the new test fails because the resolver is never called. With this change it passes.main, passes here).vitestongit-graph-tab.test.tsandchange-scope-bar.test.tsx: 8/8 pass.oxfmt --check, anti-slop oxlint, code-quality oxlint, ast-grep, and the changed-code quality gate are all clean on the touched files.Performance
None that matters, because this only runs when the user clicks the Graph button. That is a renderer click handler, not a hot path. It adds one
.some()over the placement workspace's tabs (openWorkspaceEditorItemalready does the same scan) plus one O(1)useAppStore.getState(). Measured cost of the extra scan per click: 0.11 us with 10 tabs, 1.3 us with 1,000 tabs, and about 1.8 ms with 100,000 tabs (adversarial). All are well under 16 ms. There is no new I/O, IPC, polling or subprocess work.Risk
Level: Low. Only the git-graph reuse path changes. Callers that pass no resolver behave exactly as before. The change-scope-bar resolver always returns undefined, so it is unchanged too. The riskiest part is the
placementHasTabcheck. If it disagreed withopenWorkspaceEditorItem's own lookup, an empty split could be left behind. Both use the sameentityIdmatch, and the test checks that a second open does not split again. SSH, WSL and mobile are not affected, because host routing is untouched. To back it out, revert this commit.Review
Agent skill upstream boundary
Notes
Original fix by @TuanNancy in #50017. Their authorship is kept through the
Co-authored-bytrailer.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)