Skip to content

Show setup-needed hosts in workspace run picker - #7835

Merged
OrcaWin merged 9 commits into
mainfrom
Jinwoo-H/create-workspace-host-2
Jul 22, 2026
Merged

OrcaWin merged 9 commits into
mainfrom
Jinwoo-H/create-workspace-host-2

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Show the Run on picker when a ready project setup has setup-needed hosts or VM recipes to explain.
  • Render setup-needed hosts as disabled run target rows using their existing label and detail text, with unavailable hosts visually distinguished by the existing warning icon.
  • Preserve hidden filters for runtime-owned SSH and ephemeral VM hosts, plus the single-ready-only hidden-row behavior.
  • Deliberately leaves the actionable setup-on-host flow as a follow-up.

Context

Slack feedback: a user with an SSH target could not find a way to choose an SSH machine during worktree creation because the project only existed locally. This makes that SSH host discoverable as needing project setup before it can be selected.

Screenshots

  • Missing: I could not capture before/after dev-app screenshots from this session.

Validation

  • pnpm typecheck passed. This shell prints an unsupported-engine warning because it is on Node 26 and the repo wants Node 24.
  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/project-host-setup-options.test.ts src/renderer/src/components/NewWorkspaceComposerCard.test.tsx passed.
  • pnpm exec oxlint src/renderer/src/components/NewWorkspaceComposerCard.tsx src/renderer/src/components/NewWorkspaceComposerCard.test.tsx src/renderer/src/lib/project-host-setup-options.test.ts passed.
  • pnpm check:max-lines-ratchet passed. Same Node 26 unsupported-engine warning.
  • pnpm exec vitest run --config config/vitest.config.ts failed in unrelated localStorage-dependent happy-dom tests under this Node 26 shell: pr-comment-presentation.test.ts, pr-comments-list-selection.test.tsx, LinearAgentSkillSetupPrompt.reminder-toast.test.tsx, and SidebarToolbar.test.tsx.

Made with Orca 🐋

@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change extends the workspace run target picker to accept setup-needed hosts, render them as disabled rows, and show the picker when ready hosts, setup-needed hosts, or ephemeral recipes exist. Host availability now uses host health before runtime capability checks. It also adds add-host actions from the picker and wires new settings navigation intents through SshPane and RuntimeEnvironmentsPane. Tests were updated for picker behavior and host availability cases.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely matches the main change: showing setup-needed hosts in the workspace run picker.
Description check ✅ Passed The description covers the summary, context, screenshots, and validation, but it omits the AI review, security audit, notes, and checklist-style testing section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

@Jinwoo-H

Jinwoo-H commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up from screenshot review: setup-needed run target rows now respect host health before setup state. Disconnected hosts show Connect this host to set up projects, connecting hosts show Connecting to host, and error hosts show Host connection needs attention instead of incorrectly saying Project not set up on this host.

Latest validation:

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/project-host-setup-options.test.ts src/renderer/src/components/NewWorkspaceComposerCard.test.tsx passed (31 tests).
  • pnpm exec oxlint src/renderer/src/lib/project-host-setup-options.ts src/renderer/src/lib/project-host-setup-options.test.ts src/renderer/src/components/NewWorkspaceComposerCard.tsx src/renderer/src/components/NewWorkspaceComposerCard.test.tsx passed.
  • pnpm typecheck passed (Node 26 shell still prints the repo engine warning for Node 24).
  • pnpm check:max-lines-ratchet passed.

@Jinwoo-H

Jinwoo-H commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Added the follow-up affordance from review: the Run on picker now includes an Add host handoff with secondary actions for Add SSH host and Add Remote Orca Server.

Details:

  • The picker now remains visible with a single ready host because the dropdown has a real second action: adding/registering another host.
  • Add SSH host deep-links to Settings > SSH Hosts and opens the existing Add Target form.
  • Add Remote Orca Server deep-links to Settings > Remote Orca Servers and opens the existing Add Server pairing form.
  • No new clone/setup-on-host flow was added; this is still a handoff to existing host registration surfaces.

Latest validation:

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/project-host-setup-options.test.ts src/renderer/src/components/NewWorkspaceComposerCard.test.tsx passed (33 tests).
  • Changed-file pnpm exec oxlint ... passed.
  • pnpm typecheck passed (Node 26 shell still prints the repo engine warning for Node 24).
  • pnpm check:max-lines-ratchet passed.

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

🧹 Nitpick comments (1)
src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx (1)

273-273: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate intent-signal logic — reuse the existing hook instead of reimplementing it.

This effect reimplements the exact same "consume a numeric intent signal once" pattern that useSshAddTargetIntent already extracts in SshPane.tsx/use-ssh-add-target-intent.ts (see consumedAddTargetIntentSignalRef + effect there). Consider generalizing that hook (e.g. rename to useAddIntentSignal and drop the SSH-specific name) and reuse it here instead of duplicating the ref + effect logic.

♻️ Proposed refactor
-  const consumedAddServerIntentSignalRef = useRef(0)
+  // reuse a generalized version of useSshAddTargetIntent, e.g.:
+  // useAddIntentSignal(addServerIntentSignal, () => setAddServerFormOpen(true))
-  useEffect(() => {
-    if (
-      !addServerIntentSignal ||
-      consumedAddServerIntentSignalRef.current === addServerIntentSignal
-    ) {
-      return
-    }
-    consumedAddServerIntentSignalRef.current = addServerIntentSignal
-    // Why: composer deep-links should land on the existing pairing form, not just
-    // the server list.
-    setAddServerFormOpen(true)
-  }, [addServerIntentSignal])
+  // Why: composer deep-links should land on the existing pairing form, not just
+  // the server list.
+  useAddIntentSignal(addServerIntentSignal, () => setAddServerFormOpen(true))

