Skip to content

Commit 772eba8

Browse files
committed
fix: add diagnostic logging for tab grouping
1 parent cb7ecb3 commit 772eba8

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

TablePro/AppDelegate+WindowConfig.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,13 @@ extension AppDelegate {
252252

253253
// Explicitly attach to existing tab group — automatic tabbing
254254
// doesn't work when tabbingIdentifier is set after window creation.
255-
if let existingWindow = NSApp.windows.first(where: {
256-
$0 !== window && isMainWindow($0) && $0.isVisible
257-
&& $0.tabbingIdentifier == resolvedIdentifier
258-
}) {
255+
let mainWindows = NSApp.windows.filter { $0 !== window && isMainWindow($0) && $0.isVisible }
256+
windowLogger.info(
257+
"New main window: resolved=\(resolvedIdentifier), pendingId=\(pendingId?.uuidString ?? "nil"), existing=\(mainWindows.map { $0.tabbingIdentifier })"
258+
)
259+
if let existingWindow = mainWindows.first(where: { $0.tabbingIdentifier == resolvedIdentifier }) {
259260
existingWindow.addTabbedWindow(window, ordered: .above)
261+
window.makeKeyAndOrderFront(nil)
260262
}
261263
}
262264
}

0 commit comments

Comments
 (0)