Skip to content

Show local and remote Quick Commands by host - #13094

Merged
Jinwoo-H merged 4 commits into
mainfrom
quick-commands-remote-server
Aug 8, 2026
Merged

Jinwoo-H merged 4 commits into
mainfrom
quick-commands-remote-server

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor

Summary

  • keep controlling-client Quick Commands available in remote workspaces
  • preserve remote-host-specific command collections and route add/edit/delete to the owning host
  • label commands and save actions with canonical execution-host names such as Local Mac and Orca Server
  • capability-gate remote collections so older Orca servers degrade to local-only behavior
  • preserve the existing single-host UI when only local Quick Commands are available

Product behavior

Quick Command storage ownership is independent from command scope. A command can still be Global or project-scoped, while Saved on identifies the Orca host that owns the collection. Storage ownership also does not change execution context: choosing any saved command runs it in the terminal or workspace where it was invoked. This is what allows a client-owned command to run in a remote workspace.

No new wire protocol is introduced; this reuses the capability-gated settings.getTerminalQuickCommands and settings.updateTerminalQuickCommands RPCs.

Screenshots

Settings and tab-bar picker showing client- and server-owned command collections:

Paired remote workspace showing client- and server-owned Quick Commands

Terminal right-click menu showing both host collections and host-specific add actions:

Terminal right-click Quick Commands menu with Local Mac and Orca Server sections

Testing

  • pnpm lint
  • pnpm typecheck
  • full Node 24/26 CI test matrix
  • macOS and Windows package jobs
  • Added regression coverage for removed-host fallback, cached refresh failures, add-action host IDs, and capability/connection-generation gating
  • focused Quick Commands suite: 12 files, 76 tests passed
  • localization catalog and extraction verification
  • changed-file quality checks and React Doctor
  • max-lines ratchet and git diff --check

AI Review Report

Reviewed the host-selection lifecycle, stale-cache error handling, storage-host mutation routing, terminal execution semantics, runtime capability and connection-generation gates, localization keys, and add-action callback coverage. Fixed stale selection after a runtime is removed, added a persistent retryable refresh error while cached commands remain visible, replaced renderer keys with generated hashes, removed an unnecessary host-id assertion, and expanded regression tests.

The review explicitly checked macOS, Linux, and Windows compatibility. This follow-up changes no shortcuts, labels for modifiers, paths, shells, or Electron platform APIs; host IDs and runtime gates remain platform-neutral. SSH and folder workspaces continue to use the active terminal/workspace for execution and the selected Orca host only for command storage.

Security Audit

No new dependency, authentication, secret, path, shell-construction, IPC method, or wire payload was added. Remote reads and mutations remain behind the existing negotiated capability and parsed execution-host ID. Stale runtime generations are rejected before remote collections become visible, and unsupported servers degrade to the local collection without silently sending a mutation to another host.

Notes

  • Saved on describes collection ownership, not where a command executes. It only appears when multiple hosts are available.
  • Local-only workspaces retain the previous repo/global grouping and generic add action.
  • Older remote servers remain local-only until they advertise the existing Quick Commands capability.
  • The CodeRabbit request to route execution by storage host was intentionally not adopted because it would prevent local commands from running in remote terminals.

@Jinwoo-H
Jinwoo-H requested a review from brennanb2025 as a code owner August 7, 2026 22:00
@Jinwoo-H
Jinwoo-H force-pushed the quick-commands-remote-server branch from c226285 to 8b903c7 Compare August 7, 2026 22:07
@coderabbitai

coderabbitai Bot commented Aug 7, 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

Terminal quick commands now support local and runtime execution hosts. Host-specific commands load through a new store slice with runtime capability checks, caching, connection-generation validation, serialized mutations, and local settings persistence. Settings, terminal panes, context menus, and tab-bar menus now select hosts, filter repositories, display host labels, and route add, edit, delete, and run actions by host. Recent-command history accepts host-qualified identifiers. Tests and localization cover host ownership, loading states, runtime behavior, and host-specific actions.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.78% 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 and concisely describes the main change: displaying local and remote Quick Commands by host.
Description check ✅ Passed The description covers the required sections, user-visible behavior, screenshots, testing, AI review, security audit, and platform-specific notes.
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.

