@@ -208,9 +208,8 @@ struct MainContentView: View {
208208 // Skip save during restoration
209209 guard !isRestoringTabs else { return }
210210
211- // CRITICAL: Skip save if view is being dismissed
211+ // Skip save if view is being dismissed
212212 guard !isDismissing else {
213- print ( " [MainContentView] Skipping selectedTabId save - view is being dismissed " )
214213 return
215214 }
216215
@@ -235,7 +234,6 @@ struct MainContentView: View {
235234 // CRITICAL: Skip save if view is being dismissed to prevent saving empty query
236235 // When SwiftUI tears down the view, bindings may be reset causing empty saves
237236 guard !isDismissing else {
238- print ( " [MainContentView] Skipping save - view is being dismissed " )
239237 return
240238 }
241239
@@ -271,7 +269,6 @@ struct MainContentView: View {
271269 . onChange ( of: DatabaseManager . shared. currentSession? . isConnected) { _, isConnected in
272270 // Auto-execute query when connection becomes ready and tab needs data
273271 if isConnected == true && needsLazyLoad {
274- print ( " [MainContentView] Connection ready - executing lazy load " )
275272 needsLazyLoad = false
276273 runQuery ( )
277274 }
@@ -345,7 +342,6 @@ struct MainContentView: View {
345342 . onReceive ( NotificationCenter . default. publisher ( for: . mainWindowWillClose) ) { _ in
346343 // CRITICAL: Window is about to close - flush pending saves immediately
347344 // This prevents query text from being lost when SwiftUI tears down the view
348- print ( " [MainContentView] Window will close - flushing pending saves " )
349345
350346 // Set flag to prevent further saves (view is being destroyed)
351347 isDismissing = true
@@ -360,7 +356,6 @@ struct MainContentView: View {
360356 tabs: tabManager. tabs,
361357 selectedTabId: tabManager. selectedTabId
362358 )
363- print ( " [MainContentView] Flushed tab state for connection \( connection. id) " )
364359 }
365360 }
366361 }
@@ -454,11 +449,10 @@ struct MainContentView: View {
454449 tabManager. addTab ( initialQuery: lastQuery)
455450 }
456451 }
457- . onReceive ( NotificationCenter . default. publisher ( for: NSNotification . Name ( " loadQueryIntoEditor " ) ) ) { notification in
452+ . onReceive ( NotificationCenter . default. publisher ( for: . loadQueryIntoEditor) ) { notification in
458453 // Load query from history/bookmark panel into current tab
459454 Task { @MainActor in
460- guard let query = notification. userInfo ? [ " query " ] as? String else { return }
461- print ( " [MainContentView] Received loadQueryIntoEditor with query: \( query. prefix ( 50 ) ) ... " )
455+ guard let query = notification. object as? String else { return }
462456
463457 // Load into the current tab (which was just created by .newTab)
464458 if let tabIndex = tabManager. selectedTabIndex,
@@ -566,7 +560,6 @@ struct MainContentView: View {
566560 // CRITICAL: Bounds check to prevent crash on paste
567561 guard let index = tabManager. selectedTabIndex,
568562 index < tabManager. tabs. count else {
569- print ( " [MainContentView] Warning: Invalid tab index during query update " )
570563 return
571564 }
572565
0 commit comments