You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Editor tabs never become clean again once edited #855
A query tab's isDirty flag is set on the first edit and is never cleared afterwards. The unsaved-changes dot on the tab, the update guard (src/lib/update-guard.ts), the favorites check (QueryFavorites.tsx) and the new close confirmation (#843) all read this flag. So all of them treat a tab as unsaved for good after a single keystroke, even after its SQL has been saved to a file or to a favorite.
setTabDirty exists, but nothing outside the tests calls it. updateContent (editorStore.ts:162) sets isDirty: true on every change.
Fix
Clear the flag wherever the tab's content becomes saved: Save / Save As to a file, and saving to a favorite.
Alternatively, define dirty as "content differs from the last saved content": keep a savedContent on the tab and compare against it, so undoing back to the saved text also counts as clean.
This also has the opposite effect. editor-session.ts:43 restores every tab with isDirty: false. The close confirmation from #843 (PR #856) only asks when isDirty is set. So after a restart, closing a tab whose SQL exists nowhere else gives no prompt.
The fix should settle on one definition of "unsaved" and carry it across a restart. Persisting the saved content, as suggested above, would cover both cases.
Activity
EVWorth commentedon Oct 23, 2026
This also has the opposite effect.
editor-session.ts:43restores every tab withisDirty: false. The close confirmation from #843 (PR #856) only asks whenisDirtyis set. So after a restart, closing a tab whose SQL exists nowhere else gives no prompt.The fix should settle on one definition of "unsaved" and carry it across a restart. Persisting the saved content, as suggested above, would cover both cases.
Generated by Claude Code
fix(editor): let a tab become clean once saved