Skip to content

perf(renderer): defer Quick Command host work - #13517

Merged
nwparker merged 1 commit into
mainfrom
nwparker/perf-quick-command-host-fanout
Aug 10, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/perf-quick-command-host-fanout

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

  • Stop closed terminal context menus from resolving Quick Command host ownership on every renderer store publication.
  • Replace six per-pane Zustand subscriptions with one shallow projection and a stable disabled sentinel.
  • Load remote Quick Commands when the context menu opens while preserving the always-enabled tab-bar Quick Commands button.

This targets the renderer regression introduced with remote Quick Command host support in #13094. Reports were worst while remote hosts created workspaces or received orchestration work, and removing configured remote hosts made the slowdown nearly disappear. Inactive terminal panes remain mounted, so the previous eager hook multiplied host-resolution work by pane count during remote state churn and foreground catch-up.

Screenshots

No visual change. An uncached remote host can briefly use the existing loading state on first context-menu open.

Testing

  • pnpm lint — focused staged-file lint and changed-code checks passed
  • pnpm typecheck
  • pnpm test — focused renderer suites passed
  • pnpm build
  • Added a regression test covering 1,000 disabled store writes, stable results, zero worktree-host resolutions, zero remote loads, and re-enabling

Focused validation:

  • Five Quick Command hook, store, context-menu, dispatch, and search test files: 35 tests
  • pnpm check:code-quality:changed -- origin/main
  • pnpm check:react-doctor:changed -- origin/main
  • pnpm check:max-lines-ratchet
  • pnpm check:zustand-selector-fanout
  • Scoped formatting and git diff --check

AI Review Report

Reviewed React hook ordering, controlled context-menu and editor lifecycle, false-to-true subscription transitions, stable disabled snapshots, remote request coalescing, in-flight loads completing after close, and tab-bar behavior. The review found no correctness issues. The only expected tradeoff is that the first uncached remote menu open may briefly show the supported loading state instead of using eager prefetch.

Cross-platform compatibility was explicitly checked for macOS, Linux, and Windows, including shortcuts, labels, paths, shell behavior, and Electron-specific branches. This is platform-neutral renderer state selection and changes none of those surfaces. Local, remote-runtime, SSH, folder-workspace, and git-worktree behavior were reviewed; existing host resolution and remote loading behavior are unchanged while enabled.

Security Audit

No security findings. The change adds no input handling, command execution, path handling, authentication, secrets, dependencies, persistence, IPC/RPC schema, or remote-wire behavior. It only defers reads and an existing remote Quick Command load action until the existing menu is open.

Notes

  • Mixed client/host versions remain compatible because no exchanged content or protocol changes.
  • X: @nwparker_

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nwparker, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 seconds

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c83c9ed-ec05-4cc8-a966-1d8209c70f98

📥 Commits

Reviewing files that changed from the base of the PR and between 73efab9 and a185506.

📒 Files selected for processing (3)
  • 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

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
nwparker merged commit abd160f into main Aug 10, 2026
45 checks passed
zpyoung pushed a commit to zpyoung/orca that referenced this pull request Aug 11, 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant