Skip to content

Fix paired web Add Project folder browsing - #13885

Merged
Jinwoo-H merged 3 commits into
mainfrom
fix-paired-web-folder-browser
Aug 12, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
fix-paired-web-folder-browser

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Treat the paired runtime as the Add Project filesystem authority in web clients and remove the misleading viewer-local “Local Mac” option.
  • Route Browse folder through the existing in-app host filesystem browser; manual host paths, clone, and create continue to use the selected runtime.
  • Preserve desktop-local and SSH behavior without changing remote wire contracts.

Screenshots

Paired-web Add Project journey (recorded from the passing separate-window Playwright/CDP regression):

[email protected]

Live $electron CDP validation of the same PR head confirms desktop behavior is preserved: the isolated dev instance still presents Local Mac and the native Browse folder action.

Desktop Add Project remains local

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test — focused and routing suites run instead
  • pnpm build — exercised by the E2E-mode Electron/web build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Additional validation:

  • Focused paired-authority suite: 6 files, 29 tests
  • Active-server routing gate: 11 files, 376 tests
  • Add Project/owner routing suite: 19 files, 428 tests
  • pnpm run test:e2e:multi-client-navigation: 2 passed
  • Visual-proof rerun: 3 consecutive paired-web passes
  • $electron live CDP attach to the exact worktree identity, rendered desktop inspection, and full-window screenshot
  • Changed-code quality, React Doctor, reliability-gate manifest, max-lines ratchet, and diff checks

AI Review Report

Reviewed the viewer-to-host authority chain, explicit SSH selection, desktop-local behavior, folder workspaces, and mixed-version failure behavior. The regression assertions cover the native picker non-call, in-app host browser rendering, and repo.add dispatch to the selected paired runtime. No implementation issue remained after the review.

Cross-platform review found no new shortcut, label, shell, or path-separator behavior. Existing host path values stay opaque to the viewer and are interpreted by the selected macOS, Linux, Windows, or SSH runtime; native Electron folder picking remains desktop-local only.

Security Audit

No new dependencies, auth handling, command execution, filesystem APIs, or IPC/RPC shapes were added. Host paths continue through the existing runtime-scoped browse and add APIs, and paired web cannot fall back to the viewing computer’s native picker. No secrets or credentials are introduced or logged.

Notes

There are no remote wire changes. An older host without directory browsing support fails visibly in the in-app browser while manual host-path entry remains available; it never falls back to the viewer filesystem.

@Jinwoo-H
Jinwoo-H force-pushed the fix-paired-web-folder-browser branch from cb8b637 to eb61548 Compare August 11, 2026 23:14
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds paired-runtime support for repository browsing and addition in web clients. Web clients now exclude local hosts and select a paired runtime by default. Browse actions route through a host-aware dispatcher for local, runtime, and SSH hosts. Actions remain disabled when no host is selected. Tests cover rendering, routing, submission, reliability gates, and end-to-end multi-client navigation.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 identifies the main change: fixing Add Project folder browsing for paired web clients.
Description check ✅ Passed The description clearly explains the change, rationale, visual behavior, testing, compatibility, and security impact.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/components/sidebar/use-add-repo-host-selection.ts (1)

68-78: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Final host fallback is not web-client-aware.

If selectableHostOptions is empty for a web client (for example, before the paired runtime host loads), every branch in this fallback chain fails and selectedHostId defaults to LOCAL_EXECUTION_HOST_ID on Line 78 and again in the effect on Line 96. That id is excluded from selectableHostOptions for web clients, so selectedParsedHost becomes { kind: 'local' } even though no local host is offered. routeAddRepoBrowse in add-repo-browse-authority.ts then calls browseLocal, which relies on a native picker not available in a browser context.

Guard both fallbacks so they never resolve to LOCAL_EXECUTION_HOST_ID when isWebClient is true.

🐛 Proposed fix
-  const selectedHostId = selectedHost?.id ?? LOCAL_EXECUTION_HOST_ID
+  const selectedHostId =
+    selectedHost?.id ?? (isWebClient ? undefined : LOCAL_EXECUTION_HOST_ID) ?? LOCAL_EXECUTION_HOST_ID

Apply the equivalent guard to the effect's fallback on Line 96, or route both through one shared helper that returns undefined/an explicit "no host" state instead of LOCAL_EXECUTION_HOST_ID for web clients.

Also applies to: 90-97


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a738179a-b96f-4790-94a5-a0e1f2d4c884

📥 Commits

Reviewing files that changed from the base of the PR and between 234caec and eb61548.

📒 Files selected for processing (9)
  • config/reliability-gates.jsonc
  • src/renderer/src/components/sidebar/AddRepoDialog.tsx
  • src/renderer/src/components/sidebar/AddRepoDialogStepContent.test.tsx
  • src/renderer/src/components/sidebar/add-repo-browse-authority.test.ts
  • src/renderer/src/components/sidebar/add-repo-browse-authority.ts
  • src/renderer/src/components/sidebar/use-add-repo-host-selection.test.ts
  • src/renderer/src/components/sidebar/use-add-repo-host-selection.ts
  • src/renderer/src/store/slices/repos-paired-runtime-add.test.ts
  • tests/e2e/multi-client-navigation-isolation.spec.ts

@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

Addressed the web-client fallback finding in f56d4a0. While a paired host is still loading, the selection now has an explicit no-host state instead of resolving to the local execution host; Browse, Clone, and Create cannot invoke client-local behavior. Added a focused regression test and reran typecheck, lint, packaging, and the full CI suite.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e1bc7ebf-2da1-44c4-8706-1bc3864561a5

📥 Commits

Reviewing files that changed from the base of the PR and between f56d4a0 and 1a22831.

📒 Files selected for processing (5)
  • config/reliability-gates.jsonc
  • src/renderer/src/components/sidebar/AddRepoDialog.tsx
  • src/renderer/src/components/sidebar/AddRepoDialogStepContent.tsx
  • src/renderer/src/components/sidebar/AddRepoStartSteps.test.tsx
  • src/renderer/src/components/sidebar/AddRepoStartSteps.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/renderer/src/components/sidebar/AddRepoDialog.tsx
  • config/reliability-gates.jsonc

}: AddRepoLocalStartStepProps): React.JSX.Element {
const browseActionRef = useRef<HTMLButtonElement | null>(null)
const actionsRef = useRef<HTMLDivElement | null>(null)
const actionsUnavailable = isAdding || actionsDisabled

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not intercept host-selector arrow keys while actions are unavailable.

hostSelector is inside the actionsRef container, but handleArrowNavigation still processes ArrowUp and ArrowDown when actionsUnavailable is true. It calls preventDefault() and attempts to focus disabled action buttons because the active element is not an action button. This can prevent keyboard users from opening or navigating the host selector while they must select a host.

Return when actionsUnavailable is true, and ignore events when the active element is not a button[data-add-repo-action]. Add a regression test for this state.

Suggested guard
 const handleArrowNavigation = (event: React.KeyboardEvent<HTMLDivElement>): void => {
+  if (actionsUnavailable) {
+    return
+  }
   if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') {
     return
   }
   ...
   const currentIndex = buttons.indexOf(document.activeElement as HTMLButtonElement)
+  if (currentIndex < 0) {
+    return
+  }

@Jinwoo-H
Jinwoo-H merged commit fd2afc1 into main Aug 12, 2026
47 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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