Repository navigation
Keep explorer file watches on the selected remote host - #26616
Conversation
c06c5fb to
d097934
Compare
d097934 to
e0d99fa
Compare
bdc7f68 to
f092245
Compare
e0d99fa to
53d0e31
Compare
f092245 to
9b2a67c
Compare
53d0e31 to
0f6dfc4
Compare
9b2a67c to
f895e39
Compare
0f6dfc4 to
810c5ef
Compare
bb075c3 to
21737a8
Compare
16eb5c0 to
0bb7200
Compare
📝 WalkthroughWalkthroughExplorer watch-owner resolution now receives the active worktree and workspace execution host identifiers. Tests cover worktree and folder workspaces with repeated IDs across hosts. A new Docker-gated E2E test checks explorer contents and file changes for selected SSH hosts. CI routing and the Docker conversion workflow now include the selected-host spec. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to The selected-host behavior has no established production defect, but the cross-host test may miss a delayed incorrect update. Strengthen the test before relying on it for this regression. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)✅ Passed checks (3 passed)Full details: Description checkExplanation The description is detailed and covers the change, rationale, visual proof, testing, review notes, and checklist. However, the required Linked Issue section does not provide an issue reference and explicitly states that no existing issue exists. Full details: Docstring CoverageExplanation 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 5 functions across 7 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/ssh-orcad-explorer-selected-host.spec.ts (1)
190-190: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winWait for explorer processing before checking the negative case.
The console wait alone does not close this gap. The test installs its logger before selecting the host, so it can observe dispatch before the explorer listener. Even after moving the logger, the explorer schedules refresh work after the console message.
Wait for the other-host event after the selected tree is ready. Then use the existing selected-host deletion update as a later explorer synchronization point before asserting that
OTHER_HOST_ONLY.txtremains absent.Suggested test synchronization
- await page.evaluate(() => { - window.addEventListener('orca:worktree-file-change', (event) => { - if (event instanceof CustomEvent) { - console.log('[file-change-event]', JSON.stringify(event.detail)) - } - }) - }) const worktreeId = folderWorkspaceKey(folderId) ... await expect( page.getByText(`INITIAL_${selectedHost === 'A' ? 'B' : 'A'}.txt`, { exact: true }) ).toHaveCount(0) + await page.evaluate(() => { + window.addEventListener('orca:worktree-file-change', (event) => { + if (event instanceof CustomEvent) { + console.log('[file-change-event]', JSON.stringify(event.detail)) + } + }) + }) ... const otherHost = selectedHost === 'A' ? hostB : hostA + const otherEnvironmentId = selectedHost === 'A' ? environmentB.id : environmentA.id + const otherHostChanged = page.waitForEvent('console', { + predicate: (message) => + message.text().startsWith('[file-change-event]') && + message.text().includes('OTHER_HOST_ONLY.txt') && + message.text().includes(otherEnvironmentId), + timeout: 15_000 + }) otherHost.exec?.(`printf 'other host\n' > '${folderPath}/OTHER_HOST_ONLY.txt'`) - await expect(page.getByText('OTHER_HOST_ONLY.txt', { exact: true })).toHaveCount(0) + await otherHostChanged host.exec?.(`rm '${folderPath}/${marker}'`) await expect(page.getByText(marker, { exact: true })).toHaveCount(0, { timeout: 10_000 }) + await expect(page.getByText('OTHER_HOST_ONLY.txt', { exact: true })).toHaveCount(0)
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
89cf09c2-b0bd-404d-bf8c-10668985a1b6
📒 Files selected for processing (8)
.github/workflows/e2e.ymlconfig/scripts/ci-e2e-job-selection.mjsconfig/scripts/ci-e2e-job-selection.test.mjsconfig/scripts/pr-e2e-source-routing.mjssrc/renderer/src/components/right-sidebar/file-explorer-operation-owner.tssrc/renderer/src/components/right-sidebar/file-explorer-watch-selected-host.test.tssrc/renderer/src/components/right-sidebar/useFileExplorerWatch.tstests/e2e/ssh-orcad-explorer-selected-host.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
ELI5
Two remote machines can have the same folder or worktree ID. The explorer now listens to the machine you selected, so its new files appear and removed files disappear.
What Changed
Before, the selected host could return a correct directory listing and publish a real file event, yet the explorer stayed stale. Its watch-owner snapshot discarded the active workspace and host before calling the existing ownership resolver, so repeated IDs could no longer be resolved to the displayed tree's owner.
The snapshot now preserves those two fields. Existing checks still reject events from another host or a listing owned by the previous selection.
Why
The selected host is already authoritative identity in Orca's shared owner resolver. Passing it through fixes the missing evidence without guessing from global runtime focus or adding another ownership algorithm.
Linked Issue
Found during SSH → Remote consolidation testing; no existing issue.
Visual Proof
Both independently converted Linux hosts publish the same folder ID from separate valid profiles. Each baseline gets the selected host's initial listing, positive file read and actual app event, but omits its new file. Both corrected journeys display the new file and then remove it after an external deletion.
selected-host-explorer-runtime-red.log
selected-host-explorer-runtime-green-final.log
Testing
Untouched Phase 3.5 fails for host A / B in 28.9 / 29.3 s. Final corrected cases pass in 19.9 / 20.0 s (41.6 s total). Each proves the selected host's initial sentinel, excludes the other host's sentinel, receives an actual host-qualified creation event, displays the file and follows its deletion.
Four new folder/worktree ownership regressions fail before the fix; the unrelated-workspace guard already passes. 246 tests / 15 files pass afterward, including existing route, generation, watcher, host ambiguity and CI contracts. Full
pnpm tc,pnpm lint, changed quality, standalone React Doctor, fresh E2E build and commit hooks pass.Combined stack verification: C18–C21 rebased on #26637/#26645 preserves their renderer changes exactly. 547 tests / 49 files, full typecheck/lint, changed quality (including React Doctor/design-system checks), a fresh E2E build and both real-host switch directions pass. CI reruns on the new head; prior green results are not claimed for it.
Review
Stacked on #26645, which is stacked on #26637. Merge #26637 → #26645 first. These exercised startup fixes support the shared real-host CI lane; this PR retains its original focused explorer change. The product change adds two snapshot fields and describes them in its checked owner-state type. The existing Docker-lane contract moved into a separate file to keep its size within the lint limit.
Agent skill upstream boundary
Notes
No server or remote wire change. Runtime coverage is macOS client / Linux SSH hosts; Windows was not exercised. All file writes target disposable owned fixtures. Watch recovery after a server restart and cache invalidation during an in-place host switch are separate concerns.
Checklist