@@ -243,7 +243,7 @@ final class MainContentCoordinator {
243243
244244 /// Registry of active coordinators for aggregated quit-time persistence.
245245 /// Keyed by ObjectIdentifier of each coordinator instance.
246- private static var activeCoordinators : [ ObjectIdentifier : MainContentCoordinator ] = [ : ]
246+ static var activeCoordinators : [ ObjectIdentifier : MainContentCoordinator ] = [ : ]
247247
248248 /// Register this coordinator so quit-time persistence can aggregate tabs.
249249 private func registerForPersistence( ) {
@@ -255,50 +255,6 @@ final class MainContentCoordinator {
255255 Self . activeCoordinators. removeValue ( forKey: ObjectIdentifier ( self ) )
256256 }
257257
258- /// Find a coordinator by its window identifier.
259- static func coordinator( for windowId: UUID ) -> MainContentCoordinator ? {
260- activeCoordinators. values. first { $0. windowId == windowId }
261- }
262-
263- /// Find the coordinator whose `contentWindow` matches the given NSWindow.
264- /// Used by `TabWindowController` to dispatch NSWindowDelegate callbacks
265- /// to the correct coordinator without needing a shared registry key.
266- static func coordinator( forWindow window: NSWindow ) -> MainContentCoordinator ? {
267- activeCoordinators. values. first { $0. contentWindow === window }
268- }
269-
270- /// Check whether any active coordinator has unsaved edits.
271- static func hasAnyUnsavedChanges( ) -> Bool {
272- activeCoordinators. values. contains { coordinator in
273- coordinator. changeManager. hasChanges
274- || coordinator. tabManager. tabs. contains { $0. pendingChanges. hasChanges }
275- }
276- }
277-
278- /// Collect all tabs from all active coordinators for a given connectionId.
279- static func allTabs( for connectionId: UUID ) -> [ QueryTab ] {
280- activeCoordinators. values
281- . filter { $0. connectionId == connectionId }
282- . flatMap { $0. tabManager. tabs }
283- }
284-
285- /// All currently active coordinators across windows.
286- static func allActiveCoordinators( ) -> [ MainContentCoordinator ] {
287- Array ( activeCoordinators. values)
288- }
289-
290- /// Find the first coordinator for `connectionId` that owns a tab matching `predicate`.
291- /// Used to dedup cross-window tabs (Server Dashboard singleton, ER Diagram reuse).
292- static func coordinator(
293- forConnection connectionId: UUID ,
294- tabMatching predicate: ( QueryTab ) -> Bool
295- ) -> MainContentCoordinator ? {
296- activeCoordinators. values. first { coordinator in
297- coordinator. connectionId == connectionId
298- && coordinator. tabManager. tabs. contains ( where: predicate)
299- }
300- }
301-
302258 /// Collect non-preview tabs for persistence.
303259 private static func aggregatedTabs( for connectionId: UUID ) -> [ QueryTab ] {
304260 let coordinators = activeCoordinators. values
0 commit comments