Skip to content

refactor(renderer): delete dead owner and settings shims - #27430

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-0-6
Oct 11, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-0-6

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 $\color{#cf222e}{\Huge{\mathbf{−}}}$​124 $\color{#cf222e}{\Huge{\mathbf{−}}}$​98
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7 $\color{#cf222e}{\Huge{\mathbf{−}}}$​158 $\color{#cf222e}{\Huge{\mathbf{−}}}$​151

ELI5

Some helper functions in the app's window code were left behind when the old way of picking "which machine runs this workspace" was retired. Nothing in the shipped app uses their results any more. This PR deletes them. The app behaves exactly the same.

What Changed

Before and after, as a user sees it: no difference.

What is removed (named exports only; every file that still has live code stays):

  • resolve-owner.ts: resolveOwnerWithLegacyFocus, its counter getLegacyFocusFallbackCount, and resetLegacyFocusFallbackCountForTest. Only tests called them. resolveOwner and runtimeTargetForWorkspaceOwner are unchanged.
  • worktree-owner-settings.ts: trySettingsForWorktreeOwner, which had no caller. With it goes settingsForWorktreeOperationRoute in worktree-operation-route.ts, whose only caller it was.
  • worktree-runtime-owner.ts: getSettingsForWorktreeRuntimeOwner, which only tests and two stale test mocks named. Its tests now assert getRuntimeEnvironmentIdForWorktree, the function it wrapped. The cases are the same.
  • repo-runtime-owner.ts: getRepoOwnerRoutedSettings and releaseRepoRuntimeOwnerSettingsCache. The first had one caller, use-work-item-source-foundation.ts, which put the result in a field nothing read. That field, and the settings subscription that fed only it, are gone. The second was test-only. getSettingsForRepoRuntimeOwner, its cache and its identity tests stay; a later PR changes those.
  • unstamped-non-local-row-counter.ts (whole file). This was a counter for diagnostics. worktreeMatchesHost added to it, but nothing ever read it outside tests. The match results are unchanged, and the existing match table still checks all of them.
  • The focus-read ratchet baseline drops by 3. That is the reads which went away with the deleted code.

Net lines: production −151 (+7/−158, including the baseline file), tests −98 (+26/−124).

Why

This is Phase 3.99 Wave 0 cleanup. Each of these helpers still looked like a live way to route an operation by the focused server. Leaving them around invites new callers. Deleting them makes the real paths (resolveOwner, getRuntimeEnvironmentIdForWorktree, getSettingsForRepoRuntimeOwner) the only ones. I deleted named exports, not whole files: resolve-owner.ts and worktree-owner-settings.ts have many live importers.

Proof the code is dead: rg for every removed name over the whole repo (src, config, scripts, tests, mobile, packages, including @ts-nocheck files) returns nothing. pnpm tc and pnpm run build:electron-vite (the renderer bundle) both pass.

Linked Issue

N/A (maintainer cleanup, Phase 3.99 Wave 0).

Visual Proof

N/A: nothing visible changes. Only dead code is removed.

Testing

  • pnpm tc, oxlint, pnpm run check:code-quality:changed, pnpm lint (focus-read ratchet pruned lower), pnpm run build:electron-vite

  • pnpm test on resolve-owner, repo-runtime-owner, worktree-runtime-owner, worktree listing slice, new-workspace, delete-worktree hydration, startup-draft-input-kind, RepositoryGitHubAccountSection: 34 files, 398 tests pass

  • I manually tested these changes locally

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

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

Security, Windows, Linux, Mac, SSH, mobile: nothing changes. No wire, IPC or persisted shape is touched. Every routing decision (local, SSH target, paired runtime, folder workspaces) goes through the same functions as before.

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 11, 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: 9367c0a0-611f-41bf-aa95-150d4bd8e38d

📥 Commits

Reviewing files that changed from the base of the PR and between e3d747b and fdfc940.


📒 Files selected for processing (16)
  • config/focus-setting-read-baseline.txt
  • src/renderer/src/components/new-workspace/use-work-item-source-foundation.ts
  • src/renderer/src/components/settings/RepositoryGitHubAccountSection.test.tsx
  • src/renderer/src/components/sidebar/delete-worktree-dirty-change-hydration.test.tsx
  • src/renderer/src/lib/repo-runtime-owner.test.ts
  • src/renderer/src/lib/repo-runtime-owner.ts
  • src/renderer/src/lib/resolve-owner.test.ts
  • src/renderer/src/lib/resolve-owner.ts
  • src/renderer/src/lib/startup-draft-input-kind.test.ts
  • src/renderer/src/lib/unstamped-non-local-row-counter.ts
  • src/renderer/src/lib/worktree-operation-route.ts
  • src/renderer/src/lib/worktree-runtime-owner.test.ts
  • src/renderer/src/lib/worktree-runtime-owner.ts
  • src/renderer/src/store/slices/worktrees/listing/worktree-host-ownership-unstamped.test.ts
  • src/renderer/src/store/slices/worktrees/listing/worktree-host-ownership.ts
  • src/renderer/src/store/slices/worktrees/listing/worktree-owner-settings.ts

💤 Files with no reviewable changes (8)
  • src/renderer/src/lib/unstamped-non-local-row-counter.ts
  • src/renderer/src/lib/startup-draft-input-kind.test.ts
  • src/renderer/src/components/settings/RepositoryGitHubAccountSection.test.tsx
  • src/renderer/src/components/sidebar/delete-worktree-dirty-change-hydration.test.tsx
  • src/renderer/src/lib/worktree-operation-route.ts
  • src/renderer/src/lib/worktree-runtime-owner.ts
  • src/renderer/src/lib/repo-runtime-owner.ts
  • src/renderer/src/store/slices/worktrees/listing/worktree-owner-settings.ts

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



📝 Walkthrough

Walkthrough

The change removes repository- and worktree-specific settings-routing helpers and updates their consumers and tests. It also removes the focus-based owner resolver and unstamped-row counter. For unhosted worktrees, host matching now returns the configured match option directly; defaults remain false for runtime and other non-local hosts and true for local hosts.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to fdfc9

This cleanup removes unused owner-routing helpers and legacy tracking without changing the active routing paths inspected. No merge-blocking user-facing behavior change is established.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 7 files. (1 skipped: 1… 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 unused renderer owner and settings helpers.
Description check Passed The description is complete and aligned with the template. It explains the change, rationale, scope, testing, visual impact, platform considerations, and checklist status. The maintainer cleanup corre…
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 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 7 files. (1 skipped: 1 unsupported.)


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

@OrcaWin
OrcaWin merged commit 2148111 into main Oct 11, 2026
37 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