feat(tabs): distinguish object and table data tabs

This commit is contained in:
zhangyc authored and GitHub committed 2026-07-31 01:57:27 +08:00
1 parent 298223db8f
commit 4062f11a26
2 files changed
+12 -2

No files matched your search

@@ -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";
}
@@ -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);
});
});