Skip to content

feat(terminal): expose right-click paste on every platform - #8322

Merged
nwparker merged 2 commits into
mainfrom
nwparker/feature-expose-right-click-to-paste-terminal-set
Jul 11, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/feature-expose-right-click-to-paste-terminal-set

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

  • expose Right-click to paste in Terminal settings on macOS, Linux, and Windows
  • keep the platform defaults users already expect: enabled on Windows, context menu on macOS/Linux
  • migrate inherited values once while preserving explicit Windows opt-outs and all later choices
  • make the settings search entry and localized descriptions platform-neutral
  • run the existing right-click paste Electron oracle on every desktop platform

Closes #8315

Reliability proof

  • Reliability invariant: terminal-input.paste-routing/context-menu-ownership — when enabled, bare right-click copies a selection or pastes into the intended pane exactly once; Ctrl+right-click remains the context-menu escape hatch. When disabled, right-click continues to open the context menu.
  • Material impact: removes the client-platform gate without changing the existing provider-owned paste route, so local, daemon, SSH, WSL, and remote terminals share the same user choice.
  • Product change type: product behavior, persisted-default migration, and gate coverage.
  • Performance risk inventory: terminal context-menu event branching, settings search catalog construction, and one-time persistence load migration. No typing/output loops, polling, IPC, subprocesses, listeners, hidden-pane work, or startup awaits were added.
  • No-regression evidence: review confirmed the runtime path adds only a boolean event branch and the migration is constant-time with one first-upgrade save.
  • Correctness evidence: 424 focused Vitest tests passed, including all three platform defaults and migration preservation; the Electron live-PTY oracle passed on macOS and observed exactly one clipboard payload write.
  • Provider/platform coverage: provider paths are unaffected because the existing resolved-pane paste path is unchanged. macOS live behavior is covered locally; Windows/Linux defaults and migration are deterministically covered; full Windows/Linux live behavior remains CI evidence.
  • Residual gaps: no automated live Ctrl+right-click menu assertion; full live OS matrix remains CI evidence.
  • Promotion status: no matching manifest gate; reliability gate status remains unchanged.
  • Rollback/demotion rule: revert if right-click generates duplicate PTY writes, targets the wrong pane, or makes the context menu unreachable while enabled.

Validation

  • pnpm vitest run --config config/vitest.config.ts src/shared/constants.test.ts src/renderer/src/components/settings/terminal-search.test.ts src/main/persistence.test.ts
  • pnpm typecheck
  • targeted oxlint
  • pnpm verify:localization-catalog
  • pnpm verify:localization-coverage
  • pnpm check:max-lines-ratchet
  • npx playwright test tests/e2e/terminal-paste-ownership.spec.ts --grep "right-click paste sends" --config tests/playwright.config.ts --project electron-headless --workers=1

Review

Two auto-review-fix iterations completed. The first found and fixed preservation of a legacy Windows opt-out and stale platform-specific localized copy; the second returned clean across all six review passes.

@nwparker
nwparker merged commit 8a4ec4e into main Jul 11, 2026
1 of 3 checks passed
@nwparker
nwparker deleted the nwparker/feature-expose-right-click-to-paste-terminal-set branch July 11, 2026 22:02
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c769aec6-0fd8-4b58-b23f-a00566cbdf98

📥 Commits

Reviewing files that changed from the base of the PR and between 3fffe63 and 6a90416.

📒 Files selected for processing (18)
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/renderer/src/components/settings/TerminalInteractionSection.tsx
  • src/renderer/src/components/settings/TerminalPane.tsx
  • src/renderer/src/components/settings/terminal-search.test.ts
  • src/renderer/src/components/settings/terminal-search.ts
  • src/renderer/src/components/settings/terminal-windows-search.ts
  • src/renderer/src/components/terminal-pane/TerminalPane.tsx
  • src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/constants.test.ts
  • src/shared/constants.ts
  • src/shared/types.ts
  • tests/e2e/terminal-paste-ownership.spec.ts

📝 Walkthrough

Walkthrough

