Skip to content

refactor(renderer): remove the runtime-file-client barrel - #27975

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-5c
Oct 12, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-5c

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 72 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​138 $\color{#cf222e}{\Huge{\mathbf{−}}}$​119 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19
Prod 64 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​85 $\color{#cf222e}{\Huge{\mathbf{−}}}$​129 $\color{#cf222e}{\Huge{\mathbf{−}}}$​44

ELI5

src/renderer/src/runtime/runtime-file-client.ts only re-exported functions from eight runtime-file-* modules (read, mutation, import, search, metadata, routing, watch, types). This PR points every importer at the module that defines what it uses, and deletes the forwarding file.

What Changed

Users see no difference.

  • About 80 renderer files now import from runtime-file-{read,mutation,import,search,metadata,watch}-client, runtime-file-routing or runtime-file-client-types.
  • Tests: each mock of the barrel is split per defining module with the same values. The importOriginal mocks now mock the module they override: runtime-file-mutation-client for rename/write, runtime-file-read-client for read/download. The quick-open mocks moved to runtime-file-search-client.
  • CI routing: the quick-open e2e route listed the barrel. It now lists runtime-file-search-client.ts, which holds the real code.

Net: production −44 (+85/−129), tests +19 (+138/−119).

Why

Phase 3.99 / AGENTS.md rule: no barrels and no re-export shims. With direct imports, each import line names the module a file really depends on, and each test mocks the module the code under test actually calls. One barrel per PR keeps every review mechanical.

Linked Issue

N/A, internal Phase 3.99 cleanup (PR 3.5c).

Visual Proof

N/A, no UI or behaviour change.

Testing

  • No import, mock or import() of runtime/runtime-file-client remains in src tests mobile config .github.

  • All 72 changed test files pass (596 tests), and so do the e2e routing contract tests.

  • pnpm tc, pnpm lint and pnpm run check:code-quality:changed (0 findings) pass on the whole barrel stack.

  • I manually tested these changes locally

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

Review

P0/P1 review: my own review plus an independent reviewer.

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

Renderer-only import changes. SSH, wire, mobile and platforms are not affected.

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)

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 741a1e0f-efb6-427f-abd1-04a1eb6d58ca

📥 Commits

Reviewing files that changed from the base of the PR and between f8daed0 and fe26570.


📒 Files selected for processing (136)
  • config/scripts/pr-e2e-source-routing.mjs
  • src/renderer/src/components/NewWorkspaceComposerCard.file-drop.test.tsx
  • src/renderer/src/components/browser-pane/navigate/navigate-browser-page-url.ts
  • src/renderer/src/components/editor/ExternalFileChangeBanner.test.tsx
  • src/renderer/src/components/editor/ExternalFileChangeBanner.tsx
  • src/renderer/src/components/editor/ExternalFileChangeCompareDialog.test.tsx
  • src/renderer/src/components/editor/ExternalFileChangeCompareDialog.tsx
  • src/renderer/src/components/editor/MarkdownPreview.image-access.test.tsx
  • src/renderer/src/components/editor/MarkdownPreview.link-routing.interaction.test.tsx
  • src/renderer/src/components/editor/MarkdownPreview.toc-visibility-gate.test.tsx
  • src/renderer/src/components/editor/combined-diff/review-controls/use-combined-diff-section-actions.ts
  • src/renderer/src/components/editor/csv/csv-file-content.ts
  • src/renderer/src/components/editor/csv/csv-preview-save-safety.test.ts
  • src/renderer/src/components/editor/editor-dropped-file-open.ts
  • src/renderer/src/components/editor/editor-restored-tab-conflict-scan.test.ts
  • src/renderer/src/components/editor/editor-restored-tab-conflict-scan.ts
  • src/renderer/src/components/editor/editor-save-queue.ts
  • src/renderer/src/components/editor/local-image-src-reader.ts
  • src/renderer/src/components/editor/markdown-document-list-request.test.ts
  • src/renderer/src/components/editor/markdown-document-list-request.ts
  • src/renderer/src/components/editor/markdown-preview-link-actions.ts
  • src/renderer/src/components/editor/markdown-preview-local-images.ts
  • src/renderer/src/components/editor/restored-editor-owner-save-lifecycle.test.ts
  • src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx
  • src/renderer/src/components/editor/rich-markdown-async-image-paste.test.ts
  • src/renderer/src/components/editor/rich-markdown-async-image-table.test.ts
  • src/renderer/src/components/editor/rich-markdown-extensions.ts
  • src/renderer/src/components/editor/rich-markdown-image-context.ts
  • src/renderer/src/components/editor/rich-markdown-image-insert-code-block.test.ts
  • src/renderer/src/components/editor/rich-markdown-image-insert.test.ts
  • src/renderer/src/components/editor/rich-markdown-image-insert.ts
  • src/renderer/src/components/editor/use-editor-group-file-drop-owner.remote.test.tsx
  • src/renderer/src/components/editor/useEditorPanelContentState.test.tsx
  • src/renderer/src/components/editor/useEditorPanelFileContentLoader.ts
  • src/renderer/src/components/editor/useEditorPanelFileLoadRetry.host-connection.test.tsx
  • src/renderer/src/components/editor/useEditorPanelFloatingTabContentState.test.tsx
  • src/renderer/src/components/editor/useEditorPanelHostUnresolvedContentState.test.tsx
  • src/renderer/src/components/editor/useEditorPanelRemoteSiblingContentState.test.tsx
  • src/renderer/src/components/editor/useEditorPanelVisibilityContentState.test.tsx
  • src/renderer/src/components/editor/useLocalImagePick.test.tsx
  • src/renderer/src/components/editor/useLocalImageSrc.test.ts
  • src/renderer/src/components/editor/useLocalImageSrc.ts
  • src/renderer/src/components/editor/useMarkdownDocuments.navigation.test.ts
  • src/renderer/src/components/editor/useMarkdownDocuments.ts
  • src/renderer/src/components/editor/useMarkdownDocuments.watch.test.ts
  • src/renderer/src/components/editor/useUntitledFileRename.ts
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageRow.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptChrome.test.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx
  • src/renderer/src/components/native-chat/NativeChatUserMessageRow.tsx
  • src/renderer/src/components/native-chat/native-chat-image-runtime-context.ts
  • src/renderer/src/components/native-chat/use-native-chat-mention-files.test.tsx
  • src/renderer/src/components/quick-open-file-list-host-name-filter.react.test.tsx
  • src/renderer/src/components/quick-open-file-list-remote-catalog.react.test.tsx
  • src/renderer/src/components/quick-open-file-list.react.test.tsx
  • src/renderer/src/components/quick-open-file-list.ts
  • src/renderer/src/components/quick-open-file-navigation.test.ts
  • src/renderer/src/components/quick-open-file-navigation.ts
  • src/renderer/src/components/quick-open-recent-lifetime.react.test.tsx
  • src/renderer/src/components/quick-open-recent-validation.test.ts
  • src/renderer/src/components/quick-open-recent-validation.ts
  • src/renderer/src/components/right-sidebar/FileExplorerRow.actions.test.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerRow.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsx
  • src/renderer/src/components/right-sidebar/file-explorer-copy-file-owner.test.ts
  • src/renderer/src/components/right-sidebar/file-explorer-delete-editor-owner.test.tsx
  • src/renderer/src/components/right-sidebar/file-explorer-directory-listing.test.ts
  • src/renderer/src/components/right-sidebar/file-explorer-directory-listing.ts
  • src/renderer/src/components/right-sidebar/file-explorer-row-action-visibility.ts
  • src/renderer/src/components/right-sidebar/file-explorer-row-file-transfer.ts
  • src/renderer/src/components/right-sidebar/use-file-explorer-name-filter.runtime-listing.test.tsx
  • src/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.ts
  • src/renderer/src/components/right-sidebar/useFileDeletion.ts
  • src/renderer/src/components/right-sidebar/useFileDuplicate.ts
  • src/renderer/src/components/right-sidebar/useFileExplorerImport.committed-scope.test.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerImport.os-file-drop.test.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerImport.remote.test.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerImport.ts
  • src/renderer/src/components/right-sidebar/useFileExplorerInlineInput.ts
  • src/renderer/src/components/right-sidebar/useFileExplorerWatch.broker.test.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerWatch.host-root.test.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerWatch.pending-refresh.test.tsx
  • src/renderer/src/components/right-sidebar/useFileSearchPanel.lifecycle.test.tsx
  • src/renderer/src/components/right-sidebar/useFileSearchRunner.test.tsx
  • src/renderer/src/components/right-sidebar/useFileSearchRunner.ts
  • src/renderer/src/components/settings/McpConfigSection.host-owner.test.tsx
  • src/renderer/src/components/settings/McpConfigSection.tsx
  • src/renderer/src/components/settings/mcp-config-inspection.ts
  • src/renderer/src/components/tab-bar/tab-create-entry-absolute-file.ts
  • src/renderer/src/components/tab-bar/tab-create-entry-action.ts
  • src/renderer/src/components/tab-bar/tab-create-entry-classifier.runtime-listing.test.tsx
  • src/renderer/src/components/tab-bar/tab-create-entry-local-path.ts
  • src/renderer/src/components/terminal-pane/terminal-drop-handler.test.ts
  • src/renderer/src/components/terminal-pane/terminal-drop-internal-handler.test.ts
  • src/renderer/src/components/terminal-pane/terminal-drop-local-workspace.test.ts
  • src/renderer/src/components/terminal-pane/terminal-drop-runtime-catalog-owner.test.ts
  • src/renderer/src/components/terminal-pane/terminal-file-link-target.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-file-path-mapping.ts
  • src/renderer/src/components/terminal-pane/terminal-host-workspace-file.ts
  • src/renderer/src/components/terminal-pane/terminal-native-file-drop.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-element-file-drop.test.tsx
  • src/renderer/src/components/terminal-pane/terminal-remote-file-download-open.ts
  • src/renderer/src/components/terminal-pane/terminal-worktree-path-link.ts
  • src/renderer/src/hooks/composer-state/attachment-drop-failure.test.tsx
  • src/renderer/src/hooks/composer-state/attachment-drop-lifetime.test.tsx
  • src/renderer/src/hooks/composer-state/attachment-drop-state.ts
  • src/renderer/src/hooks/editor-external-watch-disk-verification.ts
  • src/renderer/src/hooks/editor-runtime-file-watch.test.ts
  • src/renderer/src/hooks/editor-runtime-file-watch.ts
  • src/renderer/src/hooks/useEditorExternalWatch-subscriptions.test.tsx
  • src/renderer/src/lib/create-untitled-markdown.ts
  • src/renderer/src/lib/execute-open-editor-path-move.test.ts
  • src/renderer/src/lib/execute-open-editor-path-move.ts
  • src/renderer/src/lib/markdown-document-templates.ts
  • src/renderer/src/lib/rename-user-named-tab-access.test.ts
  • src/renderer/src/lib/user-opened-local-path.test.ts
  • src/renderer/src/lib/user-opened-local-path.ts
  • src/renderer/src/lib/workspace-file-host-routing.ts
  • src/renderer/src/runtime/mobile-markdown-bridge.ts
  • src/renderer/src/runtime/remote-host-file-open-repro.test.ts
  • src/renderer/src/runtime/runtime-file-client-download.test.ts
  • src/renderer/src/runtime/runtime-file-client-external-import.test.ts
  • src/renderer/src/runtime/runtime-file-client-mutation-ownership.test.ts
  • src/renderer/src/runtime/runtime-file-client-search-listing.test.ts
  • src/renderer/src/runtime/runtime-file-client-watch.test.ts
  • src/renderer/src/runtime/runtime-file-client.test.ts
  • src/renderer/src/runtime/runtime-file-client.ts
  • src/renderer/src/runtime/runtime-file-import-pairing-revision.test.ts
  • src/renderer/src/runtime/runtime-legacy-recent-freshness.test.ts
  • src/renderer/src/runtime/runtime-quick-open-version-compatibility.test.ts
  • src/renderer/src/runtime/runtime-terminal-artifact-read.test.ts
  • src/renderer/src/store/slices/editor/actions/markdown-link-action.ts
  • src/renderer/src/store/slices/editor/tabs/untitled-file-cleanup.ts

💤 Files with no reviewable changes (1)
  • src/renderer/src/runtime/runtime-file-client.ts

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



📝 Walkthrough

Walkthrough

Imports and test mocks across the renderer now target dedicated runtime file client modules for operations such as reading, mutation, importing, searching, metadata, routing, and watching. The consolidated runtime-file-client.ts re-export module was deleted. The changed import paths and mock behavior do not show changes to the underlying runtime operations.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to fe265

This change redirects imports after removing a re-export module; no user-visible behavior change or concrete failure is established, so it is mergeable after normal checks.

Pre-merge checks | Passed 4 | Inconclusive 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 50 files. (85 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: removing the renderer runtime-file-client barrel.
Description check Passed The description follows the required structure and explains the change, rationale, scope, visual impact, testing, and review status. It identifies the linked issue as an internal cleanup instead of pr…
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: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 50 files. (85 skipped: 85 over the file limit.)


✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • 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.

@OrcaWin
OrcaWin merged commit 5763792 into main Oct 12, 2026
82 of 83 checks passed
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.

1 participant