EventBridge + dialog RPCs for macOS app integration - #2
Merged
Conversation
Translate host events into Desktop.Env/Window/Menu messages, and expose dialog.choose_file/choose_directory/prompt on macOS (Linux stubs with -32004). Co-authored-by: Cursor <cursoragent@cursor.com>
put_webview_backend ran via GenServer.call while Desktop.Env.init was still on the stack, which crashed desktop startup on macOS. Co-authored-by: Cursor <cursoragent@cursor.com>
Apple menu Quit called NSApplication.terminate, which killed DesktopWebView and left the Elixir node running. Intercept terminate, emit event.system.quit, let Desktop.Window.quit halt BEAM, then finish host teardown on disconnect. Also halt BEAM if the host process exits unexpectedly. Co-authored-by: Cursor <cursoragent@cursor.com>
AppKit titles the first main-menu item with the process name. The raw DesktopWebView binary plus set_menubar installing Zones first produced duplicate process-named menus. Keep the Apple menu first and set processName from menu.set_apple. Co-authored-by: Cursor <cursoragent@cursor.com>
reconnect lifetime left the host running after iex/mix stopped. Treat --edw-no-beam like coupled on client disconnect, and default Launcher lifetime to coupled for BEAM-first launches. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Desktop.Menu creates the tray against an empty first DOM, then updates the menu object; NSStatusItem kept the empty menu. Reattach on update and call tray.set_menu from the Elixir adapter after mount/refresh. Co-authored-by: Cursor <cursoragent@cursor.com>
Template NSImages render as gray menu-bar silhouettes; Diode paints status colors into PNGs and needs those colors preserved. Co-authored-by: Cursor <cursoragent@cursor.com>
PNG pixel dimensions were used as AppKit point size (32pt), so padding in the bitmap did not change on-screen size. Set NSImage.size from NSStatusBar.thickness instead. Co-authored-by: Cursor <cursoragent@cursor.com>
Desktop.Window passes filenames like diode.png; Path.expand looked in cwd, failed silently, and icon.create installed a blank NSImage used as NSApp.applicationIconImage. Mirror wx Application.app_dir(priv) lookup and error when a path cannot be loaded. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DesktopWebview.EventBridgeso hostevent.*notifications fan out toDesktop.Window/Desktop.Menu/Desktop.Env(close, focus, open_url/file, reopen, menu.click).dialog.choose_file,dialog.choose_directory, anddialog.promptRPCs on macOS (NSOpenPanel/NSAlert); Linux returns-32004until ported.DesktopWebview.Dialog,Backend.set_context_menu/2, andBackend.create_icon_from_png_base64/1for consumer apps (e.g. Diode Collab).Test plan
NO_WX=1 mix test.unit./scripts/build_macos.shMade with Cursor