feat(desktop): add zen mode toggle for data tabs

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-08-27 17:59:10 +08:00
1 parent 955558c81f
commit 214bf86a6f
16 files changed
+105 -9

No files matched your search

@@ -66,6 +66,19 @@ describe("AppTabBar locate-in-sidebar action", () => {
});
});
describe("AppTabBar Zen mode interaction", () => {
it("switches Zen mode for data tabs while preserving query-tab renaming", () => {
const handler = sourceBetween("function handleTabDoubleClick", "function handleTabMouseDown");
expect(tabBarSource).toContain('"toggle-zen-mode": [];');
expect(handler).toContain('if (tab.mode === "data") {');
expect(handler).toContain('emit("toggle-zen-mode");');
expect(handler).toContain("startRenameTab(tab);");
expect(handler).toContain("event.target instanceof Element && event.target.closest(\"button, input, [role='button']\")");
expect(tabBarSource.match(/@dblclick="handleTabDoubleClick\(tab, \$event\)"/g)).toHaveLength(2);
});
});
describe("AppTabBar right-side close action", () => {
it("places the action after close-other and disables it when the target has no tabs to its right", () => {
expect(tabBarSource).toContain('label: t("contextMenu.closeRightTabs")');