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
QueryFavorites.tsx:69-77 (handleClick only checks 'query' === activeTab.type, not isDirty).
Problem
handleClick doesn't check that the active tab is type === "query" AND isDirty: false — if the user has a dirty query tab open and clicks a favorite, the favorite's SQL overwrites the dirty content silently. handleDoubleClick (line 79-83) ALWAYS creates a new tab — even if the active tab is a query tab that could receive the SQL. The dual behavior is inconsistent in its check: handleClick has the type check, handleDoubleClick doesn't.
Files
src/components/favorites/QueryFavorites.tsx:69-77
Expected
Clicking a favorite while the active query tab is dirty shows a confirmation; choosing Cancel keeps the favorite in the sidebar and the active tab content untouched; choosing Replace loads the favorite.
Proposed fix
Scope S — in handleClick, if the active tab is a query tab with isDirty: true, show a confirmation: "Replace content of current tab? Unsaved changes will be lost." Use the existing editorStore.confirmDiscard if it exists, or just inline window.confirm.
Acceptance
Clicking a favorite while the active query tab is dirty shows a confirmation; choosing Cancel keeps the favorite in the sidebar and the active tab content untouched; choosing Replace loads the favorite.
Activity
fix(favorites): confirm before overwriting dirty editor tab (#341)
fix(favorites): confirm before overwriting dirty editor tab (closes #341