Actionable comments posted: 6

🧹 Nitpick comments (4)
src/renderer/src/hooks/use-terminal-quick-command-hosts.ts (1)

113-113: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use the parsed host id instead of a type assertion.

parsedExecutionHost.id is already narrowed to runtime:${string} when remoteEnvironmentId is non-null. Using it removes the cast.

♻️ Proposed refactor
-    const remoteHostId = executionHostId as `runtime:${string}`
+    const remoteHostId = parsedExecutionHost.id

Add parsedExecutionHost to the memo dependency list, or derive the id inside the memo from remoteEnvironmentId.

src/renderer/src/hooks/use-terminal-quick-command-hosts.test.ts (1)

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

Add coverage for the hook's host-gating logic.

The tests cover the two pure helpers. useTerminalQuickCommandHosts contains the capability gate and the connection-generation match at lines 106-112 of use-terminal-quick-command-hosts.ts. That logic decides whether the remote host appears at all. Add a rendered-hook test for these cases: supported === false, supported === true with a stale connectionGeneration, and the matching-generation case.

src/renderer/src/store/slices/terminal-quick-command-hosts.ts (1)

62-76: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Localize the quick-command save-error toast.

User-facing toast titles should come from translate; pass a catalog key instead of hardcoding 'Failed to save quick command'.

src/renderer/src/components/settings/QuickCommandsPane.tsx (1)

230-230: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Keep the new QuickCommandsPane locale keys consistent with this namespace.

s8 savedOn, unsupportedHost, loadFailed, retry, and loading exist in en.json, but they use semantic keys while the surrounding QuickCommandsPane keys use generated 10-character hashes. Replace these with the generated hash form or document the intentional mix.

Source: Learnings


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e27e8f22-1000-42f1-bc57-f98dcd7d957d

📥 Commits

Reviewing files that changed from the base of the PR and between 360c496 and c226285268fbc95da6d311515956ae3dcdf64e21.

📒 Files selected for processing (24)
  • src/renderer/src/components/settings/QuickCommandsPane.tsx
  • src/renderer/src/components/settings/Settings.tsx
  • src/renderer/src/components/settings/setting-ownership.test.ts
  • src/renderer/src/components/settings/setting-ownership.ts
  • src/renderer/src/components/tab-bar/TabBarQuickCommandAddActions.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandItem.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsMenu.keyboard.test.ts
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsMenu.tsx
  • src/renderer/src/components/terminal-pane/TerminalContextMenu.test.tsx
  • src/renderer/src/components/terminal-pane/TerminalContextMenu.tsx
  • src/renderer/src/components/terminal-pane/TerminalPane.tsx
  • src/renderer/src/hooks/use-terminal-quick-command-hosts.test.ts
  • src/renderer/src/hooks/use-terminal-quick-command-hosts.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/run-quick-command-in-new-tab.test.ts
  • src/renderer/src/lib/run-quick-command-in-new-tab.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/slices/diffComments.test.ts
  • src/renderer/src/store/slices/runtime-status.ts
  • src/renderer/src/store/slices/store-test-helpers.ts
  • src/renderer/src/store/slices/terminal-quick-command-hosts.test.ts
  • src/renderer/src/store/slices/terminal-quick-command-hosts.ts
  • src/renderer/src/store/types.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/settings/Settings.tsx

…-server

# Conflicts:
#	src/renderer/src/components/tab-bar/TabBarQuickCommandsMenu.tsx
#	src/renderer/src/components/terminal-pane/TerminalPane.tsx
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@Jinwoo-H
Jinwoo-H merged commit 6da7b8e into main Aug 8, 2026
45 checks 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 (2)
src/renderer/src/components/settings/QuickCommandsPane.tsx (1)

124-124: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Memoize hostOptions.

getTerminalQuickCommandHostOptions builds the execution-host registry on every render of the pane. Wrap it in useMemo keyed by settings and runtimeEnvironments. The value is consumed during render only, so memoization does not change behavior.

♻️ Proposed refactor
-  const hostOptions = getTerminalQuickCommandHostOptions(settings, runtimeEnvironments)
+  const hostOptions = useMemo(
+    () => getTerminalQuickCommandHostOptions(settings, runtimeEnvironments),
+    [runtimeEnvironments, settings]
+  )
src/renderer/src/components/tab-bar/hosted-terminal-quick-command-search.ts (1)

