The menu at the pointer is a context menu — right-click (or click) the folder to toggle it
Context Menu
/ NSMenu · View.contextMenu(menuItems:) /
also called contextual menu, right-click menu, shortcut menu
A context menu exposes actions relevant to the object under the pointer and opens from a secondary click or Control-click. It appears near that click and is made from standard menu items, separators, keyboard equivalents, and submenus. A dropdown menu has a visible control that opens it with a primary click, while a context menu is invoked directly from the content.
Anatomy — every part, named
- 1Selection highlight
NSMenuItem“The blue bar behind the option under the pointer” is the menu item's selection highlight.
- 2Separator item
NSMenuItem.separator()“The little line between groups of right-click options” is a separator item.
- 3Key equivalent
NSMenuItem.keyEquivalent“The keyboard shortcut text on the right” is the item's key equivalent.
- 4Submenu indicator
NSMenuItem.submenu“The sideways arrow that opens more options” is the submenu indicator.
Prompt — paste into your agent
Add a Context Menu using NSMenu on the target NSView (SwiftUI: View.contextMenu), opened by right-click or Control-click at the item under the pointer. Populate it with actions specific to that item; do not turn it into a primary-click dropdown anchored to a button.
In code
The exact names this thing goes by in code — each row is one framework’s word for it. Use the row that matches your project (or paste it into your prompt).
| AppKit | NSMenu | |
| SwiftUI | View.contextMenu(menuItems:) | |
| AppKit | NSView.menu | the contextual menu associated with a view |
| AppKit | NSMenuItem |