From 34429cf8d69968db24df21a3f27dd2c192125e59 Mon Sep 17 00:00:00 2001
From: hanxuanyu <2252193204@qq.com>
Date: Sat, 17 Oct 2026 15:15:20 +0800
Subject: [PATCH] fix(tabs): use query file icon for query tabs
---
apps/desktop/src/components/layout/TabModeIcon.vue | 2 +-
apps/desktop/src/lib/__tests__/tabs/tabPresentation.spec.ts | 1 +
apps/desktop/src/lib/tabs/tabPresentation.ts | 5 ++---
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/apps/desktop/src/components/layout/TabModeIcon.vue b/apps/desktop/src/components/layout/TabModeIcon.vue
index 86887f649e..3b8f33743c 100644
--- a/apps/desktop/src/components/layout/TabModeIcon.vue
+++ b/apps/desktop/src/components/layout/TabModeIcon.vue
@@ -42,6 +42,6 @@ defineProps<{ tab: QueryTab }>();
-
+
diff --git a/apps/desktop/src/lib/__tests__/tabs/tabPresentation.spec.ts b/apps/desktop/src/lib/__tests__/tabs/tabPresentation.spec.ts
index 924de1df22..6ae7c65bb6 100644
--- a/apps/desktop/src/lib/__tests__/tabs/tabPresentation.spec.ts
+++ b/apps/desktop/src/lib/__tests__/tabs/tabPresentation.spec.ts
@@ -957,6 +957,7 @@ describe("statement execution markers", () => {
describe("shared tab presentation helpers", () => {
it("classifies tab icon colors without MQ special-casing", () => {
+ expect(tabIconClass(queryTab({}))).toBe("text-blue-400");
expect(tabIconClass(queryTab({ mode: "data" }))).toContain("text-green-500");
const connectionStore = useConnectionStore();
connectionStore.connections = [{ id: "dynamodb-1", name: "DynamoDB", db_type: "dynamodb", driver_profile: "dynamodb", color: "" } as ConnectionConfig];
diff --git a/apps/desktop/src/lib/tabs/tabPresentation.ts b/apps/desktop/src/lib/tabs/tabPresentation.ts
index baffb02269..45535df0c4 100644
--- a/apps/desktop/src/lib/tabs/tabPresentation.ts
+++ b/apps/desktop/src/lib/tabs/tabPresentation.ts
@@ -819,9 +819,8 @@ export function tabIconClass(tab: QueryTab): string {
if (tab.mode === "mongo") return "text-green-400";
if (tab.mode === "vector") return "text-cyan-400";
if (tab.mode === "structure") return "text-blue-500";
- // query 的图标是数据库品牌 logo(TabModeIcon),不吃文字颜色;回退的
- // Database 图标自带 text-blue-400,与 mq 模式同样返回空串。
- if (tab.mode === "query") return "";
+ // Match the saved query file icon in the connection sidebar.
+ if (tab.mode === "query") return "text-blue-400";
return "text-blue-600 dark:text-blue-400";
}