feat: multi-result tabs, column statistics, and Ctrl+W close tab

- ResultsPanel rewritten: single queries show one result as before;
  scripts with multiple statements show each result in a named sub-tab
  (e.g. "Result 2 (1,234)") with the tab bar auto-shown/hidden
- EditorTab._on_script_done now calls show_script_results() instead of
  overwriting the panel on each statement
- ColumnStatsDialog: right-click any column header in TableViewer to see
  total rows, null count, distinct values, min, max, and avg (async,
  gracefully skips avg for non-numeric columns)
- TableViewer header context menu also adds "Resize to fit" shortcuts
- Ctrl+W closes the current workspace tab (View menu)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-21 17:10:35 -04:00
co-authored by Claude Sonnet 4.6
parent 771c92b7b6
commit 9f0891755e
5 changed files with 334 additions and 81 deletions
+6
View File
@@ -182,6 +182,7 @@ class MainWindow(QMainWindow):
view_menu = mb.addMenu("&View")
view_menu.addAction(self._act("Toggle Query History", self._toggle_history, "Ctrl+Shift+H"))
view_menu.addAction(self._act("New SQL Tab", self._new_sql_tab, "Ctrl+T"))
view_menu.addAction(self._act("Close Tab", self._close_current_tab, "Ctrl+W"))
# ── Tools ─────────────────────────────────────────────────────────────
tools_menu = mb.addMenu("&Tools")
@@ -470,6 +471,11 @@ class MainWindow(QMainWindow):
self._workspace.setVisible(False)
self._empty_label.setVisible(True)
def _close_current_tab(self):
idx = self._workspace.currentIndex()
if idx >= 0:
self._close_tab(idx)
def _on_cell_selected(self, value: str):
"""Show a truncated cell value in the status bar."""
if not value or value == "NULL":