fix(hig): use NSSplitView for Server Dashboard panels (#1464)#1466
Merged
Conversation
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.
Summary
Fixes #1464 — the Slow Queries panel at the bottom of the Server Dashboard could not be opened.
Root cause: the dashboard laid out Active Sessions, Server Metrics, and Slow Queries inside a plain
VStack. SwiftUI'sTable(inSessionsTableView) is greedy and consumed all vertical space, so theDisclosureGroupfor Slow Queries got 0 pt of content area. Apple's own developer forum #726444 documents this exactDisclosureGroup-with-greedy-content failure.Fix: replace the inner
VStackwithNSSplitView(vertical orientation, thin dividers) per Apple HIG guidance for multi-pane dashboards. The split view lives in a newServerDashboardSplitViewthat wrapsNSSplitViewControllerviaNSViewControllerRepresentable, mirroring the existingQuerySplitView.swiftpattern.splitView.autosaveNamepersists divider positions across launches.The inner
DisclosureGroupinSlowQueryListViewis removed — the split divider is the resize affordance and the three panels now share a uniform header style.What's in the diff
ServerDashboardSplitView.swift(new) —NSSplitViewControllerwrapper. Items added in panel order fromviewModel.supportedPanels, so SQLite/DuckDB (one pane) and MySQL/PostgreSQL/MSSQL/ClickHouse (three panes) both work.min 120 pt, low holding priority (grows with the window).min 76 / max 200 pt, higher holding priority.min 100 pt,canCollapse = true.ServerDashboardView.swift— drops the innerVStackand manual dividers; uses the new wrapper.SlowQueryListView.swift— removes@State isExpandedandDisclosureGroup; matches the header style of the other panels.ServerDashboardViewModelTests.swift(new) — Swift Testing suite coveringsupportedPanelsper provider, kill/cancel capability matrix, and confirmation-state setters.docs/features/server-dashboard.mdx— drops "collapsible" wording; documents the draggable dividers and persistence.CHANGELOG.md—Fixedentry under[Unreleased].Test plan
xcodebuild -project TablePro.xcodeproj -scheme TablePro -configuration Debug build -skipPackagePluginValidation).xcodebuild -project TablePro.xcodeproj -scheme TablePro test -skipPackagePluginValidation -only-testing:TableProTests/ServerDashboardViewModelTests.