Repository navigation
fix(editor): reuse a parked diff preview across tab groups, plus opt-in side-split diffs - #11866
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a setting for opening Source Control diff previews in a dedicated side split. Adds target-group selection that prioritizes preview groups and existing non-active diff groups. Updates Source Control diff flows to use shared placement logic. Updates editor preview handling to reuse parked previews across groups while keeping explicitly pinned opens group-scoped. Adds per-worktree diff-column state, toolbar controls, and tests. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description is detailed and relevant. It explains the problem, implementation, rationale, linked issue, UI impact, testing, compatibility, security, and review findings. Some template headings and checklist items are omitted, but the required information is substantially covered. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/renderer/src/components/right-sidebar/source-control-split-open.ts (1)
50-57: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate content-type predicate already exists in
editor.ts.
isEditorContentTabreimplements the same four-way check asisEditorTabContentTypeinsrc/renderer/src/store/slices/editor.ts(lines 780-787). Both list'editor' | 'diff' | 'conflict-review' | 'check-details'as the editor-family content types. If a new content type is added to this family later, a maintainer can update one copy and miss the other, silently breaking either side-split target selection or preview-slot replacement.Extract one shared predicate (or a shared
EDITOR_TAB_CONTENT_TYPESarray) intosrc/shared/types.tsor a small shared module, and import it from both files.♻️ Proposed shared predicate
+// src/shared/types.ts +export const EDITOR_FAMILY_CONTENT_TYPES = ['editor', 'diff', 'conflict-review', 'check-details'] as const +export function isEditorFamilyContentType(contentType: TabContentType): boolean { + return (EDITOR_FAMILY_CONTENT_TYPES as readonly string[]).includes(contentType) +}-function isEditorContentTab(tab: SideSplitCandidateTab): boolean { - return ( - tab.contentType === 'editor' || - tab.contentType === 'diff' || - tab.contentType === 'conflict-review' || - tab.contentType === 'check-details' - ) -} +function isEditorContentTab(tab: SideSplitCandidateTab): boolean { + return isEditorFamilyContentType(tab.contentType) +}src/renderer/src/components/right-sidebar/SourceControl.tsx (1)
4414-4457: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueLocal
activeGroupIdshadows the component-scopedactiveGroupId.Line 4435 declares a new
const activeGroupIdinsideresolveDiffOpenPlacement. This shadows the outeractiveGroupIdfromuseAppStoreat line 807, but the two have different semantics: the outer one has no fallback, while this local one falls back togroupsByWorktree[activeWorktreeId]?.[0]?.id. The shadowing is legal and the logic itself is correct (verified againstfindSideSplitDiffTargetGroupIdand the create-split fallback), but a reader who only recalls the outer definition can misjudge what value is used when debugging placement issues.Rename the local variable (for example
resolvedActiveGroupId) to avoid confusion with the outer render-scopedactiveGroupId.✏️ Proposed rename
- const activeGroupId = + const resolvedActiveGroupId = activeGroupIdByWorktree[activeWorktreeId] ?? groupsByWorktree[activeWorktreeId]?.[0]?.id - const existingGroupId = findSideSplitDiffTargetGroupId(tabs, activeGroupId) + const existingGroupId = findSideSplitDiffTargetGroupId(tabs, resolvedActiveGroupId) if (existingGroupId) { return { targetGroupId: existingGroupId, preview } } - if (!activeGroupId) { + if (!resolvedActiveGroupId) { return { targetGroupId: undefined, preview } } return { - targetGroupId: createEmptySplitGroup(activeWorktreeId, activeGroupId, 'right') ?? undefined, + targetGroupId: + createEmptySplitGroup(activeWorktreeId, resolvedActiveGroupId, 'right') ?? undefined, preview }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a6bd7846-b068-4a6f-97cd-27e20d06e58e
📒 Files selected for processing (11)
src/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/source-control-split-open.test.tssrc/renderer/src/components/right-sidebar/source-control-split-open.tssrc/renderer/src/components/settings/GitPane.tsxsrc/renderer/src/components/settings/OpenDiffsInSideSplitSetting.tsxsrc/renderer/src/components/settings/git-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/editor.test.tssrc/renderer/src/store/slices/editor.tssrc/shared/constants.tssrc/shared/types.ts
Greptile SummaryThis PR fixes a preview-duplication bug (#11839) where
Confidence Score: 5/5Safe to merge — the fix is narrowly scoped to preview-replacement routing and the new setting is off by default with no change to existing behavior. All five diff/file open call sites are updated consistently, cleanup of diffColumnGroupIdByWorktree covers all three removal paths (purge, delete, rename-rekey), and the isSharedEntity guard that prevents mutating a shared OpenFile across groups is preserved. The new feature is gated behind a boolean setting, test coverage spans unit, integration, and search-localization layers, and no platform-specific or IPC-touching code was added. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/renderer/src/store/slices/editor.ts | Core fix: resolveReplaceablePreviewSlot now accepts pinnedGroupId and searches all worktree tabs when unpinned, retargeting the open to the preview's actual group via retargetGroupId. All five diff/file open paths updated consistently. |
| src/renderer/src/components/right-sidebar/source-control-split-open.ts | New resolveSideSplitDiffColumn implements three-level resolution: live recorded column wins, one-time inference from non-active-group preview or diff tab, then undefined so caller creates a fresh split. |
| src/renderer/src/components/right-sidebar/SourceControl.tsx | New resolveDiffOpenPlacement callback wraps modifier-click handling and the side-split column resolver. Reads unifiedTabsByWorktree imperatively via useAppStore.getState() at call time (correct Zustand pattern). |
| src/renderer/src/store/slices/tabs.ts | Adds diffColumnGroupIdByWorktree state and setDiffColumnGroupId action. The action is a no-op when value is unchanged, avoiding spurious re-renders. |
| src/renderer/src/store/slices/worktrees.ts | diffColumnGroupIdByWorktree correctly added to all three cleanup paths: WORKTREE_ID_KEYED_MAP_KEYS, buildWorktreePurgeState, and the worktree-delete block. |
| src/renderer/src/components/settings/OpenDiffsInSideSplitSetting.tsx | New setting component with localized keyword matching via translateSearchKeyword, fixing the catalog-hit-but-render-nothing gap. |
| src/shared/editor-tab-content-type.ts | New shared isEditorTabContentType predicate replacing two private copies in editor.ts and source-control-split-open.ts. |
Sequence Diagram
sequenceDiagram
participant SC as SourceControl
participant rDP as resolveDiffOpenPlacement
participant rSDC as resolveSideSplitDiffColumn
participant Store as TabsSlice
participant Editor as createEditorSlice
SC->>rDP: handleOpenDiff(event)
rDP->>rDP: resolveSplitTargetGroupId(event)
alt modifier-click
rDP-->>SC: targetGroupId newSplitId preview false
else normal click setting off
rDP-->>SC: targetGroupId undefined preview true
else normal click setting on
rDP->>Store: read diffColumnGroupIdByWorktree
rDP->>rSDC: tabs activeGroupId liveGroupIds recordedGroupId
alt recorded column is live
rSDC-->>rDP: groupId recordedId shouldRecord false
else preview in non-active group
rSDC-->>rDP: groupId previewGroupId shouldRecord true
rDP->>Store: setDiffColumnGroupId
else no suitable group
rSDC-->>rDP: groupId undefined shouldRecord true
rDP->>Store: createEmptySplitGroup
rDP->>Store: setDiffColumnGroupId splitGroupId
end
rDP-->>SC: targetGroupId groupId preview true
end
SC->>Editor: openDiff with targetGroupId and preview
Editor->>Editor: resolveReplaceablePreviewSlot
alt preview tab exists in worktree
Editor->>Editor: retarget to previewTab groupId if unpinned
Editor->>Editor: replace preview OpenFile in-place
else no preview tab
Editor->>Editor: create new preview tab in targetGroupId
end
Reviews (5): Last reviewed commit: "fix(source-control): track the diff colu..." | Re-trigger Greptile
…redicate Review follow-ups on stablyai#11866. The Git pane's search catalog indexes localized keyword aliases, but the setting's own matcher knew only English. A localized query could match the catalog and then render nothing. The matcher now derives its keywords through translateSearchKeyword; SearchableSetting keeps the English list. isEditorContentTab duplicated editor.ts's isEditorTabContentType, so adding a content type to the editor family meant updating two private copies or silently breaking one of side-split targeting or preview replacement. Both now import one predicate from shared/. Co-Authored-By: Claude Opus 5 <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/renderer/src/components/settings/open-diffs-in-side-split-search.test.ts (2)
22-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the explanatory comment.
Keep only the non-obvious reason for injecting the alias, for example:
// Inject the alias because this key is not yet in the locale catalog.As per coding guidelines, comments in TypeScript files must be concise, limited to non-obvious information, and preferably one line.
Source: Coding guidelines
9-11: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winRestore all mutated
i18nstate after the test.
i18n.addResourceBundle(..., true, true)mutates the imported application instance. The cleanup changes only the active language to'en'; it does not restore the previous language or remove the injected resource. Later tests can observe the Chinese alias or an overwritten value. Snapshot and restore the previous state, or use an isolated i18n instance.Verify the cleanup mechanism against the repository's i18next 26.3.1 API.
Also applies to: 27-28
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 668b7147-87cb-4f90-812c-9c02851e4fa4
📒 Files selected for processing (5)
src/renderer/src/components/right-sidebar/source-control-split-open.tssrc/renderer/src/components/settings/OpenDiffsInSideSplitSetting.tsxsrc/renderer/src/components/settings/open-diffs-in-side-split-search.test.tssrc/renderer/src/store/slices/editor.tssrc/shared/editor-tab-content-type.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/renderer/src/components/settings/OpenDiffsInSideSplitSetting.tsx
- src/renderer/src/components/right-sidebar/source-control-split-open.ts
- src/renderer/src/store/slices/editor.ts
Review follow-up on stablyai#11866: the preview branch matches any editor-family preview because the returned group is pinned by the caller, which makes preview replacement group-scoped; the fallback is narrower on purpose. Co-Authored-By: Claude Opus 5 <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/right-sidebar/source-control-header-overflow-menu.tsx (1)
81-82: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake both JSX comments one line.
src/renderer/src/components/right-sidebar/source-control-header-overflow-menu.tsx#L81-L82: Replace the two-line rationale with one concise line.src/renderer/src/components/right-sidebar/source-control-header-overflow-menu.test.tsx#L41-L42: Replace the two-line rationale with one concise line.As per coding guidelines, comments must be concise and preferably one line.
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 39e95f92-5ef7-48d9-87a6-83776ff1ea3c
📒 Files selected for processing (6)
src/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/source-control-header-overflow-menu.test.tsxsrc/renderer/src/components/right-sidebar/source-control-header-overflow-menu.tsxsrc/renderer/src/components/right-sidebar/source-control-header-toolbar-identity.test.tsxsrc/renderer/src/components/right-sidebar/source-control-header-toolbar.tsxsrc/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/src/components/right-sidebar/SourceControl.tsx
- src/renderer/src/i18n/locales/en.json
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/right-sidebar/source-control-split-open.ts (1)
70-73: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the added comments.
src/renderer/src/components/right-sidebar/source-control-split-open.ts#L70-L73: Keep one short statement of the recorded-group precedence invariant.src/renderer/src/components/right-sidebar/source-control-split-open.ts#L80-L89: Retain only the non-obvious reason that recorded state prevents repeated splits.src/renderer/src/components/right-sidebar/source-control-split-open.ts#L96-L97: Keep one short statement for the diff-tab fallback.src/renderer/src/store/slices/tabs.ts#L67-L67: Reduce the state rationale to one concise sentence.As per coding guidelines, comments must be concise, limited to non-obvious information, and preferably one line.
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 73943a78-a339-44cd-97a0-37d16be16096
📥 Commits
Reviewing files that changed from the base of the PR and between 8209e23 and 5177115e71d599490f7f87e4a9c5ea659cc70e24.
📒 Files selected for processing (8)
src/renderer/src/components/right-sidebar/SourceControl.preview-open.test.tsxsrc/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/source-control-split-open.test.tssrc/renderer/src/components/right-sidebar/source-control-split-open.tssrc/renderer/src/store/slices/editor.test.tssrc/renderer/src/store/slices/tabs.test.tssrc/renderer/src/store/slices/tabs.tssrc/renderer/src/store/slices/worktrees.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/src/components/right-sidebar/SourceControl.tsx
- src/renderer/src/store/slices/editor.test.ts
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
5aef0a7 to
7bdccb9
Compare
88897d1 to
e596d94
Compare
e596d94 to
29b8387
Compare
29b8387 to
7239f20
Compare
|
Upstream https://github.com/dcieslak19973/orca/actions/runs/31215862833 — all 43 jobs green: typecheck, static analysis, packaging (linux + windows), Git compatibility, shell contracts, cross-version wire compatibility, and all 16 test shards. Posting so the suite result is visible without needing the approval click first. |
14b6ec1 to
a56b331
Compare
a56b331 to
4239385
Compare
4239385 to
93159e8
Compare
93159e8 to
2a42a02
Compare
2a42a02 to
ad08dda
Compare
90c9bb1 to
b80eb91
Compare
Readiness check — head
|
| Gate | Result |
|---|---|
pnpm typecheck |
✅ pass |
pnpm lint |
✅ pass (incl. code-quality native + type-aware, max-lines ratchet, localization catalog/extraction/coverage) |
pnpm test (renderer store slices, source-control, settings, shared) |
✅ 4,177 / 4,178 across 467 files |
pnpm build:desktop |
✅ pass — closes the one unchecked box in the PR description |
The single test miss was github-pr-refresh-states-leak.test.ts › caps prRefreshStates when driven past the cap by the real writer, a wall-clock-bounded perf test untouched by this PR; it passes in isolation (13/13) and only failed while an Electron dev build was competing for CPU.
Real-Electron verification
Driven through the actual UI in a dev build of this branch (CDP-attached), not store mutation. Screenshots are uncropped full-window.
1. Parked preview reuse across tab groups — the #11839 fix. Setting off. Opened split-open.ts from Source Control, moved it to a right split via Tab → Move Tab to Split → Right, then clicked back into the terminal group so the preview sat parked in a non-active group:
Then clicked tabs.ts in Source Control. The parked preview in the right split was recycled in place — tab count stayed at 2, and no second preview appeared over the terminal in the left group. Pre-fix this is exactly where the duplicate landed:
2. Opt-in side split. Toggled from the Source Control overflow menu, then clicked constants.ts from a single-group layout: a right split was created, the diff preview opened there, and diffColumnGroupIdByWorktree recorded that column. Focus was then moved back to the terminal group and git-search.ts clicked — the preview recycled in the recorded column rather than following focus, which is the behavior the per-worktree recording exists to guarantee:
3. Both entry points. Overflow menu checkbox item, and Settings → Git & Source Control reached via the search term side split — the toggle reflects the state set from the panel, confirming both surfaces write the same setting:
Notes for the reviewer
- The PR description still describes the pre-rebase layout (
editor.ts,src/shared/editor-tab-content-type.ts, "three commits"). The head is now one squashed commit re-homed onto thestore/slices/editor/**+right-sidebar/source-control/**split that landed onmainafter this branch was cut; it reusesmain'seditor/tabs/editor-tab-content-type.tsandsource-control/listing/split-open.tsinstead of this branch's duplicates, keeping onlyresolveSideSplitDiffColumn. The commit message records the mapping. - Upstream
PR ChecksandPR test LoCwere sitting ataction_required; both are approved and running againstb80eb91now. - Not exercised: Windows/Linux, SSH-hosted worktrees, and the conflict-review path (
open-conflict-review.tspasses nopinnedGroupId, so it keeps the pre-existing unpinned behavior — covered by unit tests, not by this manual pass).
Readiness Checklist — Verdict: READY TO MERGEIndependent verification run against head Gates
The single broad-suite failure was Electron proof (real app, CDP-attached to this branch)Attached to the correct instance (
Findings
Residual risk
|
Visual proof — real Electron app, this branchCaptured via CDP against a dev build launched from this worktree ( 1. Before the click — preview parked in the split, terminal focused
2. After clicking
|
b80eb91 to
e2978c8
Compare
|
Refreshed head
Verified locally: @nwparker — since you'd already run the READY-TO-MERGE checklist at |
e2978c8 to
6587ef7
Compare
…in side-split diffs Preview replacement was group-scoped, so a diff opened from Source Control while a preview sat parked in another split was shadowed by a second preview in the resolved group instead of recycling the parked one (stablyai#11839). Preview reuse is now worktree-scoped: an unpinned open re-activates the entity's tab wherever it lives, and a caller-pinned group keeps the old scoping so a split-open in group B never evicts group A's preview. `getReplaceablePreviewFileId` becomes `resolveReplaceablePreviewSlot`, returning the `openFiles` index plus the group to retarget to, and `openWorkspaceEditorItem` takes an options object so callers can distinguish a resolved target group from a pinned one. Adds the opt-in "Open Diffs in a Side Split" setting, reachable from both Settings and the Source Control overflow menu. The worktree records the diff column it settles on, so the column stops moving with focus. Squashed from eight commits and re-homed onto the post-split module layout (`store/slices/editor/**`, `right-sidebar/source-control/**`), which landed after this branch was cut: fix(editor): reuse a parked diff preview across tab groups (stablyai#11839) feat(source-control): add opt-in "Open Diffs in a Side Split" setting (stablyai#11839) fix(settings): match localized search aliases; share the editor-tab predicate docs(source-control): record why the two side-split heuristics differ feat(source-control): surface the side-split toggle in the panel overflow menu fix(source-control): track the diff column per worktree instead of inferring it refactor(source-control): unshadow the diff-placement group id and restore i18n test state fix(source-control): import Tab and GlobalSettings from their real modules The re-home drops this branch's `src/shared/editor-tab-content-type.ts` and its duplicate `source-control-split-open.ts` in favour of the equivalents main grew in the meantime (`editor/tabs/editor-tab-content-type.ts`, `source-control/listing/split-open.ts`), keeping only `resolveSideSplitDiffColumn`, which main lacks.
6587ef7 to
f8e6a6c
Compare
|
Thanks @dcieslak19973 — your parked-preview fix and optional side-split workflow form a useful, clean split. I extracted them into two focused PRs so the bug fix can be reviewed and merged separately from the new preference:
Credit for the original implementation belongs to Dan Cieslak (@dcieslak19973). Both extracted implementation commits retain your Git authorship, and both PR descriptions link back here and credit you explicitly. The split is rebased onto current Validation: the isolated fix passed 56 focused tests and web typecheck. The feature stack passed 61 focused tests, 46 additional cleanup/remote-editor tests, web/Node typechecks, targeted lint, and localization checks. Existing Electron proof from this PR is linked with its original provenance; it is not represented as a fresh UI run on the split heads. CI will cover the broader gates. These two PRs are the proposed review/merge path for this work. Leaving this original PR open to preserve the discussion and review history. |
|
Superseded by #19181 (parked-preview reuse fix) and #19182 (opt-in side-split diffs), which @nwparker extracted from this PR — credited, rebased onto current main, and reviewed. Closing this in favor of that split to keep the queue clean; happy to reopen if anything there stalls. Thanks @nwparker for driving it. |










What: A diff preview parked in a split no longer breaks when cycling files from Source Control — plus an opt-in "Open Diffs in a Side Split" setting.
Risk: Behavior fix on the preview-replacement path; the new setting is opt-in, default off.
State: Rebased clean onto current
main(MERGEABLE); one squashed commit re-homed onto the post-split module layout. Typecheck (web + node) and the PR's targeted suites green locally; full matrix on CI.Fixes #11839.
ELI5
If you park a diff preview in a side split next to your agent terminal, clicking through changed files in Source Control used to misfire: after touching the terminal, the next click stacked a brand-new diff tab over the terminal instead of updating the parked preview. Fixed — clicks now find and reuse the parked preview wherever it lives. Optionally, a new Settings → Git switch (off by default) makes Source Control diff clicks open straight into a right-hand split, skipping a manual move-the-tab ritual.
Summary
The review layout this addresses: agent terminal in the left tab group, a diff preview parked in a right split, clicking through changed files in Source Control to cycle that preview.
Preview replacement resolved the target group before looking for a replaceable preview, so the lookup was group-scoped. After focusing the terminal group — i.e. after every interaction with the agent — the next Source Control click resolved to the terminal's group, found no preview there, and opened a new diff tab over the terminal, orphaning the preview parked in the split. Two live "preview" tabs also arguably violates preview semantics on its own.
What changed:
resolveReplaceablePreviewSlotfinds the replaceable preview anywhere in the worktree and returns theopenFilesindex plus the group holding it, so the tab open is retargeted there instead of duplicating into the active group.openWorkspaceEditorItemtakes an options object so callers can distinguish a resolved target group from a caller-pinned one. A caller-pinnedtargetGroupIdkeeps the previous group scoping, so a split-open in group B still cannot evict group A's preview — the existing shared-preview-across-splits behavior is unchanged and still covered by its test.resolveSideSplitDiffColumn). This removes the per-worktree ritual of click file → get center tab → right-click → Move Tab to Split → Right. The worktree records the diff column it settles on, so the column stops moving with focus. Modifier-click still forces a brand-new split with a permanent tab; double-click pin behavior is untouched. Reachable from both Settings → Git and the Source Control panel overflow menu.Commit structure
One squashed commit, re-homed onto the module layout
maingrew after this branch was cut (store/slices/editor/**,right-sidebar/source-control/**). The re-home drops this branch's ownsrc/shared/editor-tab-content-type.tsand its duplicatesource-control-split-open.tsin favour of main's equivalents (store/slices/editor/tabs/editor-tab-content-type.ts,source-control/listing/split-open.ts), keeping onlyresolveSideSplitDiffColumn, which main lacks. The squashed commit message records the original eight-commit mapping.Screenshots
No visual change from the reuse fix or the review follow-ups. The side-split feature adds one switch to Settings → Git ("Open Diffs in a Side Split", default off) and, when enabled, causes Source Control diff clicks to open in a right split instead of the active group — no new chrome, existing split/tab rendering. Real-Electron CDP proof (parked-preview reuse, pinned-open regression guard, and the opt-in side split) is captured in the reviewer readiness comments below.
Testing
pnpm tc:web— passpnpm tc:node— passeditor-parked-preview-reuse.test.ts,open-diffs-in-side-split-search.test.ts,header-overflow-menu.test.tsx(10/10)Rebase touched exactly two files by hand, both additive: the new
sourceControlOpenDiffsInSideSplitdefault moved intobuildDefaultSettings(its post-refactor home onmain), and theopenDiffsInSideSpliti18n key added alongside main's Create-PR strings. An orphancreatePrIntentEmptyGeneratedBodykey with no code references was dropped rather than resurrected.AI Review Report
Reviewed with Claude Code, plus the CodeRabbit and Greptile passes on this PR. Risks checked: preview/tab state mutation across split groups, regression of the pre-existing pinned-target behavior, settings persistence and defaults, and search/i18n wiring.
Changed as a result:
translateSearchKeyword, but this setting's matcher passed only the English keyword list — a localized query could match the catalog and then render nothing. The matcher now derives translated keywords;SearchableSettingkeeps the English list. Added a regression test that injects azhtranslation.Verified and not changed:
activeWorktreeId/worktreePathguards run before the placement resolver, and all three following branches (openConflictFile, markdownopenFile,openDiff) consume the returned group. No reachable orphan short of an exception inside an open call.targetGroupId, which makes preview replacement group-scoped for that open. Restricting the heuristic to diff-only previews would target a different group than the one where the parked preview actually lives — reintroducing the exact bug this PR fixes.Cross-platform: no platform-dependent code paths added. No
metaKey/ctrlKeyhardcoding (the existingisSourceControlSplitOpenModifieralready branches onisMac), no new path handling, no shell invocation, no Electron platform APIs. Tab-group state is in-renderer and platform-neutral.Security Audit
Low risk surface. No IPC channels, command execution, path handling, auth, secrets, or dependencies added or changed. The one new persisted value is a boolean setting (
sourceControlOpenDiffsInSideSplit) flowing through the existing settings store with no new validation surface. Group ids are internally generated UUIDs, never user input. No follow-up needed.Notes
Cross-refs #11840, which scopes the parked preview to what changed since you last looked.
🤖 Generated with Claude Code