Also applies to: 384-396


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6b84ab0d-7557-419c-b16b-a696725a4868

📥 Commits

Reviewing files that changed from the base of the PR and between fe984e7 and 4a9577c.

📒 Files selected for processing (7)
  • src/renderer/src/components/NewWorkspaceComposerCard.test.tsx
  • src/renderer/src/components/NewWorkspaceComposerCard.tsx
  • src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx
  • src/renderer/src/components/settings/Settings.tsx
  • src/renderer/src/components/settings/SshPane.tsx
  • src/renderer/src/components/settings/use-ssh-add-target-intent.ts
  • src/renderer/src/store/slices/ui.ts
✅ Files skipped from review due to trivial changes (1)
  • src/renderer/src/components/settings/use-ssh-add-target-intent.ts

@Jinwoo-H

Jinwoo-H commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up update:

  • Added a subtle text-only Connect button on disconnected/error setup-needed run-target rows. The host row itself stays greyed out/disabled and remains non-selectable.
  • SSH rows call window.api.ssh.connect; runtime rows re-probe status and update runtimeStatusByEnvironmentId so host health can refresh.
  • Still no setup-on-host/clone flow here; that remains the deliberate follow-up after the host is reachable.

Checks on this commit:

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/project-host-setup-options.test.ts src/renderer/src/components/NewWorkspaceComposerCard.test.tsx passed (40 tests).
  • Changed-file oxlint passed.
  • pnpm typecheck passed; local environment still warns repo wants Node 24 while current Node is v26.0.0.
  • pnpm check:max-lines-ratchet passed.
  • Full pnpm exec vitest run --config config/vitest.config.ts was attempted on the final code but stopped after unrelated environment failures cascaded: Node 26 localStorage warnings at the start, then many temp-heavy tests failed with ENOSPC: no space left on device.

No new screenshots attached from this follow-up; I did not run the dev app after the styling tweaks.

@Jinwoo-H

Jinwoo-H commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Small UI follow-up from screenshot review:

  • Made the idle Connect action more muted (muted-foreground/50) so it matches the greyed-out setup-needed rows until hover.
  • Closed the run-target popover before firing the connect action so the SSH password prompt does not stack with the dropdown.
  • Added a regression assertion that clicking Connect does not select the disabled row and closes the dropdown.

Checks:

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/NewWorkspaceComposerCard.test.tsx src/renderer/src/lib/project-host-setup-options.test.ts passed (40 tests).
  • Changed-file oxlint passed.
  • pnpm typecheck passed; local Node 26 still warns that the repo wants Node 24.
  • pnpm check:max-lines-ratchet passed.

Jinwoo-H and others added 4 commits July 9, 2026 02:32
Run-target picker:
- Group not-connected hosts under a separator (no "Not connected" heading);
  reserve the alarm icon for genuine health:'error', neutral icon otherwise.
- Make not-connected rows hoverable and open the recipe/add-host submenus on
  hover; add a separator before the environment/add-host actions.
- Disable only the in-flight host's Connect button (Set of connecting ids) and
  add a UI connect timeout so one stalled connect can't lock out the others.

Add-host from the composer:
- Open SSH / remote-server add as an inline dialog layered over the composer
  instead of navigating to Settings, so the in-progress form is preserved; the
  new host flows back into the picker via the store.
- Fix a close-animation flicker where the dialog briefly showed the SSH form.
- Expose the full SSH advanced options (proxy, jump host, connection reuse,
  terminal persistence) under one combined Advanced disclosure, shared with the
  Settings SSH form via a new SshHostAdvancedFields; remove the now-orphaned
  Settings section components.

Setup-script section:
- Neutral (non-green) code preview, single orca.yaml source chip, consistent
  rounded-md corners, run-setup as a toggle, combined into one box; disable the
  wait-for-setup toggle when setup won't run.
- Fix the whole setup section vanishing on toggle by keying the yaml-hooks load
  effect on the runtime-env id instead of the churny selectedRepoSettings object,
  and stop the wait-for-setup toggle flicker by syncing on the persisted value.

Sparse checkout dropdown:
- Rebuild the list on cmdk Command/CommandItem to match the other pickers, and
  give the preset draft form the app's standard inputs + opaque bg-popover.

Advanced disclosure: fix the highlight clipping / left-alignment in the scroll
container.
Clicking Connect on a not-connected host no longer closes the dropdown and snaps
back to the previous selection. The picker stays open, the row's icon becomes a
spinner, and the button shows "Connecting…" while the connect is in flight — the
row then updates in place from store SSH state once it resolves (or the button
returns to "Connect" on failure so the user can retry).
The run-picker Connect spinner never stopped when a connect failed. Root cause:
the `mountedRef` guard around the clearing setState. The ref's effect only set
it false on cleanup and never back to true on mount, so StrictMode's dev
mount→unmount→remount left it stuck false — the connect `finally` then skipped
clearing connectingHostIds and the row spun forever even after the error toast.

Remove the unnecessary mounted-guard entirely (a stale setState is a harmless
no-op in React 18) so the in-flight id is always cleared when the connect
settles. Add a regression test for the failed-connect path.
…pace-host-2

# Conflicts:
#	src/renderer/src/components/NewWorkspaceComposerCard.tsx
#	src/renderer/src/components/settings/SshPane.tsx
@OrcaWin
OrcaWin merged commit e600600 into main Jul 22, 2026
1 check passed
@AmethystLiang AmethystLiang added the orca-remote-server Remote Orca Server / orca serve / paired remote runtime label Jul 22, 2026
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

orca-remote-server Remote Orca Server / orca serve / paired remote runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants