From 4062f11a262a66eb0463e56d5c0d02ae9e3ada96 Mon Sep 17 00:00:00 2001 From: zhangyc Date: Fri, 31 Jul 2026 01:57:27 +0800 Subject: [PATCH] feat(tabs): distinguish object and table data tabs --- apps/desktop/src/components/layout/AppTabBar.vue | 3 ++- .../src/components/layout/__tests__/AppTabBar.spec.ts | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/components/layout/AppTabBar.vue b/apps/desktop/src/components/layout/AppTabBar.vue index c8e38d346..8c8a9f2f0 100644 --- a/apps/desktop/src/components/layout/AppTabBar.vue +++ b/apps/desktop/src/components/layout/AppTabBar.vue @@ -449,7 +449,8 @@ function tabColorStyle(tab: QueryTab) { function tabIconClass(tab: QueryTab) { if (tab.mode === "mq") return ""; - if (tab.mode === "data" || tab.mode === "mongo" || tab.mode === "vector" || tab.mode === "redis" || tab.mode === "hbase" || tab.mode === "objects" || tab.mode === "structure") return "text-emerald-600 dark:text-emerald-400"; + if (tab.mode === "objects") return "text-amber-500 dark:text-amber-400"; + if (tab.mode === "data" || tab.mode === "mongo" || tab.mode === "vector" || tab.mode === "redis" || tab.mode === "hbase" || tab.mode === "structure") return "text-emerald-600 dark:text-emerald-400"; return "text-blue-600 dark:text-blue-400"; } diff --git a/apps/desktop/src/components/layout/__tests__/AppTabBar.spec.ts b/apps/desktop/src/components/layout/__tests__/AppTabBar.spec.ts index 4ce55a363..5f9975770 100644 --- a/apps/desktop/src/components/layout/__tests__/AppTabBar.spec.ts +++ b/apps/desktop/src/components/layout/__tests__/AppTabBar.spec.ts @@ -23,6 +23,15 @@ describe("AppTabBar HBase presentation", () => { it("uses the table icon in regular, pinned, and overflow tab surfaces", () => { expect(tabBarSource).toContain('if (tab.mode === "data" || tab.mode === "mongo" || tab.mode === "redis" || tab.mode === "hbase") return Table2;'); expect(tabBarSource.match(/tab\.mode === 'hbase'/g)).toHaveLength(2); - expect(tabBarSource).toContain('tab.mode === "hbase" || tab.mode === "objects"'); + expect(tabBarSource).toContain('tab.mode === "hbase" || tab.mode === "structure"'); + }); +}); + +describe("AppTabBar objects presentation", () => { + it("uses an amber icon color on regular, pinned, and overflow tab surfaces", () => { + expect(tabBarSource).toContain('if (tab.mode === "objects") return "text-amber-500 dark:text-amber-400";'); + expect(tabBarSource).toContain('if (tab.mode === "objects") return TableProperties;'); + expect(tabBarSource.match(/:class="tabIconClass\(tab\)"/g)).toHaveLength(2); + expect(tabBarSource.match(/tabMenuIcon\(tab\).*tabIconClass\(tab\)/g)).toHaveLength(2); }); });