Skip to content

feat(editor): setting to open file links as a tab instead of a split - #52461

Open
eRom wants to merge 1 commit into
stablyai:mainfrom
eRom:feat/file-links-open-as-tab
Open

eRom wants to merge 1 commit into
stablyai:mainfrom
eRom:feat/file-links-open-as-tab

Conversation

@eRom

@eRom eRom commented Nov 29, 2026 •

Copy link
Copy Markdown

ELI5

When you click a file path that an agent printed in a terminal or a chat, Orca opens the file in a new split beside it. With both sidebars open, that leaves two narrow columns. This adds a setting to open the file as a normal tab in the same pane instead.

What Changed

Before: a file link opened from a terminal or chat that is the only pane always creates a new split to its right (since #30399 and #36915). Cmd/Ctrl+click goes straight there. In chat, #39950 removed the "Open in new tab" row, so there is no way around it.

After: a new toggle under Settings > General > Editor and diffs > Editor: Open file links beside their source. It is on by default, so nothing changes for anyone. When it is off, an automatic file-link open never creates a split. It opens the file as a tab in the source pane's group.

These cases behave the same with either value:

  • a view that already shows the file is reused
  • an existing neighbor group is reused when one exists
  • an explicit "Open in new tab" / "Open in this group" request still wins
  • refusals for cross-workspace or remote targets do not change

Mechanism: resolveEditorLinkOpenPlacement (editor-open-target-group.ts) is the only place that turns an editor file-link open into a split. Every file-link entry point goes through it: Cmd/Ctrl+click in the terminal, the popover's "Open file" row, and native chat file links. They all take openDetectedFilePath, then openLinkedFileInEditor, then openFileForLink, then applyOpenFileToState. The split branch now also checks settings.openFileLinksBesideSource !== false. Also included:

  • the setting's type and default (true)
  • the SETTINGS_CHANGED_WHITELIST entry
  • the settings component and its search entry
  • the English strings
  • one line in the settings docs

Why

#39064, and its comments, ask for this. Users who keep both sidebars visible get the chat or terminal and the file squeezed into half-width columns, on every click.

  • Opt-out, not a default flip. Beside-the-source is a deliberate choice from Open file links beside their source tab's group #30399 and works well for multi-pane layouts, so it stays the default.
  • Same shape as feat(browser): setting to open links as a tab instead of a split beside the pane #35254. That PR adds openLinksInAppSplitBeside for browser links: one boolean, on by default, which only removes the "create a split" step. This PR does the same for file links and does not touch browser-link placement, so the two PRs do not overlap. If maintainers prefer one setting for both, the two keys merge easily.
  • Ruled out: restoring "Open in new tab" in chat. That would still be one extra click per file, and it does not cover Cmd/Ctrl+click, which is what people use most.

Linked Issue

Fixes #39064

Related: #43538 (chat links, same request), #35254 (browser links), #34437, #33252.

Visual Proof

Both captures: a lone terminal pane with both sidebars open, then Cmd+click on a file path it printed.

Setting on (default, same as today) Setting off
before-split after-tab

The setting, found by searching "split":

setting

Testing

On macOS, a dev build of this branch (ORCA_BACKGROUND_LAUNCH=1), driven over CDP. For each case I counted the tab groups in the store before and after the click:

Case Groups before → after Where the file opened
Setting on, lone terminal pane, Cmd+click 1 → 2 new split (unchanged)
Setting off, lone terminal pane, Cmd+click 1 → 1 the terminal's group
Setting off, lone terminal pane, popover "Open file" 1 → 1 the terminal's group
Setting off, a neighbor group already exists 2 → 2 the neighbor group (unchanged)

I also checked the setting itself. Searching "split" finds it, the toggle flips the stored value, and the value is still false after an app restart.

Not run:

  • Native chat file links. They reach the same openDetectedFilePath path (use-native-chat-file-link-click.ts), but I did not play them in a live chat.
  • Linux and Windows. No platform-specific code is involved.
  • SSH / remote workspaces. The changed branch only runs for same-workspace layouts.

pnpm check:changed passes (39 checks).

  • 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

No test added: this is a settings toggle around layout placement. The repo's test policy says to prove it by running the app rather than with a unit test.

Performance

None, because this adds one property read to a function that only runs when a file link is opened.

Risk

Level: Low

  • Default. The default is unchanged, and profiles saved before this change read the missing key as on.
  • Riskiest part. With the setting off, a file link from a lone pane covers that pane's active tab instead of opening beside it. That is the requested behavior, and the user opted in.
  • "Open in new tab" row. It still shows in the terminal popover and is redundant when the setting is off. I left it unchanged to keep this PR small.
  • Back out. A plain revert. A stored openFileLinksBesideSource value would be ignored afterwards.

AI Disclosure

Claude Code. Claude Opus 5.5 traced the placement path, wrote the brief, reviewed the diff and ran the dev-build validation over CDP. Claude Sonnet 5.5 implemented the change and ran the local gate. I reviewed the result.

Review

  • Cross-platform. Renderer-only layout logic and a settings toggle. No paths, shortcuts or platform branches.
  • SSH / remote / paired. Placement for another workspace's layout already falls back to the default and is untouched. The setting is a plain optional global setting with no wire changes.
  • Mobile. Not affected: mobile has no tab-group splits.
  • Backwards compatibility. Optional key, read as on when missing.

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)

🤖 Generated with Claude Code

