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(sidebar): reduce connection selection repaint cost

t8y2a5b3409985eb
diff --git a/apps/desktop/src/components/sidebar/TreeItem.vue b/apps/desktop/src/components/sidebar/TreeItem.vue
index 2bae520cd2..5c0178b5fe 100644
--- a/apps/desktop/src/components/sidebar/TreeItem.vue
+++ b/apps/desktop/src/components/sidebar/TreeItem.vue
@@ -800,19 +800,24 @@ function selectTreeNodeRange(node: TreeNode) {
connectionStore.selectedTreeNodeId = node.id;
}
-const selectedConnectionIds = computed(() => {
+function selectedConnectionIdsForAction(): string[] {
const connectionIds = new Set(connectionStore.connections.map((connection) => connection.id));
return connectionStore.selectedTreeNodeIds.filter((id) => connectionIds.has(id));
-});
+}
-const isConnectionSelectionChecked = computed(() => connectionStore.connectionMultiSelectActive && props.node.type === "connection" && !!props.node.connectionId && selectedConnectionIds.value.includes(props.node.connectionId));
+const isConnectionSelectionChecked = computed(() => {
+ if (!connectionStore.connectionMultiSelectActive || props.node.type !== "connection" || !props.node.connectionId) return false;
+ return connectionStore.selectedTreeNodeIds.includes(props.node.connectionId);
+});
function toggleConnectionMultiSelection(event: MouseEvent) {
event.preventDefault();
event.stopPropagation();
if (props.node.type !== "connection" || !props.node.connectionId) return;
- const next = new Set(connectionStore.connectionMultiSelectActive ? selectedConnectionIds.value : []);
+ // Keep connection-id normalization off the row render path; this handler only
+ // runs when the checkbox is clicked, while the checked state updates often.
+ const next = new Set(connectionStore.connectionMultiSelectActive ? selectedConnectionIdsForAction() : []);
if (next.has(props.node.connectionId)) next.delete(props.node.connectionId);
else next.add(props.node.connectionId);