The change adds platform-specific defaults for terminal right-click paste and a one-shot persistence migration that preserves explicit opt-outs. Renderer settings search and controls now expose the option on all platforms, and terminal behavior honors the persisted value without Windows-only gating. Localized descriptions are made platform-neutral, while unit, persistence, search, and end-to-end tests are updated.

✨ Finishing Touches
📝 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.

AmethystLiang added a commit that referenced this pull request Jul 11, 2026
…romoted worktree symlinks

Merging main surfaced two semantic conflicts against this branch's tests:

- #8322 exposed right-click paste on every platform, so the settings
  navigation metadata now indexes it even when only the terminal host is
  Windows. Update the stale assertion accordingly.
- #8318 promoted APFS worktree shared paths by dropping the
  experimentalWorktreeSymlinks gate, so WorktreeSymlinksSection now always
  mounts inside RepositoryPane and reads window.api.fs. Stub a minimal
  renderer fs bridge in the pane test, matching the AppearancePane pattern.

Co-authored-by: Orca <help@stably.ai>
AmethystLiang added a commit that referenced this pull request Jul 12, 2026
* Add host removal lifecycle safeguards and credential cleanup retry UI

- Sequence host removal so metadata commits before the client socket
  closes, avoiding a stranded host when storage fails, and add a
  cancellable open-registry to stop races between host-client opens
  and closes/unmounts.
- Queue AsyncStorage host-list mutations (rename/removal/lastConnected)
  to prevent concurrent writers from clobbering each other's changes.
- Track keychain credential cleanups that fail or time out as durable
  pending intents, surfaced with a manual retry affordance in Settings.

* Fix host removal error handling to reopen confirm dialog and alert user

Previously a failed host removal silently closed the confirm dialog,
leaving the host listed with no feedback and no easy retry path. Now
the confirm modal reopens and an alert surfaces the failure so the
user can retry.

* test: reconcile settings tests with universal right-click paste and promoted worktree symlinks

Merging main surfaced two semantic conflicts against this branch's tests:

- #8322 exposed right-click paste on every platform, so the settings
  navigation metadata now indexes it even when only the terminal host is
  Windows. Update the stale assertion accordingly.
- #8318 promoted APFS worktree shared paths by dropping the
  experimentalWorktreeSymlinks gate, so WorktreeSymlinksSection now always
  mounts inside RepositoryPane and reads window.api.fs. Stub a minimal
  renderer fs bridge in the pane test, matching the AppearancePane pattern.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
whyjp added a commit to whyjp/orca that referenced this pull request Jul 12, 2026
Resolve conflicts (all additive/union, no logic conflicts):
- shared/types.ts: keep both ProjectDefaultShell + UsagePercentageDisplay imports
- useSettingsNavigationMetadata.test.ts: keep the WSL POSIX-path test and
  main's stablyai#8322 right-click-paste rename/expectation
- i18n locales (en/es/ja/ko/zh): union our WSL keys with main's
  AppearanceWindowSidebarSection; ran sync:localization-catalog to add main's
  UsagePercentageDisplayChangeNotice keys and restore locale parity
- web/web-preload-api.ts: add wsl.pathExists web stub (returns null/inconclusive;
  no host.wsl.pathExists RPC) to satisfy the merged Api type

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AmethystLiang added a commit that referenced this pull request Jul 12, 2026
* fix: work-item naming, usage % rounding, and terminal/delete copy

Address prod-release-scan P2s:

- #8238: recognize Bitbucket Server (/projects|users/.../repos/.../pull-requests/N)
  and Azure DevOps (/_git/REPO/pullrequest/N) PR URL shapes in
  work-item-reference, alongside Bitbucket Cloud; graceful fallback preserved.

- #7574: getDisplayedUsagePercentage now rounds the used value before taking the
  `remaining` complement, so the compact status bar (raw usedPercent) and tooltip
  (pre-rounded clampUsedPercent) can no longer disagree by 1% at a .5 fraction.
  clampUsedPercent moves to the shared module as the single rounding source.

