Skip to content

input: use the native OS context menu on right-click#2453

Merged
huacnlee merged 4 commits into
mainfrom
native-context-menu
Jun 10, 2026
Merged

input: use the native OS context menu on right-click#2453
huacnlee merged 4 commits into
mainfrom
native-context-menu

Conversation

@huacnlee

@huacnlee huacnlee commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

  • macos: A native menu became unresponsive after its first popup. The AppKit tracking loop runs in a foreground task; when it returns (especially when the user dismisses the menu without selecting anything) GPUI was never woken, so the window stayed idle and ignored the next right-click. Now the window is refreshed once tracking ends, and the action is only dispatched when an item was selected.
  • input: Remove the RightClick variant from the popover ContextMenu enum as part of moving the input right-click menu over to NativeMenu. Completion / CodeAction are untouched.

Test plan

  • On macOS, right-click in an input / native-menu area, dismiss the menu (pick an item or click away), then right-click again — the menu re-opens.

🤖 Generated with Claude Code

huacnlee and others added 4 commits June 9, 2026 21:54
- macos: refresh the window after the AppKit tracking loop returns so a
  dismissed native menu does not leave the window idle and unresponsive to
  a second right-click (covers the dismiss-without-selection path)
- input: remove the RightClick variant from the popover ContextMenu enum

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Migrate remaining PopupMenu-based callers to popup_context_menu, drop the
removed Input custom context menu API and the orphaned InputContextMenu,
and update stories accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… NativeMenu

Revert the ContextMenuExt::context_menu -> NativeMenu change. The trait
keeps its original PopupMenu semantics (so sidebar/table/tree/stories stay
unchanged and keep closure callbacks, custom suffix/label/link), and the
native menu is reached only through the standalone NativeMenu component
(the input right-click menu already calls NativeMenu::show directly).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bring back Input::context_menu (custom builder) and InputState::context_menu
(enable/disable), now backed by NativeMenu instead of PopupMenu. A custom
builder fully replaces the built-in right-click menu; otherwise the default
cut/copy/paste/select-all (plus code-editor actions) is shown. Restore the
story demos accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huacnlee huacnlee changed the title native_menu: fix macOS re-popup and drop input RightClick menu input: use the native OS context menu on right-click Jun 10, 2026
@huacnlee huacnlee merged commit 57a5bae into main Jun 10, 2026
3 checks passed
@huacnlee huacnlee deleted the native-context-menu branch June 10, 2026 06:15
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