From d8dfca5f07bf39f4f3f53cb412794bfdcd451a4a Mon Sep 17 00:00:00 2001
From: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Date: Thu, 9 Apr 2026 16:29:47 -0700
Subject: [PATCH] fix: prevent tab width shift during auto-save dirty state
toggle (#427)
Move dirty-dot indicator and close button into a shared fixed-width
container so toggling between dirty/clean states during auto-save
does not cause the tab to resize.
---
.../src/components/tab-bar/EditorFileTab.tsx | 41 +++++++++++--------
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git a/src/renderer/src/components/tab-bar/EditorFileTab.tsx b/src/renderer/src/components/tab-bar/EditorFileTab.tsx
index f0767e75277..f56d6410c24 100644
--- a/src/renderer/src/components/tab-bar/EditorFileTab.tsx
+++ b/src/renderer/src/components/tab-bar/EditorFileTab.tsx
@@ -123,9 +123,6 @@ export default function EditorFileTab({
className={`w-3.5 h-3.5 mr-1.5 shrink-0 ${isActive ? 'text-foreground' : 'text-muted-foreground'}`}
/>
)}
- {file.isDirty && (
-
- )}
)}
-
+ {/* Dirty dot and close button share the same slot to prevent tab width shift during auto-save.
+ When dirty: dot is shown, close button appears on hover (replacing the dot).
+ When clean: close button is shown normally (visible on active tab, on hover for others). */}
+