Chat2DB Edition
Chat2DB Community
Chat2DB Version
Source build: f5d2a7c
Deployment
Desktop
Operating System
macOS
Operating System Version
27.0
Database and Version
N/A - this is a database-independent UI navigation issue.
Problem Summary
Creating a query from a database or schema context menu unexpectedly switches the left sidebar from Data Browser to Files. This removes the database context from view immediately after the query is created.
Steps to Reproduce
- Open Chat2DB Desktop and select Data Browser.
- Expand a datasource and select a database or schema.
- Right-click the node and choose "New Query".
- Wait for the new SQL console to become active.
- Observe the active sidebar tab.
Expected Behavior
The new SQL console should open while Data Browser remains active. The selected database node, expansion state, and scroll position should be preserved.
When "Auto-follow current tab" is enabled, a database-backed SQL console should be located in Data Browser. Opening an actual local SQL file should continue to switch to Files.
Actual Behavior
The SQL console opens, but the sidebar switches to Files and displays the local workspace tree. The user must manually return to Data Browser.
Logs
N/A - no error is displayed.
Screenshots or Additional Context
N/A
Impact
Degrades a core workflow
Workaround
A reliable workaround exists
Submission Checklist
Maintainer Ready Contract
- User outcome: Creating a database-backed query keeps Data Browser visible and preserves its current tree context; opening a real local SQL file still selects Files.
- In scope:
- Trace the workspace-tab metadata created by the database/schema
New Query action.
- Preserve the datasource/database/schema context needed by
getActiveTabLocateTarget.
- Add a focused regression test for database-backed console tabs and local SQL file tabs.
- Add the exact frontend test command to
package.json and Community CI.
- Non-goals:
- Redesigning the workspace sidebar or tab layout.
- Changing manual panel selection while Auto-follow current tab is disabled.
- Changing how local SQL files are revealed in Files.
- Suggested code or documentation area:
chat2db-community-client/src/pages/main/workspace/utils/activeTabLocator.ts
chat2db-community-client/src/pages/main/workspace/components/WorkspaceLeft/index.tsx
- The context-menu query creation path that constructs the
WorkspaceTabType.CONSOLE tab.
- Acceptance criteria:
- A console created from a datasource, database, or schema resolves to
surface: 'databaseTree'.
- Activating that console does not select Files.
- A
WorkspaceTabType.LocalSQLFile tab still resolves to surface: 'localFile'.
- Auto-follow off preserves the user's current sidebar panel.
- The regression is covered by a deterministic TypeScript test with no desktop bridge.
- Exact verification:
yarn run test:active-tab-locator
yarn lint:eslint
yarn run build:web:community --app_version=5.3.0
- Dependencies or required environment: Node.js 22.22.2 and Yarn 1.x. No database or JCEF runtime should be required for the automated test.
- Review maintainer: @openai0229
- First substantive review target: 5 business days
- Milestone: Not release-committed
Chat2DB Edition
Chat2DB Community
Chat2DB Version
Source build: f5d2a7c
Deployment
Desktop
Operating System
macOS
Operating System Version
27.0
Database and Version
N/A - this is a database-independent UI navigation issue.
Problem Summary
Creating a query from a database or schema context menu unexpectedly switches the left sidebar from Data Browser to Files. This removes the database context from view immediately after the query is created.
Steps to Reproduce
Expected Behavior
The new SQL console should open while Data Browser remains active. The selected database node, expansion state, and scroll position should be preserved.
When "Auto-follow current tab" is enabled, a database-backed SQL console should be located in Data Browser. Opening an actual local SQL file should continue to switch to Files.
Actual Behavior
The SQL console opens, but the sidebar switches to Files and displays the local workspace tree. The user must manually return to Data Browser.
Logs
Screenshots or Additional Context
N/A
Impact
Degrades a core workflow
Workaround
A reliable workaround exists
Submission Checklist
Maintainer Ready Contract
New Queryaction.getActiveTabLocateTarget.package.jsonand Community CI.chat2db-community-client/src/pages/main/workspace/utils/activeTabLocator.tschat2db-community-client/src/pages/main/workspace/components/WorkspaceLeft/index.tsxWorkspaceTabType.CONSOLEtab.surface: 'databaseTree'.WorkspaceTabType.LocalSQLFiletab still resolves tosurface: 'localFile'.yarn run test:active-tab-locatoryarn lint:eslintyarn run build:web:community --app_version=5.3.0