- #7459: mixed remote+local batch delete confirm no longer claims the whole
  batch is a permanent "remote host" delete — it now states remote items are
  permanent while local items move to the Trash/Recycle Bin.

- #8322: right-click-to-paste settings copy is platform-aware — "Control-click"
  on macOS, "Ctrl+right-click" on Windows/Linux — matching the ctrlKey gate.

Localization catalog synced (also picks up pre-existing UsagePercentageDisplayChangeNotice drift).

* Fix NaN% usage bar and label for non-finite provider values

Non-finite usedPercent inputs (NaN/Infinity) propagated through Math.round/min/max into the CSS bar width (`NaN%`) and displayed copy. clampUsedPercent now short-circuits to 0 in that case, with a test covering the divergence from getDisplayedUsagePercentage for the 'remaining' case.
@AmethystLiang

Copy link
Copy Markdown
Contributor

thanks for reporting. looking into it

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…8322)

* WIP: Changes before auto-review fixes

* fix: preserve terminal paste defaults across platforms
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* Add host removal lifecycle safeguards and credential cleanup retry UI

- Sequence host removal so metadata commits before the client socket
  closes, avoiding a stranded host when storage fails, and add a
  cancellable open-registry to stop races between host-client opens
  and closes/unmounts.
- Queue AsyncStorage host-list mutations (rename/removal/lastConnected)
  to prevent concurrent writers from clobbering each other's changes.
- Track keychain credential cleanups that fail or time out as durable
  pending intents, surfaced with a manual retry affordance in Settings.

* Fix host removal error handling to reopen confirm dialog and alert user

Previously a failed host removal silently closed the confirm dialog,
leaving the host listed with no feedback and no easy retry path. Now
the confirm modal reopens and an alert surfaces the failure so the
user can retry.

* test: reconcile settings tests with universal right-click paste and promoted worktree symlinks

Merging main surfaced two semantic conflicts against this branch's tests:

- stablyai#8322 exposed right-click paste on every platform, so the settings
  navigation metadata now indexes it even when only the terminal host is
  Windows. Update the stale assertion accordingly.
- stablyai#8318 promoted APFS worktree shared paths by dropping the
  experimentalWorktreeSymlinks gate, so WorktreeSymlinksSection now always
  mounts inside RepositoryPane and reads window.api.fs. Stub a minimal
  renderer fs bridge in the pane test, matching the AppearancePane pattern.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix: work-item naming, usage % rounding, and terminal/delete copy

Address prod-release-scan P2s:

- stablyai#8238: recognize Bitbucket Server (/projects|users/.../repos/.../pull-requests/N)
  and Azure DevOps (/_git/REPO/pullrequest/N) PR URL shapes in
  work-item-reference, alongside Bitbucket Cloud; graceful fallback preserved.

- stablyai#7574: getDisplayedUsagePercentage now rounds the used value before taking the
  `remaining` complement, so the compact status bar (raw usedPercent) and tooltip
  (pre-rounded clampUsedPercent) can no longer disagree by 1% at a .5 fraction.
  clampUsedPercent moves to the shared module as the single rounding source.

- stablyai#7459: mixed remote+local batch delete confirm no longer claims the whole
  batch is a permanent "remote host" delete — it now states remote items are
  permanent while local items move to the Trash/Recycle Bin.

- stablyai#8322: right-click-to-paste settings copy is platform-aware — "Control-click"
  on macOS, "Ctrl+right-click" on Windows/Linux — matching the ctrlKey gate.

Localization catalog synced (also picks up pre-existing UsagePercentageDisplayChangeNotice drift).

* Fix NaN% usage bar and label for non-finite provider values

Non-finite usedPercent inputs (NaN/Infinity) propagated through Math.round/min/max into the CSS bar width (`NaN%`) and displayed copy. clampUsedPercent now short-circuits to 0 in that case, with a test covering the divergence from getDisplayedUsagePercentage for the 'remaining' case.
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.

[Feature]: Expose "Right-click to paste" terminal setting on macOS

2 participants