Skip to content

refactor(launch): register each window presenter independently - #2073

Merged
datlechin merged 1 commit into
mainfrom
refactor/appkit-lifecycle-phase0
Aug 10, 2026
Merged

refactor(launch): register each window presenter independently#2073
datlechin merged 1 commit into
mainfrom
refactor/appkit-lifecycle-phase0

Conversation

@datlechin

Copy link
Copy Markdown
Member

First step toward owning the main menu in AppKit. No user-visible change.

WindowOpener.wire(...) took all four window presenters in one call, so no window could move to AppKit until all four did. This splits it into four independent registrations.

  • setWelcomePresenter, setConnectionFormPresenter, setIntegrationsActivityPresenter, setSettingsPresenter
  • A call made before its own presenter exists is still queued, and now re-queues itself if a different window registers first, so registering one window can no longer drop another window's pending call
  • init is no longer private, so a test can exercise the queue on an instance with nothing registered instead of the process-wide singleton

Two tests cover the new behaviour: a queued call runs when its presenter arrives, and registering one window does not discard another's queued call.

Build succeeds, swiftlint --strict clean, WindowOpenerTests passes.

Why

#2057 rewrote the menu bar on AppKit and had to be reverted (#2071): SwiftUI reconciles NSApp.mainMenu once shortly after launch and discards it. Under the SwiftUI App lifecycle there is no supported way to keep it, so the app moves to the AppKit lifecycle, where the menu bar has a single owner. The four SwiftUI scenes become NSWindowControllers one at a time; this PR makes that possible.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin
datlechin merged commit 59b78a2 into main Aug 10, 2026
4 checks passed
@datlechin
datlechin deleted the refactor/appkit-lifecycle-phase0 branch August 10, 2026 08:08
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