Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(grid): reset filter/sort when reusing data tab

t8y2c411cc67072d
diff --git a/apps/desktop/src/components/sidebar/TreeItem.vue b/apps/desktop/src/components/sidebar/TreeItem.vue
index d07f592138..23675f0fc9 100644
--- a/apps/desktop/src/components/sidebar/TreeItem.vue
+++ b/apps/desktop/src/components/sidebar/TreeItem.vue
@@ -888,6 +888,15 @@ async function openData() {
if (existing) {
existing.title = node.label;
existing.schema = tableSchema;
+ // Reset per-table filter/sort state so the reused tab doesn't keep
+ // the previous table's WHERE/ORDER BY. DataGrid remounts (result is
+ // cleared below) and reinitializes its inputs from these props.
+ existing.whereInput = undefined;
+ existing.orderByInput = undefined;
+ existing.resultSortColumn = undefined;
+ existing.resultSortColumnIndex = undefined;
+ existing.resultSortDirection = undefined;
+ existing.resultSortedSql = undefined;
queryStore.activeTabId = existing.id;
return existing.id;
}