Skip to content

Conversation

@Saadnajmi
Copy link
Collaborator

Summary:

You can launch the dev menu 3 ways:

  1. Via the hot key Cmd+D (not supported on macOS at time of writing, see notes for why)
  2. Via a right click (not enabled in Fabric yet, see feat: Add a dev menu to RCTSurfaceHostingView (2/2) #2749)
  3. By pressing "d" in a metro server

This PR is focused on fixing issues with (3).

When the dev menu was presented from metro, we didn't have a window or mouse location to key off of, so a context menu would present at coordinates (0,0), AKA, the bottom left of your screen on macOS. This isn't very discoverable or useful. To match other platforms, I think it would be better to make the dev menu an NSAlert, presented on top of the apps window.

Let's also preserve the right click context menu for now, since that is still useful and muscle memory for most macOS devs. Let's also use some newer NSMenu APIs to set the title / subtitle while we're here.

Test Plan:

Screen.Recording.2025-11-05.at.1.12.02.PM.mov

Notes

We don't want to support (1) because we don't want to register hotkeys on the window, a window may have multiple instances of RN running. We could register it on the root view... but on macOS, keyboard focus is rarely in the root view (it's usually just on the window or application) so this isn't very discoverable. I'll elect to skip implementing this flow for now.

@Saadnajmi Saadnajmi requested a review from a team as a code owner November 5, 2025 21:13
@Saadnajmi Saadnajmi changed the title feat: display dev menu as a sheet when invoked from Metro feat: display dev menu as a sheet when invoked from Metro (1/2) Nov 5, 2025
@Saadnajmi Saadnajmi merged commit b3aad0b into microsoft:main Nov 5, 2025
28 of 39 checks passed
@Saadnajmi Saadnajmi deleted the just-alert branch November 5, 2025 22:57
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.

2 participants