From 67e23ad3e06a9bbbf250520f2cbfbe3385f28c0e Mon Sep 17 00:00:00 2001 From: zipg Date: Sat, 4 Jul 2026 00:38:03 +0800 Subject: [PATCH] feat(ui): mark unsaved SQL tabs Co-authored-by: staff --- .../src/components/layout/AppTabBar.vue | 62 +++++++++++++++++-- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/components/layout/AppTabBar.vue b/apps/desktop/src/components/layout/AppTabBar.vue index 41ebc895a..a88599985 100644 --- a/apps/desktop/src/components/layout/AppTabBar.vue +++ b/apps/desktop/src/components/layout/AppTabBar.vue @@ -141,6 +141,29 @@ function cancelRenameTab() { editingTabId.value = null; } +function isDirtyTab(tab: QueryTab) { + return queryStore.isTabDirty(tab); +} + +function tabTitleLabel(tab: QueryTab) { + const title = tabDisplayTitle(tab, t); + return isDirtyTab(tab) ? `* ${title}` : title; +} + +function tabTitleText(tab: QueryTab) { + return tabDisplayTitle(tab, t); +} + +function tabTitleStyle(tab: QueryTab): CSSProperties | undefined { + if (!isDirtyTab(tab)) return undefined; + return { + fontStyle: "italic", + fontWeight: 700, + transform: "skewX(-8deg)", + transformOrigin: "left center", + }; +} + type SpecialRegularSurface = "driverStore" | "settings"; function closeSpecialRegularSurfaces(keep?: SpecialRegularSurface) { @@ -554,7 +577,10 @@ function onOverflowItemKeydown(event: KeyboardEvent, tabId: string, kind: "regul @keydown.escape.prevent="cancelRenameTab" @blur="commitRenameTab(tab)" /> - {{ tabDisplayTitle(tab, t) }} + + + {{ tabTitleText(tab) }} + @@ -645,7 +671,7 @@ function onOverflowItemKeydown(event: KeyboardEvent, tabId: string, kind: "regul