Skip to content

refactor(terminal): split terminal-file-open-routing.ts back under the line limit - #32932

Merged
Jinwoo-H merged 1 commit into
mainfrom
nwparker/fix-main-terminal-file-open-routing-max-lines
Oct 23, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
nwparker/fix-main-terminal-file-open-routing-max-lines

Conversation

@nwparker

@nwparker nwparker commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​45 $\color{#cf222e}{\Huge{\mathbf{−}}}$​37 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8

ELI5

Main's lint has been failing. The file that opens terminal file links grew past the 300-line limit after #32706. This PR moves two self-contained pieces into their own files. Nothing changes for users.

What Changed

  • terminal-file-open-turn.ts holds the open-request turn: reserveDetectedFilePathOpenTurn, which supersedes earlier link opens. The click hit-testing now imports it from here, and openDetectedFilePath uses it instead of its own inline counter (same behaviour: bump, then cancel pending line reveals).
  • terminal-html-file-browser-open.ts holds openHtmlFileInBrowser, moved unchanged.
  • terminal-file-open-routing.ts is back to about 283 counted lines. There is no re-export, no barrel and no max-lines disable.

Why

oxlint max-lines failed on origin/main (aeb0399) at 303 lines, so every PR's lint step was red. Moving these two pieces into named modules fixes it without changing behaviour.

Linked Issue

N/A (main fix). #32320 builds on this.

Visual Proof

N/A. This is a pure refactor with no UI change.

Testing

  • pnpm test on all terminal-pane tests and the native-chat link-click test

  • the full static job locally, including typecheck

  • Codex review

  • I manually tested these changes locally

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

AI Disclosure

Review

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

This is a pure move: no wire, platform or remote impact.

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 (or CI will cover; local preferred)

… their own modules

terminal-file-open-routing.ts went over the 300-line limit after #32706, failing
every PR's lint. Move two self-contained pieces out, unchanged: the open-request
turn (shared with click hit-testing) and opening a local HTML file in Orca's
browser.
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ 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: dfc1c131-1e14-46d4-adc9-c4acc8d9f0d5
📥 Commits

Reviewing files that changed from the base of the PR and between aeb0399 and d897fe0.

📒 Files selected for processing: 4
  • src/renderer/src/components/terminal-pane/terminal-file-link-hit-testing.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-turn.ts
  • src/renderer/src/components/terminal-pane/terminal-html-file-browser-open.ts

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

📝 Walkthrough

Terminal file-opening helpers now reside in dedicated modules. Routing uses the shared open-turn currentness check to guard routing actions and callbacks. Hit testing imports the reservation helper from its new module. The HTML browser helper can activate and reveal a worktree, then create an active tab for the local HTML file.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to d897f

No actionable issue is established for the terminal file-opening helper extraction; merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the refactor type and scope and states the goal: splitting terminal-file-open-routing.ts back under the line limit. The changeset does this by moving reserveDetectedFilePathOpenTurn in…
Description check Passed The description follows the template closely. It has an ELI5, a What Changed section, a Why section, Testing, a Checklist, and the agent skill boundary. The LoC table and the ELI5 explain the context.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the refactor type and scope and states the goal: splitting terminal-file-open-routing.ts back under the line limit. The changeset does this by moving reserveDetectedFilePathOpenTurn into terminal-file-open-turn.ts and openHtmlFileInBrowser into terminal-html-file-browser-open.ts, so the title matches the main change. It is 81 characters, slightly above a typical short-title length, but still a single clear sentence.

Full details: Description check

Explanation

The description follows the template closely. It has an ELI5, a What Changed section, a Why section, Testing, a Checklist, and the agent skill boundary. The LoC table and the ELI5 explain the context. Several parts are weak or missing. The Linked Issue section says N/A and gives no issue, although the template says contributors must link an issue, and the author is a maintainer, so this may be acceptable. The Visual Proof section says N/A with a reason, which matches the template. The AI Disclosure and Review sections are empty. The Testing section has a manual-test checkbox left unchecked, with no manual test described. The Notes section does not address the security, cross-platform, SSH, mobile, backwards compatibility, and performance items the template lists, though it says there is no wire, platform, or remote impact. Overall the description is mostly complete.

Resolution

Optional: fill in the empty AI Disclosure and Review sections or mark them N/A. Clarify whether manual testing was done, or leave the box unchecked and say why. Confirm the Linked Issue exception for maintainers.

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

@Jinwoo-H
Jinwoo-H merged commit d3bff1c into main Oct 23, 2026
44 checks passed
@Jinwoo-H
Jinwoo-H deleted the nwparker/fix-main-terminal-file-open-routing-max-lines branch October 23, 2026 21:58
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.

2 participants