Skip to content

fix(hig): use NSSplitView for Server Dashboard panels (#1464)#1466

Merged
datlechin merged 2 commits into
mainfrom
fix/server-dashboard-slow-queries-1464
May 28, 2026
Merged

fix(hig): use NSSplitView for Server Dashboard panels (#1464)#1466
datlechin merged 2 commits into
mainfrom
fix/server-dashboard-slow-queries-1464

Conversation

@datlechin

Copy link
Copy Markdown
Member

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's Table (in SessionsTableView) is greedy and consumed all vertical space, so the DisclosureGroup for Slow Queries got 0 pt of content area. Apple's own developer forum #726444 documents this exact DisclosureGroup-with-greedy-content failure.

Fix: replace the inner VStack with NSSplitView (vertical orientation, thin dividers) per Apple HIG guidance for multi-pane dashboards. The split view lives in a new ServerDashboardSplitView that wraps NSSplitViewController via NSViewControllerRepresentable, mirroring the existing QuerySplitView.swift pattern. splitView.autosaveName persists divider positions across launches.

The inner DisclosureGroup in SlowQueryListView is 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)NSSplitViewController wrapper. Items added in panel order from viewModel.supportedPanels, so SQLite/DuckDB (one pane) and MySQL/PostgreSQL/MSSQL/ClickHouse (three panes) both work.
    • Sessions: min 120 pt, low holding priority (grows with the window).
    • Metrics: min 76 / max 200 pt, higher holding priority.
    • Slow Queries: min 100 pt, canCollapse = true.
  • ServerDashboardView.swift — drops the inner VStack and manual dividers; uses the new wrapper.
  • SlowQueryListView.swift — removes @State isExpanded and DisclosureGroup; matches the header style of the other panels.
  • ServerDashboardViewModelTests.swift (new) — Swift Testing suite covering supportedPanels per provider, kill/cancel capability matrix, and confirmation-state setters.
  • docs/features/server-dashboard.mdx — drops "collapsible" wording; documents the draggable dividers and persistence.
  • CHANGELOG.mdFixed entry under [Unreleased].

Test plan

  • Build in Xcode (xcodebuild -project TablePro.xcodeproj -scheme TablePro -configuration Debug build -skipPackagePluginValidation).
  • Open a MySQL or PostgreSQL connection, open Server Dashboard, confirm all three panels render and Slow Queries content is visible.
  • Drag each divider; confirm panels resize.
  • Quit and relaunch TablePro; reopen the dashboard and confirm divider positions are restored.
  • Resize the window down to the minimum (720×480); confirm Slow Queries is still reachable and the dividers stay grabbable.
  • Open a SQLite connection's dashboard; confirm the one-pane layout (metrics only) still renders.
  • Run the new ViewModel test suite: xcodebuild -project TablePro.xcodeproj -scheme TablePro test -skipPackagePluginValidation -only-testing:TableProTests/ServerDashboardViewModelTests.

@datlechin datlechin merged commit 76ffd1e into main May 28, 2026
2 checks passed
@datlechin datlechin deleted the fix/server-dashboard-slow-queries-1464 branch May 28, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot open 'Slow Queries' list in Server Dashboard

1 participant