Conversation
Under `--multi-window` Pake gives its windows a shared tabbing identifier, so macOS groups them into native tabs and draws the tab bar. The bar arrives without its "+" button: AppKit only draws that button when the clicked window's responder chain answers `newWindowForTab:`, and neither tao nor Tauri implements the selector. The result is a tab bar the user can reorder and close tabs in but not add one from, with Cmd+N as the only way to get another tab. The selector is installed on the window's own class, the first responder-chain link Apple documents for it, so the click is handled by the window that was clicked. The class is resolved from a live window rather than by name, so a tao rename cannot silently break this, and the method is only added when it is absent -- a future tao implementing it upstream takes precedence and this becomes a no-op. Asking the instance for `[window class]` matters: KVO swizzles the isa to a hidden `NSKVONotifying_` subclass, and AppKit decides whether to draw the button from `[window class]`, which KVO overrides to report the real class. `object_getClass` would install on the swizzled subclass and miss. Installing on the class covers every window tao creates, which is why nothing is installed at all unless native tabbing is on. This is a workaround for a gap in tao rather than something Pake should own long-term; the selector belongs in tao's window class.
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.
Problem
Under
--multi-windowPake gives its windows a shared tabbing identifier, so macOS groups them into native tabs and draws the tab bar. The bar arrives without its "+" button: AppKit only draws that button when the clicked window's responder chain answersnewWindowForTab:, and neither tao nor Tauri implements the selector. The result is a tab bar the user can reorder and close tabs in but can't add one from — Cmd+N is the only way to get another tab.Fix
The selector is installed on the window's own class, the first responder-chain link Apple documents for
newWindowForTab:, so the click is handled by the window that was clicked. The class is resolved from a live window rather than by name, so a tao rename can't silently break this, and the method is only added when it's absent — a future tao implementing it upstream takes precedence and this becomes a no-op.Asking the instance for
[window class](rather thanobject_getClass) matters: KVO swizzles the isa pointer to a hiddenNSKVONotifying_subclass, but AppKit decides whether to draw the button from[window class], which KVO overrides to report the real class.object_getClasswould install on the swizzled subclass and miss.Installing on the class (not the instance) covers every window tao creates from a single install call, which is also why nothing is installed at all unless native tabbing is actually on.
This is a workaround for a gap in tao rather than something Pake should own long-term — the selector really belongs in tao's window class. Filing an issue there is a reasonable follow-up if this is welcome here.
Verification
cargo test --lib— 48 passednpx vitest run— 497 passedcargo clippy --all-targets— no new warningscargo fmt --check,prettier --check— clean