From 0073ac37c73a97a646e1d1ebb205c34046d269a5 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Thu, 18 Jun 2026 15:03:38 +0700 Subject: [PATCH] fix(coordinator): build all split panes through one path so a new tab's inspector renders --- CHANGELOG.md | 1 + .../Infrastructure/MainSplitViewController.swift | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6023b3c5f..9d0d095ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - A new database group now appears in the connection list right away instead of only after restarting the app. (#1704) - The SQL formatter keeps nested indentation for UNION, UNION ALL, INTERSECT, and EXCEPT inside a derived table or CTE, and puts the closing parenthesis of a subquery on its own line instead of collapsing it onto the last SELECT. (#1698) - Toolbar button tooltips now show each action's real keyboard shortcut and follow your custom bindings, instead of a fixed value. The Switch Connection tooltip showed the wrong shortcut. (#1694) +- The row detail panel no longer stays blank when a table is opened in a second tab. The panel now shows the selected row right away instead of only after the inspector is toggled. ## [0.51.1] - 2026-06-16 diff --git a/TablePro/Core/Services/Infrastructure/MainSplitViewController.swift b/TablePro/Core/Services/Infrastructure/MainSplitViewController.swift index 7c360fe4c..81d59c0d8 100644 --- a/TablePro/Core/Services/Infrastructure/MainSplitViewController.swift +++ b/TablePro/Core/Services/Infrastructure/MainSplitViewController.swift @@ -193,14 +193,14 @@ internal final class MainSplitViewController: NSSplitViewController, InspectorVi splitView.dividerStyle = .thin splitView.isVertical = true - sidebarContainer = SidebarContainerViewController(rootView: AnyView(buildSidebarView())) + sidebarContainer = SidebarContainerViewController(rootView: AnyView(Color.clear)) sidebarSplitItem = NSSplitViewItem(sidebarWithViewController: sidebarContainer) sidebarSplitItem.canCollapse = true sidebarSplitItem.minimumThickness = Self.sidebarMinThickness sidebarSplitItem.maximumThickness = Self.sidebarMaxThickness addSplitViewItem(sidebarSplitItem) - detailHosting = NSHostingController(rootView: AnyView(buildDetailView())) + detailHosting = NSHostingController(rootView: AnyView(Color.clear)) detailSplitItem = NSSplitViewItem(viewController: detailHosting) detailSplitItem.minimumThickness = Self.detailMinThickness detailSplitItem.holdingPriority = .defaultLow @@ -216,12 +216,7 @@ internal final class MainSplitViewController: NSSplitViewController, InspectorVi splitView.autosaveName = splitAutosaveName applyDefaultCollapseStateIfNoAutosave() - if let session = currentSession, session.driver != nil, let coordinator = sessionState?.coordinator { - sidebarContainer.updateSidebarState( - SharedSidebarState.forConnection(session.connection.id), - windowState: coordinator.windowSidebarState - ) - } + rebuildPanes() } override func splitViewDidResizeSubviews(_ notification: Notification) {