From b5ba015af1ed9e4759302235833b0a9b75b0a833 Mon Sep 17 00:00:00 2001 From: Eugene Date: Sun, 14 Jun 2026 08:54:03 -0400 Subject: [PATCH] fix: single-click on sidebar table only toggles columns, not a new tab (#54) Single-clicking a table in the schema browser used to both expand/collapse its column list and open (or switch to) a SELECT query tab, navigating users away from unsaved work just for wanting to peek at column names. Single-click now only toggles the column list. Opening a query tab is a deliberate action: double-click the table, or pick "Query table" from the right-click context menu (both call the existing onTableSelect path, so the dedupe-by-(schema,table) and PK-aware template behaviour is unchanged). Co-Authored-By: Claude Opus 4.8 (1M context) --- src/components/SchemaBrowser.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/SchemaBrowser.tsx b/src/components/SchemaBrowser.tsx index 0ee16e1..350ddfb 100644 --- a/src/components/SchemaBrowser.tsx +++ b/src/components/SchemaBrowser.tsx @@ -250,12 +250,17 @@ export function SchemaBrowser({ schema, activeTable, onTableSelect, onSchemaChan
{ onTableSelect(table.name); toggleTable(table.name); }} + // Single-click only expands/collapses the column list — it must + // not steal the user's current editor tab. Opening a query tab + // is a deliberate action: double-click, or the context menu's + // "Query table". See #54. + onClick={() => toggleTable(table.name)} + onDoubleClick={() => onTableSelect(table.name)} onContextMenu={(e) => { e.preventDefault(); setContextMenu({ x: e.clientX, y: e.clientY, name: table.name, type: 'table' }); }} - title={table.comment || undefined} + title={table.comment ? `${table.comment} — double-click to query` : 'Double-click to query'} > @@ -318,6 +323,12 @@ export function SchemaBrowser({ schema, activeTable, onTableSelect, onSchemaChan /> {contextMenu.type === 'table' && (<>
+ { onTableSelect(contextMenu.name); setContextMenu(null); }} + icon={<>} + label="Query table" + /> {onAlterTable && (