Skip to content

fix(notebook): activate app before file dialog when no windows exist#676

Merged
rgbkrk merged 2 commits intomainfrom
quill/file-open-no-window
Mar 10, 2026
Merged

fix(notebook): activate app before file dialog when no windows exist#676
rgbkrk merged 2 commits intomainfrom
quill/file-open-no-window

Conversation

@rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Mar 10, 2026

Summary

Fixes the File > Open menu action when all windows are closed on macOS.

On macOS, when the last notebook window is closed, the app stays running due to the exit prevention logic. However, clicking File > Open from the menu bar wouldn't display the file picker dialog because macOS requires the app to be activated first when it has no windows.

The fix activates the app via NSApplication.activateIgnoringOtherApps_(true) before showing the native file dialog in the no-window fallback path.

Test plan

  • Close all notebook windows (app stays running in dock on macOS)
  • Click File > Open from the menu bar
  • Verify the file picker dialog appears
  • Select a .ipynb file and verify it opens in a new window

Closes #481


PR submitted by @rgbkrk's agent, Quill

rgbkrk added 2 commits March 10, 2026 10:54
On macOS, when all windows are closed but the app stays running, clicking
File > Open wouldn't display the file picker dialog. This is because
macOS requires the app to be activated (brought to foreground) before
showing an NSOpenPanel when the app has no windows.

The fix adds NSApplication.activateIgnoringOtherApps_(true) before
showing the dialog in the no-window fallback path.

Fixes #481
@rgbkrk rgbkrk enabled auto-merge (squash) March 10, 2026 18:00
@rgbkrk rgbkrk merged commit f256a1e into main Mar 10, 2026
19 of 20 checks passed
@rgbkrk rgbkrk deleted the quill/file-open-no-window branch March 10, 2026 18:32
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.

bug(notebook): File > Open doesn't work when no windows are open

1 participant