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:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user