Add built-in right-click text context menu to EditorView#13099
Add built-in right-click text context menu to EditorView#13099warp-dev-github-integration[bot] wants to merge 1 commit into
Conversation
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>
|
@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 Powered by Oz |
There was a problem hiding this comment.
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
|
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 |
|
/oz-review |
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:
EditorViewhad no right-click handler of its own. On the terminal the text context menu is supplied by the parentInputview; non-terminal panes (Settings, env vars, dialogs) never wired one up, so right-clicks fell through to the pane-level handler inSettingsView::render.This adds a default-on built-in right-click text-editing context menu to
EditorView(Select All / Copy / Cut / Paste), reusing the existingEditorActionediting methods and the sharedMenucomponent. Its handler stops propagation so it no longer reaches the pane menu. The menu is opt-out viaEditorOptions::disable_builtin_context_menufor editors that already provide their own parent-level right-click menu:Password fields (e.g. API-key inputs) omit Copy/Cut, mirroring
EditorView::copy, which already no-ops for password editors.Linked Issue
ready-to-specorready-to-implement.Fixes #13067.
Testing
I have manually tested my changes locally with
./script/runAdded a regression test
editor::view::tests::test_builtin_context_menu_itemsasserting 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/formatandcargo clippy ... -D warnings(clean).Screenshots / Videos
Verified end-to-end with computer use on a local
cargo buildof 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):
Select All,Paste(Copy/Cut intentionally omitted for password fields).Select All,Copy,Cut,Paste.Split pane right/left/down/up(pane menu unchanged).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
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.