revert: rebuild the menu bar on native AppKit menus (#2057) - #2071
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Aug 10, 2026
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.
Restores the menu bar. #2057 shipped a rewrite that SwiftUI silently undoes at launch.
What happens
Measured on the running app with OSLog probes:
SwiftUI reconciles
NSApp.mainMenuonce, shortly after launch, and discards the AppKit menu. File, Edit, Database and Query disappear.Why it cannot be patched
Under the SwiftUI App lifecycle the real
NSApp.delegateis a privateSwiftUI.AppDelegatethat forwards only some selectors, and SwiftUI reconciles into the existingNSMenuusing its ownNSMenuItemsubclass, removing plainNSMenuItems. The menu pointer never changes, so pointer-identity KVO stays silent.Every hook was measured on the real app and none work: KVO on
NSApp.mainMenu,didUpdateNotification,didBecomeKeyNotification, and theapplicationDidUpdate(_:)delegate method never fire.applicationDidBecomeActivefires before the reconciliation. Only a wall-clock delay works, which is not something to ship.Scope
Reverts only #2057. Every other merged PR is untouched: TableProApp.swift is byte-identical to its state at #2067, and the three PRs merged after #2057 (#2068, #2069, #2070) are unaffected.
Disconnect and Reconnect return to the Connection menu as #2056 shipped them.
Next
The menu architecture itself was right; responder-chain validation is the only mechanism that serves both a SwiftUI scene and an AppKit window. The foundation was wrong. Owning the main menu requires the AppKit app lifecycle, which this app is already 90% of the way to. That migration is planned separately, and
Core/Menu/**returns unchanged as part of it.