Skip to content

refactor(renderer): fold activation mirroring and sort-order persistence off the deprecated owner resolver - #30484

Merged
nwparker merged 1 commit into
mainfrom
nwparker/r3-f4-mirroring-sort-order
Oct 19, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/r3-f4-mirroring-sort-order

Conversation

@nwparker

@nwparker nwparker commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​53 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​72 $\color{#cf222e}{\Huge{\mathbf{−}}}$​31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​41

ELI5

When you switch tabs or workspaces, Orca tells the paired server that owns the workspace so other windows follow along, and when you reorder the sidebar it saves the order on each owner. Those nine places asked an old "which server owns this?" helper that is being retired. They now ask the replacement. The sort-order save also stops writing ids it cannot place to a guessed host.

What Changed

  • Mirroring (callers Lint long files (and add TS skills) #23–Fix terminal padding with small inset #30): tab-group activation, tab-number shortcuts, the tab palette, terminal-tab owner activation, structured agent-session activation, worktree activation, pin/view-mode mirroring and web tab moves read the owner through runtimeEnvironmentIdWithLegacyFallbackUnlessTwin. A workspace two hosts publish is still not mirrored, as before; only the deliberate rows of the round-3 acceptance table change (folder twins and rival servers are not mirrored to the focused server, and a worktree whose only repo row is a server proxying its SSH target mirrors through that server).
  • Sort-order persistence (Fix Ctrl+Backspace not deleting word in terminal #2): splitWorktreeSortOrderByHost reads resolveOwnerWithLegacyFallback and leaves an id out of every host's write when
    • two hosts publish it (before: written to this desktop's meta), or
    • its only server proof is a repo row (isUnprovenServerSshRoute, new in resolve-owner.ts): the worktree row says ssh:X but names no server, while a server's repo row proxies an X in its own namespace, which may be a different machine (before: written to this desktop's meta).
  • isUnprovenServerSshRoute is the shared check the round-3 design (§4, case C) names for host writes; F7 reuses it for file writes.
  • Focus-read baseline: worktree-sort-order-persistence.ts +1, annotated. Its split helper calls the legacy-fallback adapter directly, which the ratchet now counts (refactor(renderer): fold 13 sidebar, hook and chat readers off the deprecated owner resolver, and count the adapter as a focus read #30478); F8 removes the legacy branch.
  • Deprecated-resolver importers: 40 → 31.

Stacked on #30478.

Why

Mirroring is a best-effort notification; "no server" for a twin was already the old answer and stays the safe one. Sort order is a write to a host's metadata, so the design says a twin or an unproven server route refuses rather than guessing; leaving the id out loses only its saved position, while writing it to the wrong host pollutes that host's metadata.

Linked Issue

Round 3 of the SSH/remote hardening (S6(b) F4). No single issue.

Visual Proof

N/A: no UI change; ownership routing only.

Testing

  • New: sort-order split leaves out a twin and a stale-server-stamp row, and keeps a properly stamped server-nested row (fails before).

  • pnpm test single worker over src/renderer/src/lib, components/tab-group, components/tab-bar, store/slices/tabs, runtime, components/sidebar.

  • Full local copy of the pr.yml static job.

  • ssh-orcad Docker lane dispatched on the exact head (link in a comment).

  • Live verification: unit-tested only.

  • I manually tested these changes locally

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

AI Disclosure

Review

Codex (gpt-6.1-sol, high): see comment.

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

SSH: only the twin, rival-server and stale-server-stamp rows change. Wire: none (same worktree.persistSortOrder calls, fewer ids for unplaceable rows). Cross-platform: none.

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)

…nce off the deprecated owner resolver

The eight mirroring callers (#23-#30) read the owner through
runtimeEnvironmentIdWithLegacyFallbackUnlessTwin, so a twin is still not mirrored. Sort-order
persistence (#2) leaves out ids that two hosts publish, and ids whose only server proof is a repo
row (isUnprovenServerSshRoute), instead of writing them to this desktop's or a guessed server's
meta. Deprecated importers 40 -> 31.
@nwparker
nwparker force-pushed the nwparker/r3-f4-mirroring-sort-order branch from 651ebfd to 4367113 Compare October 19, 2026 02:47
@nwparker
nwparker requested a review from Jinwoo-H as a code owner October 19, 2026 02:47
@nwparker
nwparker changed the base branch from nwparker/r3-f2-right-sidebar-folds to main October 19, 2026 02:47
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e07cbad0-3357-4096-8031-afb16b01e4e9
📥 Commits

Reviewing files that changed from the base of the PR and between 76f9978 and 4367113.

📒 Files selected for processing: 17
  • config/deprecated-runtime-owner-importers-baseline.txt
  • config/focus-setting-read-baseline.txt
  • src/renderer/src/components/tab-bar/web-runtime-tab-move-mirror.ts
  • src/renderer/src/components/tab-group/useTabGroupActivationCommands.ts
  • src/renderer/src/lib/resolve-owner.ts
  • src/renderer/src/lib/structured-agent-session-tab-activation.test.ts
  • src/renderer/src/lib/structured-agent-session-tab-activation.ts
  • src/renderer/src/lib/tab-number-shortcuts.ts
  • src/renderer/src/lib/terminal-tab-owner-activation.test.ts
  • src/renderer/src/lib/terminal-tab-owner-activation.ts
  • src/renderer/src/lib/workspace-tab-palette-activation.test.ts
  • src/renderer/src/lib/workspace-tab-palette-activation.ts
  • src/renderer/src/lib/worktree-activation.ts
  • src/renderer/src/lib/worktree-sort-order-host-split.test.ts
  • src/renderer/src/lib/worktree-sort-order-host-split.ts
  • src/renderer/src/runtime/web-runtime-session.test.ts
  • src/renderer/src/store/slices/tabs/tabs-host-mirroring.ts
  • 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.

@nwparker

Copy link
Copy Markdown
Contributor Author

Codex (gpt-6.1-sol, high): no findings (reviewed against the F2 branch; the rebase onto main left the diff unchanged). pr.yml 39191606808 success and ssh-orcad Docker lane 39191605424 (Docker 1/2, 2/2) success on the exact head 4367113. Local static job: 0 failures on that head. Units: 1,484 files single-worker.

@nwparker
nwparker merged commit f951cf4 into main Oct 19, 2026
53 of 73 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