8-12: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Map results by index instead of object identity.

entryByCommand keys entries by the command object reference. If two hosts ever expose the same object instance, one entry is dropped from the results. An index-based mapping removes that coupling.

♻️ Proposed refactor
-  const entryByCommand = new Map(entries.map((entry) => [entry.command, entry]))
-  return searchTerminalQuickCommands(
-    entries.map((entry) => entry.command),
-    query
-  ).flatMap((command) => entryByCommand.get(command) ?? [])
+  const commands = entries.map((entry) => entry.command)
+  return searchTerminalQuickCommands(commands, query).flatMap((command) => {
+    const index = commands.indexOf(command)
+    return index === -1 ? [] : entries[index]
+  })

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1245ccea-9477-48eb-85db-ca96e6ffa81f

📥 Commits

Reviewing files that changed from the base of the PR and between 54a9b58 and 77a8ed4.

📒 Files selected for processing (32)
  • src/renderer/src/components/settings/QuickCommandsPane.test.ts
  • src/renderer/src/components/settings/QuickCommandsPane.tsx
  • src/renderer/src/components/settings/Settings.tsx
  • src/renderer/src/components/settings/setting-ownership.test.ts
  • src/renderer/src/components/settings/setting-ownership.ts
  • src/renderer/src/components/tab-bar/TabBarQuickCommandAddActions.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandHostLoadStatus.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandItem.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsMenu.keyboard.test.ts
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsMenu.tsx
  • src/renderer/src/components/tab-bar/hosted-terminal-quick-command-search.ts
  • src/renderer/src/components/tab-bar/use-tab-bar-quick-command-search-input.test.ts
  • src/renderer/src/components/tab-bar/use-tab-bar-quick-command-search-input.ts
  • src/renderer/src/components/terminal-pane/TerminalContextMenu.test.tsx
  • src/renderer/src/components/terminal-pane/TerminalContextMenu.tsx
  • src/renderer/src/components/terminal-pane/TerminalPane.tsx
  • src/renderer/src/components/terminal-pane/TerminalQuickCommandsSubmenu.tsx
  • src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts
  • src/renderer/src/hooks/use-terminal-quick-command-hosts.test.ts
  • src/renderer/src/hooks/use-terminal-quick-command-hosts.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/run-quick-command-in-new-tab.test.ts
  • src/renderer/src/lib/run-quick-command-in-new-tab.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/slices/diffComments.test.ts
  • src/renderer/src/store/slices/runtime-status.test.ts
  • src/renderer/src/store/slices/runtime-status.ts
  • src/renderer/src/store/slices/store-test-helpers.ts
  • src/renderer/src/store/slices/terminal-quick-command-hosts.test.ts
  • src/renderer/src/store/slices/terminal-quick-command-hosts.ts
  • src/renderer/src/store/types.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/settings/Settings.tsx
🚧 Files skipped from review as they are similar to previous changes (22)
  • src/renderer/src/components/settings/QuickCommandsPane.test.ts
  • src/renderer/src/lib/run-quick-command-in-new-tab.test.ts
  • src/renderer/src/components/settings/setting-ownership.test.ts
  • src/renderer/src/lib/run-quick-command-in-new-tab.ts
  • src/renderer/src/store/slices/terminal-quick-command-hosts.test.ts
  • src/renderer/src/store/slices/diffComments.test.ts
  • src/renderer/src/components/tab-bar/TabBarQuickCommandAddActions.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsMenu.keyboard.test.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/hooks/use-terminal-quick-command-hosts.test.ts
  • src/renderer/src/components/settings/setting-ownership.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/runtime-status.ts
  • src/renderer/src/store/slices/store-test-helpers.ts
  • src/renderer/src/components/terminal-pane/TerminalPane.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandItem.tsx
  • src/renderer/src/store/types.ts
  • src/renderer/src/store/slices/terminal-quick-command-hosts.ts
  • src/renderer/src/components/terminal-pane/TerminalQuickCommandsSubmenu.tsx
  • src/renderer/src/components/terminal-pane/TerminalContextMenu.tsx
  • src/renderer/src/components/terminal-pane/TerminalContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx

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