File links from a lone terminal or chat pane open in a new split beside
it (stablyai#30399, stablyai#36915). Add "Open file links beside their source" under
Settings > Editor, on by default. Off, an automatic file-link open never
creates a split: it opens as a tab in the source group. Existing views,
neighbor groups and explicit group targets are unchanged.

Mirrors openLinksInAppSplitBeside from stablyai#35254, which covers browser links.

Fixes stablyai#39064

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@eRom
eRom requested a review from brennanb2025 as a code owner November 29, 2026 10:53
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Adds Open file links beside their source, enabled by default.

  • File links can stay in the source pane instead of opening a split.

Source review found no actionable issues. Tests were not run. Visual capture was blocked by missing installed dependencies.

Reviews (1) · Last reviewed commit: "feat(editor): setting to open file links..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds the openFileLinksBesideSource setting, enabled by default. When the setting is false, the placement resolver does not attempt side-split placement. The setting appears as a searchable switch in Editor settings, and its anchor, English strings, telemetry whitelist entry, and documentation are updated.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to a03cb

This adds an on-by-default setting that makes file links open as tabs in the source pane instead of splits. Default behavior is unchanged, and no concrete defect was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(editor): setting to open file links as a tab instead of a split" describes the main change: a new editor setting that makes automatic file-link opens use a tab in the source pane rathe…
Linked Issues check Passed [#39064] Requests a persistent file-link placement preference (current group as a new tab, or beside source as a split) for Open file and Ctrl/Cmd-click from agent chats, with explicit per-click actio…
Out of Scope Changes check Passed All changed files support the file-link placement setting. These are: the GlobalSettings type and default (global-settings-types.ts, default-global-settings.ts); the resolver gate (editor-open-target-…
Description check Passed The description follows the repository template closely. It covers ELI5, What Changed (before/after, mechanism), Why (with alternatives considered), Linked Issue (Fixes #39064), Visual Proof (before/a…
Full details: Title check

Explanation

The title "feat(editor): setting to open file links as a tab instead of a split" describes the main change: a new editor setting that makes automatic file-link opens use a tab in the source pane rather than a new split. The changeset adds that setting (type, default, UI component, search entry, i18n strings, placement logic check, telemetry whitelist, docs), so the title matches the primary change and is specific enough for a teammate scanning history.

Full details: Linked Issues check

Explanation

[#39064] Requests a persistent file-link placement preference (current group as a new tab, or beside source as a split) for Open file and Ctrl/Cmd-click from agent chats, with explicit per-click actions kept. At head, the PR adds optional GlobalSettings.openFileLinksBesideSource (default true, read as enabled when absent) and a settings toggle under Editor. In src/renderer/src/store/slices/editor/tabs/editor-open-target-group.ts, resolveEditorLinkOpenPlacement attempts the split branch only when state.settings?.openFileLinksBesideSource !== false. When the setting is false, the function falls through to the adjacent existing group or to the source group as a tab. Explicit intent.targetGroupId requests still return early and win. Reuse of a view that already shows the file is kept by the tabs.some check. Cross-workspace and remote refusals are unchanged. The PR states that terminal Cmd/Ctrl-click, the terminal popover 'Open file' row, and native chat file links all reach this path. The terminal paths were verified over CDP. The native chat path was not confirmed by live testing, and my attempt to read use-native-chat-file-link-click.ts at head failed because the path does not exist there. Any chat link that creates a split must pass through this resolver, so the gate covers the requirement. The issue does not ask for automated tests. Browser-link placement is not changed.

Full details: Out of Scope Changes check

Explanation

All changed files support the file-link placement setting. These are: the GlobalSettings type and default (global-settings-types.ts, default-global-settings.ts); the resolver gate (editor-open-target-group.ts); the settings component, search entry, and anchor (EditorFileLinkPlacementSetting.tsx, general-editor-search.ts, general-setting-anchors.ts, GeneralEditorSettingsSection.tsx); English strings (en.json); the telemetry SETTINGS_CHANGED_WHITELIST key (telemetry-property-schemas.ts); and one docs line (settings.mdx). The summary shows no change to browser-link placement, which the PR explicitly excludes. No unrelated change is shown.

Full details: Description check

Explanation

The description follows the repository template closely. It covers ELI5, What Changed (before/after, mechanism), Why (with alternatives considered), Linked Issue (Fixes #39064), Visual Proof (before/after captures for the setting on and off), Testing (manual steps with a table of cases, untested areas listed), Performance (None, with a reason), Risk (Level: Low, with the riskiest part and back-out plan), AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Required sections are filled in with specific content. The main gap is that the Visual Proof section relies on image links that could not be verified from the supplied context, and the Testing section does not list automated tests added, which the author explains. These are minor and do not block merge.

  • 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.

Share

Recent 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: 246e3b5c-80aa-4c39-b3bf-27a849a07196
Commits

Reviewing files that changed from the base of the PR and between 002d0a6 and a03cb20.

Files selected for processing: 10

  • docs/site/content/docs/settings.mdx
  • src/renderer/src/components/settings/editor/EditorFileLinkPlacementSetting.tsx
  • src/renderer/src/components/settings/editor/GeneralEditorSettingsSection.tsx
  • src/renderer/src/components/settings/editor/general-editor-search.ts
  • src/renderer/src/components/settings/general/general-setting-anchors.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/editor/tabs/editor-open-target-group.ts
  • src/shared/settings/default-global-settings.ts
  • src/shared/settings/global-settings-types.ts
  • src/shared/telemetry/schemas/telemetry-property-schemas.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
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.

[Feature]: Option to open file links in the current group instead of a split

1 participant