Skip to content

feat(cli): open files at a requested line and column - #28240

Merged
nwparker merged 20 commits into
mainfrom
nwparker/scan-cli-file-position
Oct 14, 2026
Merged

nwparker merged 20 commits into
mainfrom
nwparker/scan-cli-file-position

Conversation

@nwparker

@nwparker nwparker commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1321 $\color{#cf222e}{\Huge{\mathbf{−}}}$​130 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1191
Prod 26 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​383 $\color{#cf222e}{\Huge{\mathbf{−}}}$​44 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​339

ELI5

Tools can now tell Orca which line and column to show, so you can go straight to an error or search result.

What Changed

orca file open a.ts --line 42 --column 7 --focus opens the file at that cursor position. Without --focus, Orca preserves the visible file and caret, then applies the position when you activate the target tab. Markdown opens in source view when the position is applied. A later successful open without a position cancels that file’s earlier queued position.

Optional position fields travel through the existing file-open request and editor reveal scheduler. The queue follows the target file’s ordinary or floating workspace and selected pane; delayed callbacks check that the request still owns that editor before moving its cursor. Invalid positions fail before opening anything; valid positions beyond the document clamp to its end.

Why

Reusing the existing reveal scheduler keeps mounting, delayed content and line clamping consistent. A separate reveal command would add a round trip and could race file loading.

Linked Issue

Fixes #26136

Visual Proof

Captured from hidden Electron renderers using the real built CLI. The initial positioning flow passed three consecutive runs; the latest rebuilt flow also covers cancellation and split panes.

Default open Open at line 300, column 7
Before After

The selected split pane moves while its sibling keeps its cursor:

Split panes

The floating editor clamps an oversized position to line 400/end while the main editor stays at line 1. This image predates the final plain-open cancellation fix; the floating behavior was rechecked on the final head.

Floating editor position clamps without moving the main editor

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Positioning and cancellation: 65 focused tests pass on the positioning fix. All five new cancellation regressions fail before and pass after it. Rebuilt hidden CLI/Monaco and floating-editor flows check cancellation, split isolation, focus departure, bounds and empty files; independent actual CLI verification is clean. All 40 feature and proof files are byte-identical on the resolved head.

  • Bounds and compatibility: 57 actual CLI/RPC/editor checks cover zero, negative, fractional, unsafe, missing and column-only values, oversized valid positions and empty files at 1:1. Older-client requests and the pre-feature schema contract pass. Earlier feature verification passed 168 focused tests on each macOS, Linux and Windows execution host.

  • Hidden rendering and cleanup: floating-position and hover-card tests pass on macOS and isolated Linux using the existing CDP capture pattern. Native windows remain hidden and unfocused; position, focus and timeout assertions remain. Lifecycle tests verify all four subscriptions and both DOM listeners are removed on unmount.

  • Final integration, a9c4c67: current main is preserved, including its clock callback, real session-store fixture and catalog corrections. These upstream repairs do not remain in the PR diff. The final diff is the original 40 feature files plus the saved-timestamp/restart regression. Actual Node 24 tests pass 12/12 for local/SSH template titles and colors and permission timestamps; the five tab tests also pass under Bun. Full Node typecheck and catalog validation pass. Independent review checks exactly one clock field and audits the completed typecheck against the frozen source. Formatting and commit hooks pass; the original assertions are unchanged.

  • CI: all 28 checks passed before the subsequent main integrations. All 28 CI checks passed on this exact reviewed commit before merge, including all five Node 24 shards, both rendered end-to-end suites, full lint/typecheck/catalog validation, compatibility, packaging and native smoke checks. On the heavily loaded local host, broader runs and a later isolated Node 24 run timed out during initial module loading. Broad local lint was canceled. Those local results are not claimed as passing; no timeout or assertion was weakened.

Limits: a released older binary and native Windows UI were not launched. Full E2E typecheck has unrelated baseline/cloud dependency errors. Rendered proof is from hidden macOS and isolated Linux sessions.

Review

Reviewed community PR #26137 and credited Nikita Maketryuk <[email protected]> as co-author in the feature commit. Independent review covered delayed reveals, split panes, floating workspaces, cleanup, owner isolation and later plain opens. Both review threads are resolved with reproduction evidence or the tested background-open contract.

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

Merge risk: low based on independent review, with all final CI passed. No negative trade-offs identified for existing behavior. Optional fields preserve mixed-version requests: older hosts still open files but ignore positioning. Positions are session-local. Existing path validation, execution-host ownership and focus defaults remain unchanged.

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)
  • 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 (covered by final CI; local limits described above)

nwparker and others added 2 commits October 13, 2026 00:43
Forward optional 1-based positions through the existing file-open command.
Defer background positioning until the editor is selected and guard delayed
reveals against navigation, teardown, and split-pane focus changes.

Fixes #26136

Co-authored-by: Nikita Maketryuk <[email protected]>
The directory classifier joins paths with node:path, so Windows stat calls use backslashes. Match that existing behavior in the symlink setting and no-follow assertions.
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7daeb13a-141e-4d31-8955-8a9e32166e5c
📥 Commits

Reviewing files that changed from the base of the PR and between 3f07610 and 9c99c0f.

📒 Files selected for processing: 4
  • src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.test.ts
  • src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.ts
  • src/renderer/src/hooks/ipc-events/runtime-file-position.ts
  • tests/e2e/cli-file-open-position.spec.ts

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

📝 Walkthrough

The CLI now accepts and validates 1-based --line and optional --column values for file opens, then forwards them through RPC, runtime, and IPC. The renderer queues positions until the target editor is eligible, and applies guarded reveals while respecting file and view state. Markdown files switch to source view before positioning. Tests cover validation, forwarding, stale requests, floating workspaces, and focused opens in split editors.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 9c99c

Unpositioned opens no longer apply stale positions. Opening a file that is already selected may still delay the requested position until the user switches tabs, so the change is mergeable with that limitation understood.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 13.04% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 39 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Issue [#26136] requires optional 1-based line and column values for orca file open, forwarding through files.open and revealing through scheduleEditorLineReveal. The CLI validates values before …
Out of Scope Changes check Passed The changes remain within issue [#26136]. CLI help and documentation describe the new options. Renderer guard changes prevent stale reveals from affecting another editor. Test-only frame-capture, hove…
Title check Passed The title clearly and concisely describes the main change: adding requested line and column positioning to CLI file opens.
Description check Passed The description includes all required sections, links issue #26136, explains the user-facing behavior and implementation, provides visual proof, documents testing and limitations, and completes the re…
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • 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

Comment @coderabbitai help to get the list of available commands.

Restore the existing header to the first line so TypeScript and the directive ratchet recognize it. The position type import and runtime behavior are unchanged.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 456c96c3-7679-4bb8-a3e7-9f0b708eb507
📥 Commits

Reviewing files that changed from the base of the PR and between 1b9a408 and e9344d6.

📒 Files selected for processing (34)
  • docs/site/content/docs/cli/reference.mdx
  • src/cli/command-scoped-flag-help.ts
  • src/cli/handlers/file-open-position.ts
  • src/cli/handlers/file.test.ts
  • src/cli/handlers/file.ts
  • src/cli/root-help-text-secondary.ts
  • src/cli/specs/file.ts
  • src/main/runtime/orca-runtime-file-commands.ts
  • src/main/runtime/orca-runtime-files-mobile-explorer-reads.test.ts
  • src/main/runtime/rpc/methods/files-open-navigation.test.ts
  • src/main/runtime/rpc/methods/files.ts
  • src/main/runtime/runtime-file-command-access.ts
  • src/main/runtime/runtime-file-command-host.ts
  • src/main/runtime/runtime-notifier-contract.ts
  • src/main/window/runtime-window-lifecycle-file-open.test.ts
  • src/main/window/runtime-window-lifecycle.ts
  • src/preload/api/ui-bridge-terminal-and-session-tabs.ts
  • src/preload/api/ui-command-event-api.ts
  • src/renderer/src/components/editor/EditorEditFileSurface.tsx
  • src/renderer/src/components/editor/MonacoEditor.tsx
  • src/renderer/src/components/editor/monaco-editor-mount-params.ts
  • src/renderer/src/components/editor/monaco-view-state-persistence.test.ts
  • src/renderer/src/components/editor/monaco-view-state-persistence.ts
  • src/renderer/src/components/editor/use-monaco-editor-mount.ts
  • src/renderer/src/components/editor/use-monaco-reveal-scheduler.test.tsx
  • src/renderer/src/components/editor/use-monaco-reveal-scheduler.ts
  • src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.test.ts
  • src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.ts
  • src/renderer/src/hooks/ipc-events/runtime-file-position.ts
  • src/renderer/src/store/slices/editor/focus/editor-focus-reveal.ts
  • src/renderer/src/store/slices/editor/types/pending-editor-reveal.ts
  • src/shared/rpc-contract/files-params.ts
  • src/shared/runtime-file-contracts.ts
  • tests/e2e/cli-file-open-position.spec.ts

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f69e0707-6c1f-45ab-b04e-6fa979de0ec0
📥 Commits

Reviewing files that changed from the base of the PR and between e9344d6 and 2f76009.

📒 Files selected for processing: 1
  • src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.ts

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

frbarbre added a commit to frbarbre/orca that referenced this pull request Oct 15, 2026
…working on upstream's new layout

Restore the background terminal launcher upstream deleted (stablyai#28130) as a fork copy for review
workspaces, point the PR comment scope at the moved git identity helper, and record in FORK.md
that upstream's own --line/--column (stablyai#28240) retired the fork's.
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]: orca file open at a line and column

1 participant