Skip to content

Add built-in right-click text context menu to EditorView#13099

Open
warp-dev-github-integration[bot] wants to merge 1 commit into
masterfrom
factory/editor-text-context-menu
Open

Add built-in right-click text context menu to EditorView#13099
warp-dev-github-integration[bot] wants to merge 1 commit into
masterfrom
factory/editor-text-context-menu

Conversation

@warp-dev-github-integration

@warp-dev-github-integration warp-dev-github-integration Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

On Linux (and elsewhere), right-clicking a text/editor field inside Settings — e.g. the Custom inference API-key fields, or the Settings search box — popped the pane-management menu (Split pane right/left/up/down) instead of text-editing actions, and there was no way to Cut/Copy/Paste/Select All via the mouse.

Root cause: EditorView had no right-click handler of its own. On the terminal the text context menu is supplied by the parent Input view; non-terminal panes (Settings, env vars, dialogs) never wired one up, so right-clicks fell through to the pane-level handler in SettingsView::render.

This adds a default-on built-in right-click text-editing context menu to EditorView (Select All / Copy / Cut / Paste), reusing the existing EditorAction editing methods and the shared Menu component. Its handler stops propagation so it no longer reaches the pane menu. The menu is opt-out via EditorOptions::disable_builtin_context_menu for editors that already provide their own parent-level right-click menu:

  • the terminal input editor (terminal / AI / CLI-agent / agent-view input), and
  • the cloud-notebook title editor.

Password fields (e.g. API-key inputs) omit Copy/Cut, mirroring EditorView::copy, which already no-ops for password editors.

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Fixes #13067.

Testing

  • I have manually tested my changes locally with ./script/run

  • Added a regression test editor::view::tests::test_builtin_context_menu_items asserting the non-password menu (Select All / Copy / Cut / Paste), the password menu (Select All / Paste only), and that an opted-out editor has no built-in menu. It fails before the fix and passes after.

  • Ran ./script/format and cargo clippy ... -D warnings (clean).

Screenshots / Videos

Verified end-to-end with computer use on a local cargo build of this branch. Observed right-click menus (verbatim):

Before (bug): right-clicking the Settings → Agents → Warp Agent → Custom inference → "OpenAI API key" field showed the pane menu — Split pane right, Split pane left, Split pane down, Split pane up — with no text actions.

After (this PR):

  • OpenAI API key field (a password field) → Select All, Paste (Copy/Cut intentionally omitted for password fields).
  • Settings search box → Select All, Copy, Cut, Paste.
  • Empty Settings content area → still Split pane right/left/down/up (pane menu unchanged).
  • Terminal command input → unchanged, still its full rich input menu (Select all, Paste, Share session…, Command search, AI command search, Save as workflow, … Split pane …), confirming the opt-out works.

A screenshot of the fixed API-key field menu (Select All / Paste) is attached in the linked Slack thread below.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Right-clicking text fields in Settings (and other non-terminal panes) now shows Cut/Copy/Paste/Select All instead of the pane menu.


Slack thread: https://warpdev.slack.com/archives/C0BCE7AELJ2/p1782436974615069?thread_ts=1782436974.615069&cid=C0BCE7AELJ2

Conversation: https://staging.warp.dev/conversation/2f7a0164-0181-4caf-87e2-c4fa6d073857
Run: https://oz.staging.warp.dev/runs/019f0185-da7a-77de-8e13-1fc73daac6da

This PR was generated with Oz.

Right-clicking an editor/text field inside Settings (and other non-terminal
panes) previously fell through to the pane-management menu because EditorView
had no right-click handler of its own. Add a default-on text-editing context
menu (Select All / Copy / Cut / Paste) to EditorView, with an opt-out for
editors that already provide their own parent-level menu (the terminal input
and the notebook title). Password fields omit Copy/Cut.

Fixes #13067.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jun 26, 2026
@oz-for-oss

oz-for-oss Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@warp-dev-github-integration[bot]

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss 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.

Overview

This PR adds a default-on built-in right-click text-editing menu to EditorView, omits Copy/Cut for password editors, adds opt-outs for editor surfaces with parent-level menus, and includes a regression test for the menu item set.

Concerns

  • This is a user-facing UI behavior change, but the PR description does not include an attached screenshot or screen recording. For this user-facing change, please include screenshots or a screen recording demonstrating it working end to end.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor Author

Thanks for the review! Addressed the feedback: I've added a Screenshots / Videos section to the PR description documenting the end-to-end computer-use verification, including the verbatim before/after right-click menu contents for the Settings API-key field, the search box, an empty settings area, and the terminal input. A screenshot of the fixed API-key field (showing Select All / Paste) is attached in the linked Slack thread referenced in the description (this factory workflow attaches the visual proof there). Re-requesting review.

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor Author

/oz-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy/Past (Bug in Settings AI)

1 participant